Enum rustybam::cli::Commands

source ·
pub enum Commands {
Show 14 variants Stats { bam: String, qbed: bool, paf: bool, }, BedLength { bed: String, readable: bool, column: Option<u8>, }, Filter { paf: String, paired_len: u64, aln: u64, query: u64, }, Invert { paf: String, }, Liftover { paf: String, bed: String, qbed: bool, largest: bool, }, TrimPaf { paf: String, match_score: i32, diff_score: i32, indel_score: i32, remove_contained: bool, }, Orient { paf: String, scaffold: bool, insert: u64, }, BreakPaf { paf: String, max_size: u32, }, PafToSam { paf: String, fasta: Option<String>, }, FastxSplit { fastx: Vec<String>, }, GetFasta { fasta: String, bed: String, strand: bool, name: bool, }, Nucfreq { bam: String, region: Option<String>, bed: Option<String>, small: bool, }, Repeat { fasta: String, min: usize, }, Suns { fasta: String, kmer_size: usize, max_size: usize, validate: bool, },
}
Expand description

This structure contains all the subcommands for rustybam and their help descriptions.

Because of naming conventions for rust enums the commands names have different capitalization than on the command line. For example, the Liftover enum is invoked using rustybam liftover and the TrimPaf command with rustybam trim-paf.

Variants§

§

Stats

Fields

§bam: String

Input sam/bam/cram/file.

§qbed: bool

Print query coordinates first

§paf: bool

Specify that the input is paf format, (must have cg tag with extended cigar).

Get percent identity stats from a sam/bam/cram or PAF. Requires =/X operations in the CIGAR string!

output column descriptions:
perID_by_matches is calculated as:

matches / (matches + mismatches)

perID_by_events is calculated as:

matches / (matches + mismatches + insertion events + deletion events)

perID_by_all is calculated as:

matches / (matches + mismatches + insertion bases + deletion bases)

§

BedLength

Fields

§bed: String

Input bed file.

§readable: bool

Make the output human readable (Mbp).

§column: Option<u8>

Count bases for each category in this column .

Count the number of bases in a bed file.

§

Filter

Fields

§paf: String

PAF file from minimap2 or unimap. Must have the cg tag, and n matches will be zero unless the cigar uses =X.

§paired_len: u64

Minimum number of aligned bases across all alignments between a target and query in order to keep those records.

§aln: u64

Minimum alignment length.

§query: u64

Minimum query length.

Filter PAF records in various ways.

§

Invert

Fields

§paf: String

PAF file from minimap2 or unimap. Must have the cg tag, and n matches will be zero unless the cigar uses =X.

Invert the target and query sequences in a PAF along with the CIGAR string.

§

Liftover

Fields

§paf: String

PAF file from minimap2 or unimap run with -c and –eqx [i.e. the PAF file must have the cg tag and use extended CIGAR opts (=/X)].

§bed: String

BED file of reference regions to liftover to the query.

§qbed: bool

Specifies that the BED file contains query coordinates to be lifted onto the reference (reverses direction of liftover).

Note, that this will make the query in the input PAF the target in the output PAF.

§largest: bool

If multiple records overlap the same region in the return only the largest liftover. The default is to return all liftovers.

Liftover target sequence coordinates onto query sequence using a PAF.

This is a function for lifting over coordinates from a reference () to a query using a PAF file from minimap2 or unimap (note, you can use paftools.js sam2paf to convert SAM data to PAF format). The returned file is a PAF file that is trimmed to the regions in the bed file. Even the cigar in the returned PAF file is trimmed so it can be used downstream! Additionally, a tag with the format id:Z:<> is added to the PAF where <> is either the 4th column of the input bed file or if not present chr_start_end.

§

TrimPaf

Fields

§paf: String

PAF file from minimap2 or unimap. Must have the cg tag, and n matches will be zero unless the cigar uses =X.

§match_score: i32

Value added for a matching base.

§diff_score: i32

Value subtracted for a mismatching base.

§indel_score: i32

Value subtracted for an insertion or deletion.

§remove_contained: bool

Remove contained alignments as well as overlaps.

Trim PAF records that overlap in query sequence to find and optimal splitting point using dynamic programing.

Note, this can be combined with rb invert to also trim the target sequence.

This idea is to mimic some of the trimming that happens in PAV to improve breakpoint detection. Starts with the largest overlap and iterates until no query overlaps remain.

§

Orient

Fields

§paf: String

PAF file from minimap2 or unimap. Must have the cg tag, and n matches will be zero unless the cigar uses =X.

§scaffold: bool

Generate ~1 query per target that scaffolds together all the records that map to that target sequence.

The order of the scaffold will be determined by the average target position across all the queries, and the name of the new scaffold will be.

§insert: u64

Space to add between records.

Orient paf records so that most of the bases are in the forward direction.

Optionally scaffold the queriers so that there is one query per target.

§

BreakPaf

Fields

§paf: String

PAF file from minimap2 or unimap. Must have the cg tag, and n matches will be zero unless the cigar uses =X.

§max_size: u32

Maximum indel size to keep in the paf.

Break PAF records with large indels into multiple records (useful for SafFire).

§

PafToSam

Fields

§paf: String

PAF file from minimap2 or unimap. Must have a CIGAR tag.

§fasta: Option<String>

Optional query fasta file (with index) to populate the query seq field.

Convert a PAF file into a SAM file. Warning, all alignments will be marked as primary!

§

FastxSplit

Fields

§fastx: Vec<String>

List of fastx files to write to.

Splits fastx from stdin into multiple files.

Specifically it reads fastx format (fastq, fasta, or mixed) from stdin and divides the records across multiple output files. Output files can be compressed by adding .gz, and the input can also be compressed or uncompressed.

§

GetFasta

Fields

§fasta: String

Fasta file to extract sequences from.

§bed: String

BED file of regions to extract.

§strand: bool

Reverse complement the sequence if the strand is “-”.

§name: bool

Add the name (4th column) to the header of the fasta output.

Mimic bedtools getfasta but allow for bgzip in both bed and fasta inputs.

§

Nucfreq

Fields

§bam: String

Input sam/bam/cram/file.

§region: Option<String>

Print nucfreq info from the input region e.g “chr1:1-1000”.

§bed: Option<String>

Print nucfreq info from regions in the bed file output is optionally tagged using the 4th column.

§small: bool

Smaller output format.

Get the frequencies of each bp at each position.

§

Repeat

Fields

§fasta: String

Input fasta file.

§min: usize

The smallest repeat length to report.

Report the longest exact repeat length at every position in a fasta.

§

Suns

Fields

§fasta: String

Input fasta file with the genome.

§kmer_size: usize

The size of the required unique kmer.

§max_size: usize

The maximum size SUN interval to report.

§validate: bool

Confirm all the SUNs (very slow) only for debugging.

Extract the intervals in a genome (fasta) that are made up of SUNs.

Trait Implementations§

source§

impl Debug for Commands

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromArgMatches for Commands

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Subcommand for Commands

source§

fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>

Append to Command so it can instantiate Self. Read more
source§

fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>

Append to Command so it can update self. Read more
source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

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

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V