Mercurial > repos > tiagoantao > clone_filter
view STACKS_clone_filter.py @ 4:f4b429a3494a draft
planemo upload commit f8902f8b9c07a5f74ec2a6c38672bebf2845f177-dirty
author | tiagoantao |
---|---|
date | Wed, 03 Feb 2016 10:58:13 -0500 |
parents | 42e64fbf4609 |
children | 1a5ebb16aaea |
line wrap: on
line source
#!/usr/bin/python # -*- coding: utf-8 -*- import shutil import subprocess import argparse def __main__(): parser = argparse.ArgumentParser() parser.add_argument('-f', type=str) parser.add_argument('-fwd', type=str) parser.add_argument('-rev', type=str) #parser.add_argument('-k', action='store_true') options = parser.parse_args() # create the working dir os.mkdir('job_outputs') os.chdir('job_outputs') # STACKS_archive # check if zipped files are into the tab extract_compress_files(options.P, os.getcwd()) # create the populations command input line cmd_line=['clone_filter'] if options.f is not None: cmd_line.extend(['-f', options.f]) else: cmd_line.extend(['-1', options.fwd]) cmd_line.extend(['-2', options.rev]) print "[CMD]:"+' '.join(cmd_line) subprocess.call(cmd_line) # postprocesses clean_files = glob.glob('*.fq') if options.f is not None: shutil.copy(clean_files[0], 'clean.fq') else: shutil.copy(clean_files[0], 'fwd.fq') shutil.copy(clean_files[1], 'rev.fq') if __name__ == '__main__': __main__()