Module bio::data_structures::annot_map
source · Expand description
Efficient container for locations annotated across a set of named reference sequences.
§Example
extern crate bio_types;
use bio::data_structures::annot_map::AnnotMap;
use bio_types::annot::contig::Contig;
use bio_types::strand::ReqStrand;
// Insert a String annotation into the annotation map at a specified location.
let mut genes: AnnotMap<String, String> = AnnotMap::new();
let tma22 = Contig::new(
"chrX".to_owned(),
461829,
462426 - 461829,
ReqStrand::Forward,
);
genes.insert_at("TMA22".to_owned(), &tma22);
// Find annotations that overlap a specific query
let query = Contig::new("chrX".to_owned(), 462400, 100, ReqStrand::Forward);
let hits: Vec<&String> = genes.find(&query).map(|e| e.data()).collect();
assert_eq!(hits, vec!["TMA22"]);
Structs§
- Efficient container for querying annotations, using
HashMap
andIntervalTree
. - An iterator over annotation entries (of type
Entry
) in aAnnotMap
. - A view of one annotation in a
AnnotMap
container.