Skip to content

Commit

Permalink
Remove n_mitochondrial_reads
Browse files Browse the repository at this point in the history
  • Loading branch information
aawdeh committed Feb 6, 2024
1 parent 57b3d4d commit 32a2095
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 3 additions & 7 deletions tools/TagSort/src/metricgatherer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ MetricGatherer::~MetricGatherer() {}
void MetricGatherer::clearCellAndGeneCommon()
{
n_reads_ = 0;
n_mitochondrial_reads_ = 0;
// noise_reads = 0; //# long polymers, N-sequences; NotImplemented
fragment_histogram_.clear();
molecule_histogram_.clear();
Expand Down Expand Up @@ -82,8 +81,6 @@ bool MetricGatherer::isMitochondrial(LineFields const& fields) const
void MetricGatherer::ingestLineCellAndGeneCommon(LineFields const& fields)
{
n_reads_++; //with/without mt? == uniquely + multimapped
if (isMitochondrial(fields))
n_mitochondrial_reads_ += 1;

// the tags passed to this function define a molecule, this increments the counter,
// identifying a new molecule only if a new tag combination is observed
Expand Down Expand Up @@ -186,8 +183,7 @@ void MetricGatherer::outputMetricsLineCellAndGeneCommon()
<< reads_per_fragment << ","
<< fragments_per_molecule << ","
<< fragments_with_single_read_evidence << ","
<< molecules_with_single_read_evidence << ","
<< n_mitochondrial_reads_;
<< molecules_with_single_read_evidence;
}


Expand All @@ -203,7 +199,7 @@ CellMetricGatherer::CellMetricGatherer(std::string metric_output_file,
{
// write metrics csv header
std::string s;
for (int i=0; i<26; i++)
for (int i=0; i<25; i++)
metrics_csv_outfile_ << "," << kCommonHeaders[i]; // TODO ok to start with ,?
for (int i=0; i<11; i++)
metrics_csv_outfile_ << "," << cell_specific_headers[i];
Expand Down Expand Up @@ -325,7 +321,7 @@ GeneMetricGatherer::GeneMetricGatherer(std::string metric_output_file,
{
// write metrics csv header
std::string s;
for (int i=0; i<26; i++)
for (int i=0; i<25; i++)
metrics_csv_outfile_ << "," << kCommonHeaders[i]; // TODO ok to start with ,?
for (int i=0; i<2; i++)
metrics_csv_outfile_ << "," << gene_specific_headers[i];
Expand Down
5 changes: 2 additions & 3 deletions tools/TagSort/src/metricgatherer.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class MetricGatherer
void clearCellAndGeneCommon();
bool isMitochondrial(LineFields const& fields) const;

const std::string kCommonHeaders[26] =
const std::string kCommonHeaders[25] =
{
"n_reads",
"noise_reads",
Expand All @@ -107,8 +107,7 @@ class MetricGatherer
"reads_per_fragment",
"fragments_per_molecule",
"fragments_with_single_read_evidence",
"molecules_with_single_read_evidence",
"n_mitochondrial_reads"
"molecules_with_single_read_evidence"
};

void parseAlignedReadFields(LineFields const& fields, std::string hyphenated_tags);
Expand Down

0 comments on commit 32a2095

Please sign in to comment.