def main(argv): if len(argv[1:]) == 3: input1dir = argv[1] input2dir = argv[2] outputdir = argv[3] else: print("Three arguements are needed!!") output = open(outputdir, 'w') try: all_reads = open(input1dir, 'r') except IOError: print ("no such file!") readslist = [] with open(input2dir, 'r') as inputfile: f = csv.DictReader(inputfile) for row in f: readslist.append(row['read']) # all the reads print("total reads in filter list:", len(readslist)) subset = Subsampling() subset.exclude_fa(all_reads, readslist, output)
def main(argv): start_time = time.clock() if len(argv[1:]) == 3: input1dir = argv[1] input2dir = argv[2] outputdir = argv[3] else: print("Three arguements are needed!!") output = open(outputdir, 'w') try: all_reads = open(input1dir, 'r') except IOError: print ("no such file!") readslist = [] with open(input2dir, 'r') as inputfile: f = csv.DictReader(inputfile, delimiter =",", fieldnames=['id','reads','taxa']) for row in f: readslist.append(row['reads']) # all the reads print("total reads in filter list:", len(readslist)) subset = Subsampling() subset.exclude_fa(all_reads, readslist, output) print time.clock() - start_time, "seconds"