pub struct RegionSet {
pub regions: Vec<Region>,
pub header: Option<String>,
pub path: Option<PathBuf>,
}Expand description
RegionSet struct, the representation of the interval region set file, such as bed file.
Fields§
§regions: Vec<Region>§header: Option<String>§path: Option<PathBuf>Implementations§
Source§impl RegionSet
impl RegionSet
Sourcepub fn identifier(&self) -> String
pub fn identifier(&self) -> String
Calculate identifier for RegionSet
This function doesn’t sort file, and identifer is based on unsorted first 3 columns.
§Returns
String containing RegionSet identifier
pub fn file_digest(&self) -> String
Sourcepub fn iter_chroms(&self) -> impl Iterator<Item = &String>
pub fn iter_chroms(&self) -> impl Iterator<Item = &String>
Iterate unique chromosomes located in RegionSet
Sourcepub fn iter_chr_regions<'a>(
&'a self,
chr: &'a str,
) -> impl Iterator<Item = &'a Region>
pub fn iter_chr_regions<'a>( &'a self, chr: &'a str, ) -> impl Iterator<Item = &'a Region>
Sourcepub fn sort(&mut self)
pub fn sort(&mut self)
Sort bed file based on first 3 columns. Sorting is happening inside the object, where original order will be overwritten
Sourcepub fn region_widths(&self) -> Result<Vec<u32>>
pub fn region_widths(&self) -> Result<Vec<u32>>
Calculate all regions width
Sourcepub fn mean_region_width(&self) -> f64
pub fn mean_region_width(&self) -> f64
Calculate mean region width for whole RegionSet
Sourcepub fn calc_mid_points(&self) -> HashMap<String, Vec<u32>>
pub fn calc_mid_points(&self) -> HashMap<String, Vec<u32>>
Calculate middle point for each region, and return hashmap with midpoints for each chromosome
Sourcepub fn get_max_end_per_chr(&self) -> HashMap<String, u32>
pub fn get_max_end_per_chr(&self) -> HashMap<String, u32>
Get the furthest region location for each region
Sourcepub fn nucleotides_length(&self) -> u32
pub fn nucleotides_length(&self) -> u32
Get total nucleotide count
Trait Implementations§
Source§impl<'a> IntoIterator for &'a RegionSet
impl<'a> IntoIterator for &'a RegionSet
Auto Trait Implementations§
impl Freeze for RegionSet
impl RefUnwindSafe for RegionSet
impl Send for RegionSet
impl Sync for RegionSet
impl Unpin for RegionSet
impl UnwindSafe for RegionSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more