From 34b199ea5ac33e81704e669aeb3da194aec985b9 Mon Sep 17 00:00:00 2001 From: tobiasrausch Date: Tue, 22 Feb 2022 16:53:56 +0100 Subject: [PATCH] v0.7.1 --- src/consensus.h | 18 ++++++++++++------ src/version.h | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/consensus.h b/src/consensus.h index 6e261e9..a4c4017 100644 --- a/src/consensus.h +++ b/src/consensus.h @@ -53,6 +53,7 @@ namespace tracy { int32_t mismatch; float pratio; float trimStringency; + std::string label; std::string outprefix; DnaScore aliscore; boost::filesystem::path align; @@ -60,20 +61,24 @@ namespace tracy { std::vector files; }; + template inline void - consensusFastaOut(std::string const& outfile, std::string const& cons) { + consensusFastaOut(TConfig const& c, std::string const& cons) { // Output trace + std::string outfile = c.outprefix + ".fa"; std::ofstream rfile(outfile.c_str()); - rfile << ">Consensus" << std::endl; + rfile << ">" << c.label << std::endl; rfile << cons << std::endl; rfile.close(); } + template inline void - consensusFastqOut(std::string const& outfile, std::string const& cons, std::vector& qual) { + consensusFastqOut(TConfig const& c, std::string const& cons, std::vector& qual) { // Output trace + std::string outfile = c.outprefix + ".fq"; std::ofstream rfile(outfile.c_str()); - rfile << "@consensus" << std::endl; + rfile << "@" << c.label << std::endl; rfile << cons << std::endl; rfile << "+" << std::endl; for(uint32_t i = 0; i < qual.size(); ++i) { @@ -335,6 +340,7 @@ namespace tracy { boost::program_options::options_description generic("Generic options"); generic.add_options() ("help,?", "show help message") + ("label,b", boost::program_options::value(&c.label)->default_value("Consensus"), "sample label") ("pratio,p", boost::program_options::value(&c.pratio)->default_value(0.33), "peak ratio to call base") ; @@ -553,8 +559,8 @@ namespace tracy { pairwiseConsensus(c, fali, trimmedtrace1, trimmedtrace2, cons, qual); // Output - consensusFastaOut(c.outprefix + ".fa", cons); - consensusFastqOut(c.outprefix + ".fq", cons, qual); + consensusFastaOut(c, cons); + consensusFastqOut(c, cons, qual); // Show ClustalW like alignment plotClustalPairwise(c, fali, forward, score, c.linelimit); diff --git a/src/version.h b/src/version.h index 4de51f0..1407b14 100644 --- a/src/version.h +++ b/src/version.h @@ -5,7 +5,7 @@ namespace tracy { - std::string tracyVersionNumber = "0.6.1"; + std::string tracyVersionNumber = "0.7.1"; inline void printTitle(std::string const& title)