Skip to content

Commit

Permalink
disable model option for now, plus housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
damurdock committed Jan 20, 2018
1 parent d78f95e commit ad2d461
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 6 additions & 4 deletions sidr/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,19 @@ def cli():
@click.option('--fasta', '-f', type=click.Path(exists=True), help="Preliminary assembly, in FASTA format.")
@click.option('--blastresults', '-r', type=click.Path(exists=True), help="Classification of preliminary assembly from BLAST (or similar tools).")
@click.option('--taxdump', '-d', type=click.Path(), default=os.environ.get('BLASTDB'), help="Location of the NCBI Taxonomy dump. Default is $BLASTDB.")
@click.option('--model', '-m', 'modelOutput', type=click.Path(), default="", help="Location to save a graphical representation of the trained decision tree (optional). Output is in the form of a DOT file.")
#@click.option('--model', '-m', 'modelOutput', type=click.Path(), default="", help="Location to save a graphical representation of the trained decision tree (optional). Output is in the form of a DOT file.")
@click.option('--output', '-o', type=click.Path(), default="%s/classifications.txt" % os.getcwd())
@click.option('--tokeep', '-k', type=click.Path(), default="", help="Location to save the contigs identified as the target organism(optional).")
@click.option('--toremove', '-x', type=click.Path(), default="", help="Location to save the contigs identified as not belonging to the target organism (optional).")
@click.option('--binary', is_flag=True, help="Use binary target/nontarget classification.")
@click.option('--target', '-t', help="The identity of the target organism at the chosen classification level. It is recommended to use the organism's phylum.")
@click.option('--level', '-l', default="phylum", help="The classification level to use when constructing the model. Default is 'phylum'.")
# @click.option('--verbose', '-v', count=True, help="Output more debugging options, repeat to increase verbosity (unimplemented).")
def default_runner(bam, fasta, blastresults, taxdump, modelOutput, output, tokeep, toremove, binary, target, level):
def default_runner(bam, fasta, blastresults, taxdump, output, tokeep, toremove, binary, target, level):
"""
Runs the default analysis using raw preassembly data.
"""
modelOutput = False
validate_taxdump(taxdump, runfile_runner)
default.runAnalysis(bam, fasta, blastresults, taxdump, modelOutput, output, tokeep, toremove, binary, target, level)

Expand All @@ -57,18 +58,19 @@ def default_runner(bam, fasta, blastresults, taxdump, modelOutput, output, tokee
@click.option('--infile', '-i', type=click.Path(exists=True), help="Tab-delimited input file.")
@click.option('--taxdump', '-d', type=click.Path(), default=os.environ.get('BLASTDB'), help="Location of the NCBI Taxonomy dump. Default is $BLASTDB.")
@click.option('--output', '-o', type=click.Path(), default="%s/classifications.txt" % os.getcwd())
@click.option('--model', '-m', 'modelOutput', type=click.Path(), default="", help="Location to save a graphical representation of the trained decision tree (optional). Output is in the form of a DOT file.")
#@click.option('--model', '-m', 'modelOutput', type=click.Path(), default="", help="Location to save a graphical representation of the trained decision tree (optional). Output is in the form of a DOT file.")
@click.option('--tokeep', '-k', type=click.Path(), default="", help="Location to save the contigs identified as the target organism(optional).")
@click.option('--toremove', '-x', type=click.Path(), default="", help="Location to save the contigs identified as not belonging to the target organism (optional).")
@click.option('--target', '-t', help="The identity of the target organism at the chosen classification level. It is recommended to use the organism's phylum.")
@click.option('--binary', is_flag=True, help="Use binary target/nontarget classification.")
@click.option('--level', '-l', default="phylum", help="The classification level to use when constructing the model. Default is 'phylum'.")
def runfile_runner(infile, taxdump, output, modelOutput, tokeep, toremove, binary, target, level):
def runfile_runner(infile, taxdump, output, tokeep, toremove, binary, target, level):
"""
Runs a custom analysis using pre-computed data from BBMap or other sources.
Input data will be read for all variables which will be used to construct a Decision Tree model.
"""
modelOutput = False
validate_taxdump(taxdump, runfile_runner)
runfile.runAnalysis(taxdump, infile, level, modelOutput, output, tokeep, toremove, binary, target)

Expand Down
3 changes: 1 addition & 2 deletions sidr/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def generateOutput(tokeep, toremove, result, contigs, target, output):
if target == contig[1]:
targetContigIDs.append(contig[0])
elif "target" == contig[1]:
targetContigIDs.append(contig[0]
targetContigIDs.append(contig[0])
else:
nontargetContigIDs.append(contig[0])
outputLines.append([contig[0], contig[1], "dt"])
Expand All @@ -237,4 +237,3 @@ def generateOutput(tokeep, toremove, result, contigs, target, output):
with open(toremove, "w+") as f:
for i in nontargetContigIDs:
f.write("%s\n" % i)

1 change: 0 additions & 1 deletion sidr/runfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import click
import pandas
import csv

from sidr import common

Expand Down

0 comments on commit ad2d461

Please sign in to comment.