diff --git a/Makefile b/Makefile index b5e85913e21af79124dc51cb719e717e17fea7e5..93406250ec14234ffaf7b2f0b436b54f3a10d201 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ TOOLS=-DSAMTOOLS=\"$(SAMTOOLS)\" -DBWA=\"$(BWA)\" -DSICKLE=\"$(SICKLE)\" -DVELVE # Date and version number from git DATE := on $(shell git log --pretty=format:"%cd" --date=iso | cut -f 1,2 -d " " | head -n 1) -VERSION := 0.0.4-snake-$(shell git log --pretty=format:"%h" --date=iso | head -n 1) +VERSION := 0.0.6-snake-$(shell git log --pretty=format:"%h" --date=iso | head -n 1) CXXFLAGS += -DDATE=\""$(DATE)"\" -DVERSION=\""$(VERSION)"\" # Compiler flags diff --git a/src/argument_parsing.h b/src/argument_parsing.h index e03cf5d01293fa652f059ddd495a0bc5a8eb6de6..879ec932bc5e425ff4f48ff2688c9f32d16e41c2 100644 --- a/src/argument_parsing.h +++ b/src/argument_parsing.h @@ -243,6 +243,7 @@ struct FindLocationsOptions { CharString prefix; CharString sampleID; CharString referenceFile; + CharString non_ref_bam; int maxInsertSize; bool deleteNonRefNew; @@ -251,6 +252,7 @@ struct FindLocationsOptions { prefix("."), sampleID(""), referenceFile("genome.fa"), + non_ref_bam("non_ref.bam"), maxInsertSize(800), deleteNonRefNew(false) {} @@ -568,6 +570,8 @@ bool getOptionValues(FindLocationsOptions &options, seqan::ArgumentParser &parse getOptionValue(options.prefix, parser, "prefix"); if (isSet(parser, "reference")) getOptionValue(options.referenceFile, parser, "reference"); + if (isSet(parser, "non-ref")) + getOptionValue(options.non_ref_bam, parser, "non-ref"); if (isSet(parser, "maxInsertSize")) getOptionValue(options.maxInsertSize, parser, "maxInsertSize"); if (isSet(parser, "delNonRefNew")) @@ -1123,6 +1127,7 @@ void setupParser(seqan::ArgumentParser &parser, FindLocationsOptions &options){ addSection(parser, "Input/output options"); addOption(parser, ArgParseOption("p", "prefix", "Path to the sample directories.", ArgParseArgument::STRING, "PATH")); addOption(parser, ArgParseOption("r", "reference", "Name of reference genome file.", ArgParseArgument::INPUT_FILE, "FASTA_FILE")); + addOption(parser, ArgParseOption("n", "non-ref", "Non-reference reads alignment file name.", ArgParseArgument::INPUT_FILE, "BAM FILE")); addSection(parser, "Algorithm options"); addOption(parser, ArgParseOption("e", "maxInsertSize", "The maximum expected insert size of the read pairs.", ArgParseArgument::INTEGER, "INT")); @@ -1134,6 +1139,7 @@ void setupParser(seqan::ArgumentParser &parser, FindLocationsOptions &options){ // Set default values. setDefaultValue(parser, "prefix", "\'.\'"); setDefaultValue(parser, "reference", options.referenceFile); + setDefaultValue(parser, "non-ref", options.non_ref_bam); setDefaultValue(parser, "maxInsertSize", options.maxInsertSize); setDefaultValue(parser, "delNonRefNew", "false"); @@ -1578,6 +1584,11 @@ ArgumentParser::ParseResult checkInput(FindLocationsOptions &options){ res = ArgumentParser::PARSE_ERROR; } + if (!exists(options.non_ref_bam)){ + std::cerr << "ERROR: Non-reference reads input file \'" << options.non_ref_bam << "\' does not exist." << std::endl; + res = ArgumentParser::PARSE_ERROR; + } + return res; } @@ -1758,15 +1769,16 @@ void printMultikOptions(const MultikOptions &options){ void printFindLocationsOptions(const FindLocationsOptions &options){ - cout << "=========================================================" << endl; - cout << "popins version : " << VERSION << endl; - cout << "PARAMETER ======== : VALUE ==============================" << endl; - cout << "prefix : " << options.prefix << endl; - cout << "sample ID : " << options.sampleID << endl; - cout << "reference file : " << options.referenceFile << endl; - cout << "max insert size : " << options.maxInsertSize << endl; - cout << "delete non_ref_new : " << options.deleteNonRefNew << endl; - cout << "=========================================================" << endl; + cout << "==========================================================" << endl; + cout << "popins version : " << VERSION << endl; + cout << "PARAMETER ========= : VALUE ==============================" << endl; + cout << "prefix : " << options.prefix << endl; + cout << "sample ID : " << options.sampleID << endl; + cout << "reference file : " << options.referenceFile << endl; + cout << "non-reference reads : " << options.non_ref_bam << endl; + cout << "max insert size : " << options.maxInsertSize << endl; + cout << "delete non_ref_new : " << options.deleteNonRefNew << endl; + cout << "==========================================================" << endl; } diff --git a/src/popins_find_locations.h b/src/popins_find_locations.h index abce6820173bb2cff69c929220261c3b98851fcd..dc98eaef69a4af4c24a7f925328d784812c6f89b 100644 --- a/src/popins_find_locations.h +++ b/src/popins_find_locations.h @@ -141,7 +141,7 @@ int popins_find_locations(int argc, char const ** argv){ //CharString fastqFirst = getFileName(workingDirectory, "paired.1.fastq"); //CharString fastqSecond = getFileName(workingDirectory, "paired.2.fastq"); //CharString fastqSingle = getFileName(workingDirectory, "single.fastq"); - CharString nonRefBam = getFileName(workingDirectory, "non_ref.bam"); + CharString nonRefBam = getFileName(workingDirectory, options.non_ref_bam); CharString nonRefNew = getFileName(workingDirectory, "non_ref_new.bam"); CharString locationsFile = getFileName(workingDirectory, "locations.txt");