ClawBio skill β FASTQ QC, alignment, and BAM processing pipeline for NGS data.
Part of the ClawBio bioinformatics AI agent skill library.
# Demo (no external tools needed)
python skills/seq-wrangler/seq_wrangler.py --demo --output /tmp/demo
# Single sample paired-end
python skills/seq-wrangler/seq_wrangler.py \
--r1 sample_R1.fastq.gz \
--r2 sample_R2.fastq.gz \
--index ref/hg38 \
--aligner bowtie2 \
--output results/
# Batch mode via samplesheet
python skills/seq-wrangler/seq_wrangler.py \
--samplesheet samples.csv \
--index ref/hg38 \
--output results/output/
βββ report.md # Full alignment and QC report
βββ summary.json # Per-sample stats as JSON
βββ bam/
β βββ sample_sorted.bam # Final sorted, markdup BAM + .bai index
βββ alignment/
β βββ sample.sam # Intermediate SAM (only with --keep-sam)
βββ reproducibility/
βββ commands.sh # Reproduce this exact run
βββ environment.yml # Conda environment
βββ checksums.sha256 # SHA-256 of all input files
βββ run_metadata.json # Full run parameters| Flag | Description | Default |
|---|---|---|
--r1 |
FASTQ R1 or single-end FASTQ | β |
--r2 |
FASTQ R2 for paired-end | β |
--samplesheet |
CSV with columns sample,fastq1,fastq2 |
β |
--index |
Aligner index prefix | required |
--aligner |
bwa, bowtie2, or minimap2 |
bwa |
--genome-build |
GRCh38 or GRCh37 |
GRCh38 |
--output |
Output directory | required |
--threads |
Number of threads | auto |
--mapq |
MAPQ filter threshold | 20 |
--trim |
Run fastp trimming before alignment | off |
--remove-duplicates |
Remove duplicates with samtools markdup -r |
off |
--keep-sam |
Keep intermediate SAM files | off |
--run-fastqc |
Run FastQC if available | off |
--run-multiqc |
Run MultiQC aggregation if available | off |
--demo |
Run with synthetic data, no tools needed | off |
- FastQC β per-sample quality assessment (optional)
- fastp β adapter trimming and QC (optional,
--trim) - Alignment β BWA MEM / Bowtie2 / Minimap2
- samtools view β filter by MAPQ threshold
- samtools sort -n β sort by read name
- samtools fixmate β fix mate-pair information
- samtools sort β coordinate sort
- samtools markdup β mark (or remove) PCR duplicates
- samtools index β index final BAM
- samtools flagstat / coverage / stats β alignment statistics
- MultiQC β aggregated QC report (optional)
- Report β Markdown report + reproducibility bundle
Install via conda (recommended):
conda install -c bioconda samtools bowtie2 bwa minimap2 fastqc fastp multiqcOr use the included environment file:
conda env create -f skills/seq-wrangler/reproducibility/environment.yml
conda activate clawbio-seq-wranglerpython -m pytest skills/seq-wrangler/tests/ -vContributed by Daniel Garbozo β resolves Issue #10.