示例#1
0
def main():
    usage = (
        'usage: %prog --maf=file.maf --referenceGenome=A --comparisonGenome=B --chrNames=c0,c1,... --chrLengths=N1,N2,... --outDir=path/to/dir/\n\n'
        '%prog takes in a maf filename ( --maf ), a reference genome name as\n'
        'it appears in the maf ( --referenceGenome ), a genome name to compare against\n'
        '( --comparisonGenome ), a paired list of chromosome names ( --chrNames comma\n'
        'separated ) and chromosome lengths ( --chrLengths comma separated ) and a path\n'
        'to a directory where the maf pickles will be written ( --outDir ), one pickle\n'
        'per chromosome.')
    data = Data()
    parser = OptionParser(usage=usage)
    initOptions(parser)
    options, args = parser.parse_args()
    checkOptions(options, parser, data)

    readMaf(options, data)
    switchToPositiveStrandCoordinates(options, data)

    for c in data.chroms:
        data.mafBlocksByChrom[c].sort(key=lambda x: x.refStart, reverse=False)
    trimDups(options, data)
    if options.verify:
        verifyDistinct(options, data)

    convertDataToWiggle(options, data)
    recordCoverage(options, data)

    if options.verify:
        verifyStacks(options, data)
        verifyElements(options, data)
        verifyLengths(options, data)

    packData(data.mafWigDict, options.filename, options)
def main():
   usage = ( 'usage: %prog --maf=file.maf --referenceGenome=A --comparisonGenome=B --chrNames=c0,c1,... --chrLengths=N1,N2,... --outDir=path/to/dir/\n\n'
             '%prog takes in a maf filename ( --maf ), a reference genome name as\n'
             'it appears in the maf ( --referenceGenome ), a genome name to compare against\n'
             '( --comparisonGenome ), a paired list of chromosome names ( --chrNames comma\n'
             'separated ) and chromosome lengths ( --chrLengths comma separated ) and a path\n'
             'to a directory where the maf pickles will be written ( --outDir ), one pickle\n'
             'per chromosome.')
   data = Data()
   parser = OptionParser( usage=usage )
   initOptions( parser )
   options, args = parser.parse_args()
   checkOptions( options, parser, data )

   readMaf( options, data )
   switchToPositiveStrandCoordinates( options, data )
   
   for c in data.chroms:
      data.mafBlocksByChrom[ c ].sort( key = lambda x: x.refStart, reverse=False )
   trimDups( options, data )
   if options.verify:
      verifyDistinct( options, data )
   
   convertDataToWiggle( options, data )
   recordCoverage( options, data )
   
   if options.verify:
      verifyStacks( options, data )
      verifyElements( options, data )
      verifyLengths( options, data )
   
   packData( data.mafWigDict, options.filename, options )
def main():
   usage = ( 'usage: %prog --gff=file.gff --outDir=path/to/dir/ --chrLengths=N1,N2,... --chrNames=A,B,...\n\n'
             '%prog takes in a gff file ( --gff ), an output directory ( --outDir ), and\n'
             'pairs of chromosome names ( --chrNames comma separated ) and chromosome \n'
             'lengths ( --chrLengths comma separated ) and returns one annotation wig\n'
             'pickle per chromosome in the output directory.')
   data = Data()
   parser = OptionParser( usage=usage )
   initOptions( parser )
   options, args = parser.parse_args()
   checkOptions( options, parser, data )
   readGff( options, data )
   for c in data.chrNames:
      data.gffRecordsByChrom[ c ].sort( key = lambda x: x.start, reverse=False )
   convertDataToWiggle( options, data )
   
   packData( data.annotWigDict, options.filename, options )
示例#4
0
def main():
    usage = (
        'usage: %prog --gff=file.gff --outDir=path/to/dir/ --chrLengths=N1,N2,... --chrNames=A,B,...\n\n'
        '%prog takes in a gff file ( --gff ), an output directory ( --outDir ), and\n'
        'pairs of chromosome names ( --chrNames comma separated ) and chromosome \n'
        'lengths ( --chrLengths comma separated ) and returns one annotation wig\n'
        'pickle per chromosome in the output directory.')
    data = Data()
    parser = OptionParser(usage=usage)
    initOptions(parser)
    options, args = parser.parse_args()
    checkOptions(options, parser, data)
    readGff(options, data)
    for c in data.chrNames:
        data.gffRecordsByChrom[c].sort(key=lambda x: x.start, reverse=False)
    convertDataToWiggle(options, data)

    packData(data.annotWigDict, options.filename, options)