Skip to content

Commit

Permalink
Relative paths in db (#25)
Browse files Browse the repository at this point in the history
* Don't convert fasta_files paths to absolute paths

* Prepend database directory path on to relative paths for allele fasta files in db

* Don't create db_path variable, check for existence of fasta files

* Tidy up newlines

* Added test to check MLST calling after moving a database

* Fixed issue with scheme fasta loading during calling
  • Loading branch information
dfornika authored Mar 24, 2018
1 parent 26300a8 commit ebe974e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/MentaLiST.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Lumberjack
using ArgParse

VERSION = "0.2.3"
VERSION = "0.2.2"
function parse_commandline()
s = ArgParseSettings()
s.epilog = "MentaLiST -- The MLST pipeline developed by the PathOGiST research group. https://github.com/WGS-TB/MentaLiST\n" *
Expand Down Expand Up @@ -230,6 +230,9 @@ function build_db(args)
info("Combining results for each locus ...")
kmer_classification = combine_loci_classification(k, results, loci)

for (index, fasta_file) in enumerate(args["fasta_files"])
args["fasta_files"][index] = pop!(split(dirname(fasta_file), "/")) * "/" * basename(fasta_file)
end
info("Saving DB ...")
save_db(k, kmer_classification, loci, db_file, profile, args)
info("Done!")
Expand Down
6 changes: 2 additions & 4 deletions src/calling_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ function run_calling_pipeline(args)

# prepend base path of the kmer database on to the relative paths for allele fasta files stored in the db
for (index, file) in enumerate(build_args["fasta_files"])
build_args["fasta_files"][index] = dirname(args["db"]) * "/" * file
build_args["fasta_files"][index] = joinpath(dirname(args["db"]), file)
end
# check if scheme fasta files exist
for fasta_file in build_args["fasta_files"]
check_files(fasta_file)
end
check_files(build_args["fasta_files"])
# process each sample:
for (sample, fq_files) in sample_files
info("Sample: $sample. Opening fastq file(s) and counting kmers ... ")
Expand Down

0 comments on commit ebe974e

Please sign in to comment.