InputBamBuilder

Struct InputBamBuilder 

Source
pub struct InputBamBuilder { /* private fields */ }
Expand description

Builder for InputBam.

Implementations§

Source§

impl InputBamBuilder

Source

pub fn bam_path(&mut self, value: PathOrURLOrStdin) -> &mut Self

Input BAM file. Set to a local file path, or set to - to read from stdin, or set to a URL to read from a remote file. If using stdin and piping in from samtools view, always include the header with the -h option.

Source

pub fn min_seq_len<VALUE: Into<u64>>(&mut self, value: VALUE) -> &mut Self

Exclude reads whose sequence length in the BAM file is below this value. Defaults to 0.

Source

pub fn min_align_len<VALUE: Into<i64>>(&mut self, value: VALUE) -> &mut Self

Exclude reads whose alignment length in the BAM file is below this value. Defaults to unused.

Source

pub fn read_id<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Only include this read id, defaults to unused i.e. all reads are used. NOTE: if there are multiple alignments corresponding to this read id, all of them are used.

Source

pub fn read_id_list<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Path to file containing list of read IDs (one per line). Lines starting with ‘#’ are treated as comments and ignored. Cannot be used together with –read-id.

Source

pub fn read_id_set<VALUE: Into<HashSet<String>>>( &mut self, value: VALUE, ) -> &mut Self

Internal HashSet of read IDs loaded from read_id_list file. This is populated automatically and not exposed to users.

Source

pub fn threads<VALUE: Into<NonZeroU32>>(&mut self, value: VALUE) -> &mut Self

Number of threads used during some aspects of program execution

Source

pub fn include_zero_len(&mut self, value: bool) -> &mut Self

Include “zero-length” sequences e.g. sequences with “*” in the sequence field. By default, these sequences are excluded to avoid processing errors. If this flag is set, these reads are included irrespective of any minimum sequence or align length criteria the user may have set. WARNINGS: (1) Some functions of the codebase may break or produce incorrect results if you use this flag. (2) due to a technical reason, we need a DNA sequence in the sequence field and cannot infer sequence length from other sources e.g. CIGAR strings.

Source

pub fn read_filter(&mut self, value: String) -> &mut Self

Only retain reads of this type. Allowed types are primary_forward, primary_reverse, secondary_forward, secondary_reverse, supplementary_forward, supplementary_reverse and unmapped. Specify more than one type if needed separated by commas, in which case reads of any type in list are retained. Defaults to retain reads of all types.

Source

pub fn sample_fraction(&mut self, value: F32Bw0and1) -> &mut Self

Subsample BAM to retain only this fraction of total number of reads, defaults to 1.0. The sampling algorithm considers every read according to the specified probability, so due to this, you may not always get the same number of reads e.g. if you set -s 0.05 in a file with 1000 reads, you will get 50 +- sqrt(50) reads. NOTE: a new subsample is drawn every time as the seed is not fixed. If you want reproducibility, consider piping the output of samtools view -s to our program.

Source

pub fn mapq_filter<VALUE: Into<u8>>(&mut self, value: VALUE) -> &mut Self

Exclude reads whose MAPQ (Mapping quality of position) is below this value. Defaults to zero i.e. do not exclude any read.

Source

pub fn exclude_mapq_unavail(&mut self, value: bool) -> &mut Self

Exclude sequences with MAPQ unavailable. In the BAM format, a value of 255 in this column means MAPQ is unavailable. These reads are allowed by default, set this flag to exclude.

Source

pub fn region(&mut self, value: String) -> &mut Self

Only keep reads passing through this region. If a BAM index is available with a name same as the BAM file but with the .bai suffix, the operation of selecting such reads will be faster. If you are using standard input as your input e.g. you are piping in the output from samtools, then you cannot use an index as a BAM filename is not available.

Source

pub fn region_bed3<VALUE: Into<Bed3<i32, u64>>>( &mut self, value: VALUE, ) -> &mut Self

Only keep read data from this region. This is an internal option not exposed to the user, we will set it based on the other options that the user sets.

Source

pub fn full_region(&mut self, value: bool) -> &mut Self

Only keep reads if they pass through the specified region in full. Related to the input --region; has no effect if that is not set.

Source

pub fn build(&self) -> Result<InputBam, Error>

Builds a new InputBam.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl Clone for InputBamBuilder

Source§

fn clone(&self) -> InputBamBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for InputBamBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> Key for T
where T: Clone,

Source§

fn align() -> usize

The alignment necessary for the key. Must return a power of two.
Source§

fn size(&self) -> usize

The size of the key in bytes.
Source§

unsafe fn init(&self, ptr: *mut u8)

Initialize the key in the given memory location. Read more
Source§

unsafe fn get<'a>(ptr: *const u8) -> &'a T

Get a reference to the key from the given memory location. Read more
Source§

unsafe fn drop_in_place(ptr: *mut u8)

Drop the key in place. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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,

Source§

impl<T> PlanCallbackArgs for T

Source§

impl<T> PlanCallbackOut for T