Skip to content

Latest commit

Β 

History

History
Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

README.md

🧬 Seq Wrangler

ClawBio skill β€” FASTQ QC, alignment, and BAM processing pipeline for NGS data.

Part of the ClawBio bioinformatics AI agent skill library.

Quick Start

# 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/

What it produces

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

Options

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

Pipeline steps

  1. FastQC β€” per-sample quality assessment (optional)
  2. fastp β€” adapter trimming and QC (optional, --trim)
  3. Alignment β€” BWA MEM / Bowtie2 / Minimap2
  4. samtools view β€” filter by MAPQ threshold
  5. samtools sort -n β€” sort by read name
  6. samtools fixmate β€” fix mate-pair information
  7. samtools sort β€” coordinate sort
  8. samtools markdup β€” mark (or remove) PCR duplicates
  9. samtools index β€” index final BAM
  10. samtools flagstat / coverage / stats β€” alignment statistics
  11. MultiQC β€” aggregated QC report (optional)
  12. Report β€” Markdown report + reproducibility bundle

Dependencies

Install via conda (recommended):

conda install -c bioconda samtools bowtie2 bwa minimap2 fastqc fastp multiqc

Or use the included environment file:

conda env create -f skills/seq-wrangler/reproducibility/environment.yml
conda activate clawbio-seq-wrangler

Run Tests

python -m pytest skills/seq-wrangler/tests/ -v

Author

Contributed by Daniel Garbozo β€” resolves Issue #10.