Agent skill

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.

BioTender-maxgithub.com/BioTender-maxGitHub ↗
claude-codeships scriptsNOASSERTION
Install
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.

Facts
Files in the skill folder: 3
SKILL.md size: 10 KB
Bundled scripts: yes
Path: skills/bioskills/alignment-sorting/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 135
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the 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>` 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

What's inside
Steps it walks through
  1. Version Compatibility
  2. Sort Orders
  3. samtools sort
  4. Sort by Coordinate (Default)
  5. Sort by Read Name
  6. Multi-threaded Sorting
  7. Control Memory Usage
  8. Set Temporary Directory
  9. Specify Output Format
  10. Sort by Tag
  11. Pipe from Aligner
  12. samtools collate vs sort -n
  13. Sort Order Required by Downstream Tool
  14. Check Sort Order
Ships with 2 files
  • examples/sort_pipeline.sh
  • usage-guide.md
Commands it runs
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)
More from awesome-bio-agent-skills
All skills →
About this skill
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.

Keep going