bio-alignment-sorting
Sort alignment files by coordinate or read name using samtools and pysam. Use when preparing BAM files for indexing, variant calling, or paired-end analysis.
npx skills add BioTender-max/awesome-bio-agent-skills --skill alignment-sorting --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
## 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>` then `help(module.function)` to check signatures - CLI: `<tool> --version` then `<tool> --help` to 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 Sorting Sort alignment files by coordinate or read name using samtools and pysam. **"Sort a BAM file"** → Reorder reads by genomic coordinate (for indexing/variant calling) or by name (for paired-end processing). - CLI: `samtools sort -o sorted.bam input.bam` - Python: `pysam.sort('-o', 'sorted.bam', 'input.bam')` ## Sort Orders | Order | Flag | Use Case | |-------|------|----------| | Coordinate | default | Indexing, visualization, variant calling | | Name | `-n` | Paired-end processing, fixmate, markdup | | Tag | `-t TAG` | Sort by specific tag value | ## samtools sort ### Sort by Coordinate (Default) ```bash samtools sort -o sorted.bam input.bam ``` ### Sort by Read Name ```bash samtools sort -n -o namesort
- Version Compatibility
- Sort Orders
- samtools sort
- Sort by Coordinate (Default)
- Sort by Read Name
- Multi-threaded Sorting
- Control Memory Usage
- Set Temporary Directory
- Specify Output Format
- Sort by Tag
- Pipe from Aligner
- samtools collate vs sort -n
- Sort Order Required by Downstream Tool
- Check Sort Order
samtools sort -o sorted.bam input.bam samtools sort -n -o namesorted.bam input.bam samtools sort -@ 8 -o sorted.bam input.bam samtools sort -m 4G -@ 4 -o sorted.bam input.bam samtools sort -T /tmp/sort_tmp -o sorted.bam input.bam Output as BAM (default) samtools sort -O bam -o sorted.bam input.bam Output as CRAM samtools sort -O cram --reference ref.fa -o sorted.cram input.bam Sort by cell barcode (10x Genomics)
What does the bio-alignment-sorting skill do?
Sort alignment files by coordinate or read name using samtools and pysam. Use when preparing BAM files for indexing, variant calling, or paired-end analysis.
How do I install it?
Run `npx skills add BioTender-max/awesome-bio-agent-skills --skill alignment-sorting --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From BioTender-max/awesome-bio-agent-skills, a repository with 135 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
