### Example Thresholds Output Source: https://github.com/brentp/mosdepth/blob/master/README.md This is an example of the output format for the --thresholds argument, showing coverage counts for specified thresholds per region. ```text # chrom start end region 1X 10X 20X 30X 1 11869 12227 ENSE00002234944 358 157 110 0 1 11874 12227 ENSE00002269724 353 127 10 0 1 12010 12057 ENSE00001948541 47 8 0 0 1 12613 12721 ENSE00003582793 108 0 0 0 ``` -------------------------------- ### Quantize Coverage Bins Source: https://github.com/brentp/mosdepth/blob/master/README.md Configure coverage bins for quantization using the --quantize argument. This example defines bins for 0-1, 1-4, 4-100, 100-200, and 200-infinity coverage. ```bash --quantize 0:1:4:100:200: ``` -------------------------------- ### Mosdepth Usage Example Source: https://github.com/brentp/mosdepth/blob/master/README.md Basic command-line usage for mosdepth, specifying output prefix and input BAM/CRAM file. ```bash mosdepth 0.3.11 Usage: mosdepth [options] Arguments: outputs: {prefix}.mosdepth.global.dist.txt {prefix}.mosdepth.summary.txt {prefix}.per-base.bed.gz (unless -n/--no-per-base is specified) {prefix}.regions.bed.gz (if --by is specified) {prefix}.quantized.bed.gz (if --quantize is specified) {prefix}.thresholds.bed.gz (if --thresholds is specified) the alignment file for which to calculate depth. Common Options: -t --threads number of BAM decompression threads [default: 0] -c --chrom chromosome to restrict depth calculation. -b --by optional BED file or (integer) window-sizes. -n --no-per-base dont output per-base depth. skipping this output will speed execution substantially. prefer quantized or thresholded values if possible. -f --fasta fasta file for use with CRAM files [default: ]. Other options: -F --flag exclude reads with any of the bits in FLAG set [default: 1796] -i --include-flag only include reads with any of the bits in FLAG set. default is unset. [default: 0] -x --fast-mode dont look at internal cigar operations or correct mate overlaps (recommended for most use-cases). -a --fragment-mode count the coverage of the full fragment including the full insert (proper pairs only). -q --quantize write quantized output see docs for description. -Q --mapq mapping quality threshold. reads with a quality less than this value are ignored [default: 0] -l --min-frag-len minimum insert size. reads with a smaller insert size than this are ignored [default: -1] -u --max-frag-len maximum insert size. reads with a larger insert size than this are ignored. [default: -1] -T --thresholds for each interval in --by, write number of bases covered by at least threshold bases. Specify multiple integer values separated by ','. -m --use-median output median of each region (in --by) instead of mean. -R --read-groups only calculate depth for these comma-separated read groups IDs. -h --help show help ``` -------------------------------- ### Build Mosdepth with d4 Support Source: https://github.com/brentp/mosdepth/wiki/Home Follow these steps to clone the d4-format repository, build the d4-binding library, and then compile Mosdepth with d4 support. Ensure you have Rust and Cargo installed for building d4-format. ```bash cd ~/ git clone https://github.com/38/d4-format cd d4-format cargo build --release --package d4binding # Make dirs for the relevant files (could probably skip this and point directly to d4-format/) mkdir -p ~/local/d4/lib mkdir -p ~/local/d4/include cp ~/d4-format/target/release/libd4binding.* ~/local/d4/lib/ cp ~/d4-format/d4binding/include/d4.h ~/local/d4/include/ cd ../mosdepth/ nim c -d:d4 -d:release --passC:"-I$HOME/d4-format/d4binding/include" --passL:"-L$HOME/d4-format/target/release" mosdepth.nim ``` -------------------------------- ### Setting LD_LIBRARY_PATH for htslib Source: https://github.com/brentp/mosdepth/blob/master/README.md Example of setting the LD_LIBRARY_PATH environment variable to point to the htslib directory when building mosdepth from source. ```bash LD_LIBRARY_PATH=~/src/htslib/ mosdepth -h ``` -------------------------------- ### Mosdepth Docker Execution Source: https://github.com/brentp/mosdepth/blob/master/README.md Run mosdepth using a Docker container, mounting a host directory for input/output. This example processes a BAM file with specific windowing and threading options. ```bash docker pull quay.io/biocontainers/mosdepth:0.3.3--h37c5b7d_2 docker run -v /hostpath/:/opt/mount quay.io/biocontainers/mosdepth:0.2.4--he527e40_0 mosdepth -n --fast-mode -t 4 --by 1000 /opt/mount/sample /opt/mount/$bam ``` -------------------------------- ### Set Custom Quantize Bin Labels Source: https://github.com/brentp/mosdepth/blob/master/README.md Customize the labels for quantized coverage bins using environment variables. This example sets custom names for NO_COVERAGE, LOW_COVERAGE, CALLABLE, and HIGH_COVERAGE bins. ```bash export MOSDEPTH_Q0=NO_COVERAGE export MOSDEPTH_Q1=LOW_COVERAGE export MOSDEPTH_Q2=CALLABLE export MOSDEPTH_Q3=HIGH_COVERAGE ``` -------------------------------- ### WGS Windowed Coverage Source: https://github.com/brentp/mosdepth/blob/master/README.md Calculate coverage for whole-genome sequencing data in 500-base windows. Uses --fast-mode for improved speed by skipping mate pair overlap and cigar operation calculations. ```bash mosdepth -n --fast-mode --by 500 sample.wgs $sample.wgs.cram ``` -------------------------------- ### Configure Environment for d4tools Source: https://github.com/brentp/mosdepth/wiki/Home Add these export commands to your .bashrc file to set the necessary environment variables for the d4tools library, including library paths and include paths. ```bash # d4tools export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/local/d4/lib/ export LIBRARY_PATH=$LIBRARY_PATH:$HOME/local/d4/lib/ export C_INCLUDE_PATH=$C_INCLUDE_PATH:$HOME/local/d4/include/ ``` -------------------------------- ### Exome Coverage Calculation Source: https://github.com/brentp/mosdepth/blob/master/README.md Calculate coverage in specific exome capture regions using a BED file. Output includes per-base data, region means, and depth distributions. ```bash mosdepth --by capture.bed sample-output sample.exome.bam ``` -------------------------------- ### Generate Thresholds Report Source: https://github.com/brentp/mosdepth/blob/master/README.md Use this command to generate a report of bases covered at or above specified thresholds within given regions. The output file includes an extra column for each threshold. ```bash mosdepth --by exons.bed --thresholds 1,10,20,30 $prefix $bam ``` -------------------------------- ### Callable Regions with Custom Labels Source: https://github.com/brentp/mosdepth/blob/master/README.md Define callable regions based on depth quantiles and assign custom labels. Environment variables control the output labels for different coverage bins. ```bash # by setting these ENV vars, we can control the output labels (4th column) export MOSDEPTH_Q0=NO_COVERAGE # 0 -- defined by the arguments to --quantize export MOSDEPTH_Q1=LOW_COVERAGE # 1..4 export MOSDEPTH_Q2=CALLABLE # 5..149 export MOSDEPTH_Q3=HIGH_COVERAGE # 150 ... mosdepth -n --quantize 0:1:5:150: $sample.quantized $sample.wgs.bam ``` -------------------------------- ### Distribution Only with Modified Precision Source: https://github.com/brentp/mosdepth/blob/master/README.md Generate only the depth distribution statistics with a specified precision (5 decimal places) and use 3 threads for processing. ```bash MOSDEPTH_PRECISION=5 mosdepth -n -t 3 $sample $bam ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.