Skip to content

Commit

Permalink
remove code smells #41
Browse files Browse the repository at this point in the history
  • Loading branch information
dkoslicki committed Oct 19, 2023
1 parent 908dacf commit 4127d95
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions run_YACHT.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@
ani_thresh = config['ani_thresh']

# Make sure the output can be written to
if os.access(os.path.abspath(os.path.dirname(out_filename)), os.W_OK):
pass
else:
if not os.access(os.path.abspath(os.path.dirname(out_filename)), os.W_OK):
raise FileNotFoundError(f"Cannot write to the location: {os.path.abspath(os.path.dirname(out_filename))}.")

# check if min_coverage is between 0 and 1
Expand Down
10 changes: 5 additions & 5 deletions tests/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ def test_incorrect_workflow1():

def test_demo_workflow():
cmd = "cd demo; sourmash sketch dna -f -p k=31,scaled=1000,abund -o sample.sig.zip query_data/query_data.fq"
res = subprocess.run(cmd, shell=True, check=True)
_ = subprocess.run(cmd, shell=True, check=True)
cmd = "cd demo; sourmash sketch fromfile ref_paths.csv -p dna,k=31,scaled=1000,abund -o ref.sig.zip --force-output-already-exists"
res = subprocess.run(cmd, shell=True, check=True)
_ = subprocess.run(cmd, shell=True, check=True)
cmd = "cd demo; python ../make_training_data_from_sketches.py --force --ref_file ref.sig.zip --ksize 31 --num_threads 1 --ani_thresh 0.95 --prefix 'demo_ani_thresh_0.95' --outdir ./"
res = subprocess.run(cmd, shell=True, check=True)
_ = subprocess.run(cmd, shell=True, check=True)
cmd = "cd demo; python ../run_YACHT.py --json demo_ani_thresh_0.95_config.json --sample_file sample.sig.zip --significance 0.99 --num_threads 1 --min_coverage_list 1 0.6 0.2 0.1 --out_filename result.xlsx"
res = subprocess.run(cmd, shell=True, check=True)
_ = subprocess.run(cmd, shell=True, check=True)
cmd = "cd demo; python ../srcs/standardize_yacht_output.py --yacht_output result.xlsx --sheet_name min_coverage0.2 --genome_to_taxid toy_genome_to_taxid.tsv --mode cami --sample_name 'MySample' --outfile_prefix cami_result --outdir ./"
res = subprocess.run(cmd, shell=True, check=True)
_ = subprocess.run(cmd, shell=True, check=True)


0 comments on commit 4127d95

Please sign in to comment.