view gene_family_integrator.py @ 1:274f9159ffab draft

Uploaded
author greg
date Tue, 01 Aug 2017 14:26:05 -0400
parents fa38de0b1f1a
children
line wrap: on
line source

#!/usr/bin/env python
import argparse
import os

import utils

OUTPUT_DIR = 'integratedGeneFamilies_dir'

parser = argparse.ArgumentParser()
parser.add_argument('--orthogroup_faa', dest='orthogroup_faa', help='Directory of input fasta datasets')
parser.add_argument('--scaffold', dest='scaffold', help='Orthogroups or gene families proteins scaffold')
parser.add_argument('--method', dest='method', help='Protein clustering method')
parser.add_argument('--orthogroup_fna', dest='orthogroup_fna', default=None, help='Use correspong coding sequences')
parser.add_argument('--output', dest='output', help='Output dataset')
parser.add_argument('--output_dir', dest='output_dir', help='Output dataset file_path directory')

args = parser.parse_args()

# Build the command line.
cmd = 'GeneFamilyIntegrator'
cmd += ' --orthogroup_faa %s' % args.orthogroup_faa
cmd += ' --scaffold %s' % args.scaffold
cmd += ' --method %s' % args.method
if args.orthogroup_fna is not None:
    cmd += ' --orthogroup_fna'

# Run the command.
utils.run_command(cmd)

# Handle outputs.
utils.move_directory_files(os.path.join(OUTPUT_DIR, 'orthogroups_fasta'), args.output_dir)
utils.write_html_output(args.output, 'Integrated gene family sequences', args.output_dir)