Skip to content

Commit

Permalink
fix issue with creating karyotype from remote file, passing Header ob…
Browse files Browse the repository at this point in the history
…ject
  • Loading branch information
wdecoster committed Feb 13, 2024
1 parent 13500ab commit a190c46
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cramino"
version = "0.14.1"
version = "0.14.2"
edition = "2021"
authors = ["Wouter De Coster [email protected]"]
license = "MIT"
Expand Down
6 changes: 2 additions & 4 deletions src/karyotype.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use rust_htslib::bam::{self, Read};
use rust_htslib::bam;
use std::collections::HashMap;

pub fn make_karyotype(tids: &Vec<i32>, bamp: String) {
let bam = bam::Reader::from_path(bamp).unwrap();
let header = bam::Header::from_template(bam.header());
pub fn make_karyotype(tids: &Vec<i32>, header: rust_htslib::bam::Header) {
let head_view = bam::HeaderView::from_header(&header);

let mut tidcount: HashMap<i32, usize> = HashMap::new();
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn metrics_from_bam(
None
};
if args.karyotype {
karyotype::make_karyotype(metrics.tids.as_ref().unwrap(), bam.to_string());
karyotype::make_karyotype(metrics.tids.as_ref().unwrap(), header);
}
let exon_counts = if let Some(mut exon_counts) = metrics.exons {
exon_counts.sort_unstable();
Expand Down

0 comments on commit a190c46

Please sign in to comment.