BBClient

Struct BBClient 

Source
pub struct BBClient {
    pub cache_folder: PathBuf,
    pub bedbase_api: String,
    /* private fields */
}

Fields§

§cache_folder: PathBuf§bedbase_api: String

Implementations§

Source§

impl BBClient

Source

pub fn new( cache_folder: Option<PathBuf>, bedbase_api: Option<String>, ) -> Result<Self>

BBClient to deal with download files from bedbase and caching them.

§Arguments
  • cache_folder: path to local folder as cache of files from bedbase, if not given it will be the environment variable BBCLIENT_CACHE
  • bedbase_api: url to bedbase
Source

pub fn load_bed(&mut self, bed_id: &str) -> Result<RegionSet>

Loads a BED file from cache, or downloads and caches it if it doesn’t exist

§Arguments
  • bed_id: unique identifier of a BED file
§Returns
  • the RegionSet object of the loaded bed file
Source

pub fn load_bedset(&mut self, bedset_id: &str) -> Result<BedSet>

Load a BEDset from cache, or download and add it to the cache with its BED files

§Arguments
  • bedset_id: unique identifier of a BED set
§Returns
  • the BedSet object of the loaded bed set
Source

pub fn add_local_bed_to_cache( &mut self, bedfile: PathBuf, force: Option<bool>, ) -> Result<String>

Add a BED file to the cache

§Arguments
  • bedfile: a path or url to the BED file
  • force: whether to overwrite the existing file in cache
§Returns
  • the RegionSet identifier
Source

pub fn add_regionset_to_cache( &mut self, regionset: RegionSet, force: Option<bool>, ) -> Result<String>

Add a RegionSet object to the cache

§Arguments
  • regionset: a RegionSet object
  • force: whether to overwrite the existing file in cache
§Returns
  • the RegionSet identifier
Source

pub fn add_bedset_to_cache(&mut self, bedset: BedSet) -> Result<String>

Add a BED set to the cache

§Arguments
  • bedset: the BED set to be added, a BedSet class
§Returns
  • the identifier if the BedSet object
Source

pub fn add_local_folder_as_bedset( &mut self, folder_path: PathBuf, ) -> Result<String>

Add a folder of bed files to the cache as a bedset

§Arguments
  • folder_path: path to the folder where bed files are stored
§Returns
  • the identifier if the BedSet object
Source

pub fn add_local_file_as_bedset(&mut self, file_path: PathBuf) -> Result<String>

Add a local file that contains bed file paths as a bed set

§Arguments
  • file_path: path to the file of bedset info
§Returns
  • the identifier if the BedSet object
Source

pub fn seek(&self, identifier: &str) -> Result<PathBuf>

Get local path to BED file or BED set with specific identifier

§Arguments
  • identifier: the unique identifier
§Returns
  • the local path of the file
Source

pub fn remove(&mut self, identifier: &str) -> Result<()>

Remove a BED file or BED set from the cache folder as well as biocfilcache (SQLite)

§Arguments
  • identifier: the identifier of BED file / BED set to be removed
Source

pub fn list_beds(&mut self) -> Result<Vec<Resource>>

List identifiers and paths of all BED files in cache

§Returns
  • the list of resource stored in biocfilecache (identifiers & paths)
Source

pub fn list_bedsets(&mut self) -> Result<Vec<Resource>>

List identifiers and paths of all BED sets in cache

§Returns
  • the list of resource stored in biocfilecache (identifiers & paths)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,