Skip to content

Commit

Permalink
v0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Feb 22, 2022
1 parent 2b2a28b commit 34b199e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
18 changes: 12 additions & 6 deletions src/consensus.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,32 @@ namespace tracy {
int32_t mismatch;
float pratio;
float trimStringency;
std::string label;
std::string outprefix;
DnaScore<int32_t> aliscore;
boost::filesystem::path align;
boost::filesystem::path outfile;
std::vector<boost::filesystem::path> files;
};

template<typename TConfig>
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<typename TConfig>
inline void
consensusFastqOut(std::string const& outfile, std::string const& cons, std::vector<uint32_t>& qual) {
consensusFastqOut(TConfig const& c, std::string const& cons, std::vector<uint32_t>& 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) {
Expand Down Expand Up @@ -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<std::string>(&c.label)->default_value("Consensus"), "sample label")
("pratio,p", boost::program_options::value<float>(&c.pratio)->default_value(0.33), "peak ratio to call base")
;

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 34b199e

Please sign in to comment.