Skip to content

Commit

Permalink
feat: report MANE transcript counts in "db create" (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe authored Mar 1, 2024
1 parent 24c41fd commit 2826b1a
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/db/create/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,40 @@ fn load_and_extract(
start.elapsed()
);

// Count number of MANE Select and MANE Plus Clinical transcripts.
let mut n_mane_select = 0;
let mut n_mane_plus_clinical = 0;
for tx in c_txs.values() {
let mut is_mane_select = false;
let mut is_mane_plus_clinical = false;
for gb in tx.genome_builds.values() {
if let Some(tag) = &gb.tag {
if tag.contains(&models::Tag::ManeSelect) {
is_mane_select = true;
}
if tag.contains(&models::Tag::ManePlusClinical) {
is_mane_plus_clinical = true;
}
}
}
if is_mane_select {
n_mane_select += 1;
}
if is_mane_plus_clinical {
n_mane_plus_clinical += 1;
}
}
writeln!(
report_file,
"mane_select_transcripts\t{}\nmane_plus_clinical_transcripts\t{}",
n_mane_select, n_mane_plus_clinical
)?;
tracing::info!(
"mane_select_transcripts = {}, mane_plus_clinical_transcripts = {}",
n_mane_select,
n_mane_plus_clinical
);

let start = Instant::now();
writeln!(report_file, "total_genes\t{}", c_genes.len())?;
c_genes
Expand Down

0 comments on commit 2826b1a

Please sign in to comment.