Mercurial > repos > greg > gene_family_integrator
comparison gene_family_integrator.py @ 0:109a0eb7791f draft
Uploaded
author | greg |
---|---|
date | Thu, 06 Apr 2017 13:34:02 -0400 |
parents | |
children | f53cafa72117 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:109a0eb7791f |
---|---|
1 #!/usr/bin/env python | |
2 import argparse | |
3 import subprocess | |
4 | |
5 import utils.py | |
6 | |
7 OUTPUT_DIR = 'integratedGeneFamilies_dir' | |
8 | |
9 parser = argparse.ArgumentParser() | |
10 parser.add_argument('--orthogroup_faa', dest='orthogroup_faa', help="Directory of input fasta datasets") | |
11 parser.add_argument('--scaffold', dest='scaffold', default='mode', help='Orthogroups or gene families proteins scaffold') | |
12 parser.add_argument('--method', dest='method', help='Protein clustering method') | |
13 parser.add_argument('--orthogroup_fna', dest='orthogroup_fna', default=None, help='Use correspong coding sequences') | |
14 parser.add_argument('--output', dest='output', help="Output dataset") | |
15 parser.add_argument('--output_dir', dest='output_dir', help="Output dataset file_path directory") | |
16 | |
17 args = parser.parse_args() | |
18 | |
19 # Build the command line. | |
20 cmd = 'GeneFamilyIntegrator' | |
21 cmd += ' --orthogroup_faa %s' % args.orthogroup_fasta | |
22 cmd += ' --scaffold %s' % args.scaffold | |
23 cmd += ' --method %s' % args.method | |
24 if args.orthogroup_fna is not None: | |
25 cmd += ' --orthogroup_fna' | |
26 # Run the command. | |
27 proc = subprocess.Popen(args=cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) | |
28 rc = proc.wait() | |
29 utils.check_execution_errors(rc, proc.stderr) | |
30 utils.move_directory_files(OUTPUT_DIR, args.output_dir) | |
31 utils.write_html_output(args.output, 'Integrated gene family sequences', args.output_dir) |