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

chrom_ordering from other files #4

Open
brentp opened this issue Jul 27, 2023 · 1 comment
Open

chrom_ordering from other files #4

brentp opened this issue Jul 27, 2023 · 1 comment

Comments

@brentp
Copy link
Member

brentp commented Jul 27, 2023

currently, it's required to get chrom_ordering from a .genome (fai) file. But bedder should also support reading it from a bam/sam/cram header or a .dict file.
It can use the current sniffers and get the appropriate info into the HashMap<String, Chromosome> format:

#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct Chromosome {
pub(crate) index: usize,
pub(crate) length: Option<usize>,
}
/// A genome is a map from chromosome name to index with an optional chromosome length.
pub fn parse_genome<R>(reader: R) -> io::Result<HashMap<String, Chromosome>>

@brentp
Copy link
Member Author

brentp commented Jul 27, 2023

Should probably also update length to u64 and use u64::MAX if it's not given.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant