bio-alignment-filtering
Installation
SKILL.md
Version Compatibility
Reference examples tested with: pysam 0.22+, samtools 1.19+
Before using code patterns, verify installed versions match. If versions differ:
- Python:
pip show <package>thenhelp(module.function)to check signatures - CLI:
<tool> --versionthen<tool> --helpto confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed package and adapt the example to match the actual API rather than retrying.
Alignment Filtering
"Filter my BAM file to keep only high-quality reads" → Select reads by FLAG bits, mapping quality, and genomic regions using samtools view or pysam.
- CLI:
samtools viewwith-F/-f/-q/-Lflags (samtools) - Python:
pysam.AlignmentFileiteration with attribute filters (pysam)
Filter alignments by flags, quality, and regions using samtools and pysam.