Skip to content

Commit

Permalink
Merge pull request #33 from snayfach/dev
Browse files Browse the repository at this point in the history
Print full command and database path with parameters
  • Loading branch information
snayfach authored Oct 25, 2016
2 parents f0ef5a7 + 3ad62d2 commit 5b977f6
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
1 change: 0 additions & 1 deletion scripts/build_midas_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def check_args(args):


if __name__ == "__main__":

args = fetch_arguments()
utility.add_executables(args)
check_args(args)
Expand Down
1 change: 1 addition & 0 deletions scripts/call_consensus.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def print_args(args):
lines.append(" site_maf: %s" % args['site_maf'])
lines.append(" site_ratio: %s" % args['site_ratio'])
lines.append(" max_sites: %s" % args['max_sites'])
lines.append("================================")
sys.stdout.write('\n'.join(lines)+'\n')

def check_args(args):
Expand Down
9 changes: 9 additions & 0 deletions scripts/merge_midas.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,22 @@ def print_arguments(program, args):

def print_species_arguments(args):
print ("===========Parameters===========")
print ("Command: %s" % ' '.join(sys.argv))
print ("Script: merge_midas.py species")
print ("Database: %s" % args['db'])
print ("Input: %s" % args['input'])
print ("Input type: %s" % args['intype'])
print ("Output directory: %s" % args['outdir'])
print ("Minimum coverage for estimating prevalence: %s" % args['min_cov'])
if args['max_samples']: print ("Keep <= %s samples" % args['max_samples'])
print ("===============================")
print ("")

def print_genes_arguments(args):
print ("===========Parameters===========")
print ("Command: %s" % ' '.join(sys.argv))
print ("Script: merge_midas.py genes")
print ("Database: %s" % args['db'])
print ("Input: %s" % args['input'])
print ("Input type: %s" % args['intype'])
print ("Output directory: %s" % args['outdir'])
Expand All @@ -292,11 +297,14 @@ def print_genes_arguments(args):
print ("Gene quantification criterea:")
print (" present (1): genes with copy number >= %s" % args['min_copy'])
print (" absent (0): genes with copy number < %s" % args['min_copy'])
print ("===============================")
print ("")

def print_snps_arguments(args):
print ("===========Parameters===========")
print ("Command: %s" % ' '.join(sys.argv))
print ("Script: merge_midas.py snps")
print ("Database: %s" % args['db'])
print ("Input: %s" % args['input'])
print ("Input type: %s" % args['intype'])
print ("Output directory: %s" % args['outdir'])
Expand All @@ -312,6 +320,7 @@ def print_snps_arguments(args):
print (" keep sites covered by >= %s reads across >= %s percent of samples" % (args['site_depth'], 100*args['site_prev']))
if args['max_sites'] != float('Inf'): print (" keep <= %s sites" % (args['max_sites']))
print ("Number of CPUs to use: %s" % args['threads'])
print ("===============================")
print ("")

def run_program(program, args):
Expand Down
11 changes: 10 additions & 1 deletion scripts/run_midas.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,20 @@ def species_arguments():
def print_species_arguments(args):
lines = []
lines.append("===========Parameters===========")
lines.append("Command: %s" % ' '.join(sys.argv))
lines.append("Script: run_midas.py species")
lines.append("Database: %s" % args['db'])
lines.append("Output directory: %s" % args['outdir'])
lines.append("Input reads (1st mate): %s" % args['m1'])
lines.append("Input reads (2nd mate): %s" % args['m2'])
lines.append("Remove temporary files: %s" % args['remove_temp'])
lines.append("Word size for database search: %s" % args['word_size'])
if args['mapid']: lines.append("Minimum mapping identity: %s" % args['mapid'])
lines.append("Minimum alignment coverage: %s" % args['aln_cov'])
lines.append("Minimum mapping alignment coverage: %s" % args['aln_cov'])
lines.append("Number of reads to use from input: %s" % (args['max_reads'] if args['max_reads'] else 'use all'))
if args['read_length']: lines.append("Trim reads to %s-bp and discard reads with length < %s-bp" % (args['read_length'], args['read_length']))
lines.append("Number of threads for database search: %s" % args['threads'])
lines.append("================================")
args['log'].write('\n'.join(lines)+'\n')
sys.stdout.write('\n'.join(lines)+'\n')

Expand Down Expand Up @@ -267,7 +270,9 @@ def gene_arguments():
def print_gene_arguments(args):
lines = []
lines.append("===========Parameters===========")
lines.append("Command: %s" % ' '.join(sys.argv))
lines.append("Script: run_midas.py genes")
lines.append("Database: %s" % args['db'])
lines.append("Output directory: %s" % args['outdir'])
lines.append("Remove temporary files: %s" % args['remove_temp'])
lines.append("Pipeline options:")
Expand Down Expand Up @@ -299,6 +304,7 @@ def print_gene_arguments(args):
lines.append(" minimum read quality score: %s" % args['readq'])
lines.append(" minimum mapping quality score: %s" % args['mapq'])
lines.append(" trim %s base-pairs from read-tails" % args['trim'])
lines.append("================================")
args['log'].write('\n'.join(lines)+'\n')
sys.stdout.write('\n'.join(lines)+'\n')

Expand Down Expand Up @@ -385,7 +391,9 @@ def snp_arguments():
def print_snp_arguments(args):
lines = []
lines.append("===========Parameters===========")
lines.append("Command: %s" % ' '.join(sys.argv))
lines.append("Script: run_midas.py snps")
lines.append("Database: %s" % args['db'])
lines.append("Output directory: %s" % args['outdir'])
lines.append("Remove temporary files: %s" % args['remove_temp'])
lines.append("Pipeline options:")
Expand Down Expand Up @@ -420,6 +428,7 @@ def print_snp_arguments(args):
if args['discard']: lines.append(" discard discordant read-pairs")
if args['baq']: lines.append(" enable BAQ (per-base alignment quality)")
if args['adjust_mq']: lines.append(" adjust MAPQ")
lines.append("================================")
args['log'].write('\n'.join(lines)+'\n')
sys.stdout.write('\n'.join(lines)+'\n')

Expand Down
2 changes: 2 additions & 0 deletions scripts/snp_diversity.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def format_site_type(args):
def print_args(args):
lines = []
lines.append("===========Parameters===========")
lines.append("Command: %s" % ' '.join(sys.argv))
lines.append("Script: snp_diversity.py")
lines.append("Input directory: %s" % args['indir'])
lines.append("Output file: %s" % args['out'])
Expand All @@ -135,6 +136,7 @@ def print_args(args):
lines.append(" site_ratio: %s" % args['site_ratio'])
lines.append(" site_freq: %s" % args['site_freq'])
lines.append(" max_sites: %s" % args['max_sites'])
print ("===============================")
sys.stdout.write('\n'.join(lines)+'\n')

def check_args(args):
Expand Down

0 comments on commit 5b977f6

Please sign in to comment.