bio-read-alignment-bwa-alignment — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited bio-read-alignment-bwa-alignment (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Reference examples tested with: GATK 4.5+, samtools 1.19+
Before using code patterns, verify installed versions match. If versions differ:
<tool> --version then <tool> --help to confirm flagsIf code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
"Align reads with BWA" → Map DNA reads to a reference genome using BWA-MEM2, the standard aligner for whole-genome and exome sequencing.
bwa-mem2 mem -t 8 ref.fa R1.fq R2.fq | samtools sort -o aligned.bam# Index reference genome (required once)
bwa-mem2 index reference.fa
# Creates: reference.fa.0123, reference.fa.amb, reference.fa.ann, reference.fa.bwt.2bit.64, reference.fa.pac# Paired-end reads
bwa-mem2 mem -t 8 reference.fa reads_1.fq.gz reads_2.fq.gz > aligned.sam
# Single-end reads
bwa-mem2 mem -t 8 reference.fa reads.fq.gz > aligned.sam# Add read group information (required for GATK)
bwa-mem2 mem -t 8 \
-R '@RG\tID:sample1\tSM:sample1\tPL:ILLUMINA\tLB:lib1' \
reference.fa reads_1.fq.gz reads_2.fq.gz > aligned.sam# Pipe to samtools for sorted BAM output
bwa-mem2 mem -t 8 \
-R '@RG\tID:sample1\tSM:sample1\tPL:ILLUMINA' \
reference.fa reads_1.fq.gz reads_2.fq.gz | \
samtools sort -@ 4 -o aligned.sorted.bam -
# Index the BAM
samtools index aligned.sorted.bamGoal: Produce a duplicate-marked, sorted BAM file from raw reads in a single streaming pipeline.
Approach: Pipe BWA-MEM2 output through samtools fixmate (to add mate score tags), coordinate sort, and markdup in a single command chain to avoid intermediate files.
# Full pipeline: align, fixmate, sort, markdup
bwa-mem2 mem -t 8 -R '@RG\tID:sample1\tSM:sample1\tPL:ILLUMINA' \
reference.fa reads_1.fq.gz reads_2.fq.gz | \
samtools fixmate -m -@ 4 - - | \
samtools sort -@ 4 - | \
samtools markdup -@ 4 - aligned.markdup.bam
samtools index aligned.markdup.bambwa-mem2 mem -t 8 \ # Threads
-M \ # Mark shorter split hits as secondary (Picard compatible)
-Y \ # Use soft clipping for supplementary alignments
-K 100000000 \ # Process INT input bases in each batch
-R '@RG\tID:s1\tSM:s1' \ # Read group
reference.fa r1.fq r2.fq| Parameter | Default | Description |
|---|---|---|
| -t | 1 | Number of threads |
| -k | 19 | Minimum seed length |
| -w | 100 | Band width for extension |
| -r | 1.5 | Re-seeding trigger ratio |
| -c | 500 | Skip seeds with more than INT hits |
| -A | 1 | Match score |
| -B | 4 | Mismatch penalty |
| -O | 6 | Gap open penalty |
| -E | 1 | Gap extension penalty |
| -M | off | Mark secondary alignments |
# Filter unmapped and low quality
bwa-mem2 mem -t 8 reference.fa r1.fq r2.fq | \
samtools view -@ 4 -bS -q 20 -F 4 - | \
samtools sort -@ 4 -o aligned.filtered.bam -# For SV detection, use -Y for soft clipping
bwa-mem2 mem -t 8 -Y reference.fa r1.fq r2.fq > aligned.sam# Build index
bwa index reference.fa
# Paired-end alignment
bwa mem -t 8 reference.fa reads_1.fq.gz reads_2.fq.gz > aligned.sam
# With read groups
bwa mem -t 8 -R '@RG\tID:sample1\tSM:sample1\tPL:ILLUMINA' \
reference.fa reads_1.fq.gz reads_2.fq.gz > aligned.sam
# Direct to sorted BAM
bwa mem -t 8 -R '@RG\tID:sample1\tSM:sample1\tPL:ILLUMINA' \
reference.fa reads_1.fq.gz reads_2.fq.gz | \
samtools sort -@ 4 -o aligned.sorted.bam -| Feature | BWA-MEM | BWA-MEM2 |
|---|---|---|
| Status | Active | Archived |
| Speed | 1x | 2-3x faster |
| Index format | .bwt | .bwt.2bit.64 |
| Results | Baseline | Nearly identical |
| Memory | ~5GB | ~10GB |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.