dumpOut() sys.exit(1) def sizeof_fmt(num, suffix='B'): for unit in ['','K','M','G','T','P','E','Z']: if abs(num) < 1024.0: return "%3.1f%s%s" % (num, unit, suffix) num /= 1024.0 return "%.1f%s%s" % (num, 'Yi', suffix) InDir = os.getcwd() if len(Args): InDir = Args[0] if not os.path.isdir( InDir): errExit('Input folder does not exist.') Sequences = cgruSequence( os.listdir( InDir), Options.verbose) SeqCount = 0 SeqFiles = 0 SeqSize = 0 mkdirs = [] for seq in Sequences: if not seq['seq']: continue SeqCount += 1 mkdir = os.path.join( InDir, seq['prefix'].strip( InvalidCharacters + '._ -')) dir_count = 0 name_with_count = mkdir while name_with_count in mkdirs:
if not os.path.isfile(afile): continue files.append(afile) else: errorExit('%s not found.' % inarg) outfolder = Options.output if outfolder is None: outfolder = inarg if arg_is_file: outfolder = os.path.dirname( outfolder) else: outfolder += '%s.%s' % ( ResQual, Options.type ) seqs = cgruSequence(files) for seq in seqs: cmd = 'convert' if Options.afanasy: cmd += ' -identify -verbose' elif Options.identify: cmd += ' -identify' if seq['seq']: inseq = '%s%%0%dd%s' % (seq['prefix'],seq['padding'],seq['suffix']) if Options.afanasy: cmd += ' "%s[@FIRST@-@LAST@]"' % inseq else: cmd += ' "%s[%d-%d]"' % (inseq,seq['first'],seq['last'])
if not os.path.isfile(afile): continue files.append(afile) else: errorExit('%s not found.' % inarg) outfolder = Options.output if outfolder is None: outfolder = inarg if arg_is_file: outfolder = os.path.dirname(outfolder) else: outfolder += '%s.%s' % (ResQual, Options.type) seqs = cgruSequence(files) for seq in seqs: cmd = 'convert' if Options.afanasy: cmd += ' -identify -verbose' elif Options.identify: cmd += ' -identify' if seq['seq']: inseq = '%s%%0%dd%s' % (seq['prefix'], seq['padding'], seq['suffix']) if Options.afanasy: cmd += ' "%s[@FIRST@-@LAST@]"' % inseq else: