Skip to content

Commit

Permalink
Add condition for MT gene for intergenic
Browse files Browse the repository at this point in the history
  • Loading branch information
aawdeh committed Jan 16, 2024
1 parent 466a716 commit 9b73358
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tools/TagSort/src/metricgatherer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void MetricGatherer::parseAlignedReadFields(LineFields const& fields, std::strin
else {
std::cout<<"Check if mitochrondrial gene\n";
std::cout<<"GENE " << std::string(fields.tag_triple.third) <<"\n";
std::cout<<"not a mitochrondrial gene\n";
std::cout<<"mitochrondrial gene\n";
}

// in futher check if read maps outside window (when we add a gene model)
Expand Down Expand Up @@ -236,12 +236,16 @@ void CellMetricGatherer::ingestLine(std::string const& str)
cell_barcode_fraction_bases_above_30_.update(fields.cell_barcode_base_above_30);
perfect_cell_barcodes_ += fields.cell_barcode_perfect;

if (fields.alignment_location == 7) {
if (fields.number_mappings == 1)
reads_mapped_intergenic_ += 1;
}
else if(fields.alignment_location == 0) {
reads_unmapped_ += 1;
// need to change this
if (!(mitochondrial_genes_.find(std::string(fields.tag_triple.third)) != mitochondrial_genes_.end())) {
{
if (fields.alignment_location == 7) {
if (fields.number_mappings == 1)
reads_mapped_intergenic_ += 1;
}
else if(fields.alignment_location == 0) {
reads_unmapped_ += 1;
}
}

genes_histogram_[std::string(fields.tag_triple.third)] += 1;
Expand Down

0 comments on commit 9b73358

Please sign in to comment.