Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report both total reads and alignments; version bump #86

Merged
merged 1 commit into from
Apr 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ std::ofstream& operator<<(std::ofstream &stream, rnaseqc::Metrics &counter)
std::vector<std::string> keys = {
//"Alternative Alignments",
//"Chimeric Reads",
"Duplicate Reads",
"End 1 Antisense",
"End 2 Antisense",
"End 1 Bases",
Expand Down Expand Up @@ -375,11 +374,14 @@ std::ofstream& operator<<(std::ofstream &stream, rnaseqc::Metrics &counter)
"Split Reads",
"Total Bases",
"Total Mapped Pairs",
"Total Reads",
// "Total Reads",
"Unique Mapping, Vendor QC Passed Reads",
"Unpaired Reads"
};
stream << "Total Alignments\t" << counter.get("Total Alignments") << std::endl;
stream << "Alternative Alignments\t" << counter.get("Alternative Alignments") << std::endl;
stream << "Supplementary Alignments\t" << counter.get("Supplementary Alignments") << std::endl;
stream << "Total Reads\t" << counter.get("Total Alignments") - counter.get("Alternative Alignments") - counter.get("Supplementary Alignments") << std::endl;
stream << "Chimeric Fragments\t";
if (counter.get("Chimeric Fragments_tag"))
{
Expand Down
7 changes: 4 additions & 3 deletions src/RNASeQC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using namespace args;
using namespace rnaseqc;

const string NM = "NM";
const string VERSION = "RNASeQC 2.4.2";
const string VERSION = "RNASeQC 2.4.3";
const double MAD_FACTOR = 1.4826;
const unsigned int LEGACY_MAX_READ_LENGTH = 100000u;
const int LEGACY_SPLIT_DISTANCE = 100;
Expand Down Expand Up @@ -89,7 +89,7 @@ int main(int argc, char* argv[])
const unsigned int BASE_MISMATCH_THRESHOLD = baseMismatchThreshold ? baseMismatchThreshold.Get() : 6u;
const unsigned int MAPPING_QUALITY_THRESHOLD = mappingQualityThreshold ? mappingQualityThreshold.Get() : (LegacyMode.Get() ? 4u : 255u);
const unsigned int COVERAGE_MASK = coverageMaskSize ? coverageMaskSize.Get() : 500u;
// const int SPLIT_DISTANCE = 100;
// const int SPLIT_DISTANCE = 100;
const int VERBOSITY = verbosity ? verbosity.Get() : 0;
const int BIAS_OFFSET = biasOffset ? biasOffset.Get() : 0;
const int BIAS_WINDOW = biasWindow ? biasWindow.Get() : 100;
Expand Down Expand Up @@ -252,6 +252,7 @@ int main(int argc, char* argv[])
}
//count metrics based on basic read data
if (alignment.SecondaryFlag()) counter.increment("Alternative Alignments");
if (alignment.SupplementaryFlag()) counter.increment("Supplementary Alignments");
else if (alignment.QCFailFlag()) counter.increment("Failed Vendor QC");
else if (alignment.MapQuality() < MAPPING_QUALITY_THRESHOLD) counter.increment("Low Mapping Quality");
if (alignment.SupplementaryFlag() && !(LegacyMode.Get() || readStringTag(alignment, chimeric_tag, trash)))
Expand Down Expand Up @@ -393,7 +394,7 @@ int main(int argc, char* argv[])
if (VERBOSITY > 1) cout << "Average Reads/Sec: " << static_cast<double>(alignmentCount) / difftime(t2, t1) << endl;
cout << "Estimating library complexity..." << endl;
}
counter.increment("Total Reads", alignmentCount);
counter.increment("Total Alignments", alignmentCount);
double duplicates = static_cast<double>(counter.get("Duplicate Pairs"));
double unique = static_cast<double>(counter.get("Unique Fragments"));
double numReads = duplicates + unique;
Expand Down
Loading