Get all contigs/chromosomes from fasta file
(fasta_path: &PathBuf)
| 46 | |
| 47 | // Get all contigs/chromosomes from fasta file |
| 48 | pub(crate) fn get_fasta_contigs(fasta_path: &PathBuf) -> Result<Vec<String>> { |
| 49 | let fasta_reader = fasta::Reader::from_file(fasta_path)?; |
| 50 | let mut contigs = Vec::new(); |
| 51 | for record in fasta_reader.records() { |
| 52 | let record = record?; |
| 53 | contigs.push(record.id().to_string()); |
| 54 | } |
| 55 | Ok(contigs) |
| 56 | } |
| 57 | |
| 58 | /// Takes any given aux and returns a string representation of it. |
| 59 | pub(crate) fn aux_to_string(aux: rust_htslib::bam::record::Aux) -> String { |