### Build and Install Samblaster Source: https://context7.com/gregoryfaust/samblaster/llms.txt Clone the repository, compile using make, and move the binary to a system path. Verify the installation by checking the version. ```bash git clone git://github.com/GregoryFaust/samblaster.git cd samblaster make ``` ```bash cp samblaster /usr/local/bin/ ``` ```bash samblaster --version # Output: samblaster: Version 0.1.26 ``` -------------------------------- ### Install SAMBLASTER using Make Source: https://github.com/gregoryfaust/samblaster/blob/master/README.md Clone the repository, navigate to the directory, run 'make', and copy the executable to your system's PATH. Ensure g++ and make are installed. ```bash git clone git://github.com/GregoryFaust/samblaster.git cd samblaster make cp samblaster /usr/local/bin/. ``` -------------------------------- ### Basic SAM to BAM Conversion with SAMblaster Source: https://github.com/gregoryfaust/samblaster/blob/master/README.md Pipe SAM input from bwa mem to samblaster, then to samtools view for compression to BAM. Ensures sequence header and read-id grouping in input. ```bash bwa mem samp.r1.fq samp.r2.fq | samblaster | samtools view -Sb - > samp.out.bam ``` -------------------------------- ### Execute Samblaster with File I/O Source: https://context7.com/gregoryfaust/samblaster/llms.txt Run samblaster using explicit file paths for input, output, discordant reads, and splitters. The tool can also be piped into samtools for direct BAM conversion. ```bash samblaster -i input.sam -o output.sam -d discordant.sam -s splitters.sam ``` ```bash samblaster -i input.sam -o /dev/stdout | samtools view -Sb - > output.bam ``` -------------------------------- ### SAMblaster with BWA MEM -M Option Source: https://github.com/gregoryfaust/samblaster/blob/master/README.md Use the -M option with both bwa mem and samblaster for compatibility mode, especially when dealing with supplementary alignments. ```bash bwa mem -M samp.r1.fq samp.r2.fq | samblaster -M | samtools view -Sb - > samp.out.bam ``` -------------------------------- ### Add Mate Tags Source: https://context7.com/gregoryfaust/samblaster/llms.txt Add MC and MQ tags to all paired-end output lines. ```bash # Add mate tags during processing bwa mem reference.fa sample.r1.fq sample.r2.fq | samblaster --addMateTags | samtools view -Sb - > sample.out.bam ``` -------------------------------- ### Outputting Discordant and Split Reads Source: https://github.com/gregoryfaust/samblaster/blob/master/README.md Configure samblaster to output discordant read pairs to a separate file (-d) and split read alignments to another (-s), in addition to the main output. ```bash bwa mem samp.r1.fq samp.r2.fq | samblaster -e -d samp.disc.sam -s samp.split.sam | samtools view -Sb - > samp.out.bam ``` -------------------------------- ### Basic Duplicate Marking Pipeline Source: https://context7.com/gregoryfaust/samblaster/llms.txt Mark duplicates in alignments directly from BWA MEM and compress to BAM using samtools. ```bash # Basic duplicate marking pipeline with BWA MEM bwa mem reference.fa sample.r1.fq sample.r2.fq | samblaster | samtools view -Sb - > sample.out.bam # When using BWA MEM -M option, also use samblaster -M for compatibility bwa mem -M reference.fa sample.r1.fq sample.r2.fq | samblaster -M | samtools view -Sb - > sample.out.bam ``` -------------------------------- ### Control Split Read Detection Parameters Source: https://context7.com/gregoryfaust/samblaster/llms.txt Fine-tune split read identification using parameters for overlap, indel size, and unmapped bases. ```bash # Custom split read detection parameters bwa mem reference.fa sample.r1.fq sample.r2.fq | samblaster \ -s sample.split.sam \ --maxSplitCount 3 \ --minNonOverlap 30 \ --minIndelSize 100 \ --maxUnmappedBases 25 \ | samtools view -Sb - > sample.out.bam ``` -------------------------------- ### Processing BAM Files for Discordant and Split Reads Source: https://github.com/gregoryfaust/samblaster/blob/master/README.md Use samtools view to pipe BAM input to samblaster for extracting discordant and split reads, outputting them to specified files. Use -o /dev/null to discard primary alignments. ```bash samtools view -h samp.bam | samblaster -a -e -d samp.disc.sam -s samp.split.sam -o /dev/null ``` -------------------------------- ### Processing Singleton Long Reads with SAMblaster Source: https://github.com/gregoryfaust/samblaster/blob/master/README.md Process BAM files containing singleton long reads to extract split or unmapped reads. Options --ignoreUnmated and --maxReadLength are useful here. Output can be BAM or FASTQ/FASTA. ```bash samtools view -h samp.bam | samblaster --ignoreUnmated [-e] --maxReadLength 100000 [-s samp.split.sam] [-u samp.umc.fasta] | samtools view -Sb - > samp.out.bam ``` ```bash samtools view -h samp.bam | samblaster --ignoreUnmated -a [-e] [-s samp.split.sam] [-u samp.umc.fasta] -o /dev/null ``` -------------------------------- ### Process Pre-existing BAM Files Source: https://context7.com/gregoryfaust/samblaster/llms.txt Extract split reads and discordant pairs from existing BAM files that already have duplicates marked. ```bash # Extract from pre-existing BAM with duplicates already marked samtools view -h sample.bam | samblaster -a -e -d sample.disc.sam -s sample.split.sam -o /dev/null ``` -------------------------------- ### Extract Unmapped and Clipped Reads Source: https://context7.com/gregoryfaust/samblaster/llms.txt Output unmapped and heavily clipped reads to FASTQ/FASTA format for re-alignment. ```bash # Extract unmapped/clipped reads along with split reads bwa mem reference.fa sample.r1.fq sample.r2.fq | samblaster -e -s sample.split.sam -u sample.unmapped.fq | samtools view -Sb - > sample.out.bam ``` -------------------------------- ### Extract Discordant and Split Reads Source: https://context7.com/gregoryfaust/samblaster/llms.txt Output discordant read pairs and split read alignments to separate files while marking duplicates. ```bash # Extract discordant pairs and split reads during duplicate marking bwa mem reference.fa sample.r1.fq sample.r2.fq | samblaster -e -d sample.disc.sam -s sample.split.sam | samtools view -Sb - > sample.out.bam ``` -------------------------------- ### Process Long Read Data Source: https://context7.com/gregoryfaust/samblaster/llms.txt Handle singleton long reads with extended maximum read length parameters. ```bash # Process long reads with duplicate marking samtools view -h longreads.bam | samblaster --ignoreUnmated --maxReadLength 100000 -s longreads.split.sam -u longreads.unmapped.fasta | samtools view -Sb - > longreads.out.bam # Without duplicate marking (for pre-marked data) samtools view -h longreads.bam | samblaster --ignoreUnmated -a -e -s longreads.split.sam -u longreads.unmapped.fasta -o /dev/null ``` -------------------------------- ### Remove Duplicates Instead of Marking Source: https://context7.com/gregoryfaust/samblaster/llms.txt Completely remove duplicate reads from output rather than just marking them. ```bash # Remove duplicates entirely from output bwa mem reference.fa sample.r1.fq sample.r2.fq | samblaster -r | samtools view -Sb - > sample.dedup.bam ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.