samtools-bam-processing

Process SAM, BAM, and CRAM alignment files with samtools.

298|27|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/jaechang-hits/SciAgent-Skills --skill samtools-bam-processing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: samtools-bam-processing
Source: https://github.com/jaechang-hits/SciAgent-Skills/tree/main/skills/genomics-bioinformatics/samtools-bam-processing
Command: npx skills add https://github.com/jaechang-hits/SciAgent-Skills --skill samtools-bam-processing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust command-line toolkit for manipulating SAM, BAM, and CRAM alignment files, essential for next-generation sequencing (NGS) data analysis.

Core Features & Use Cases

  • Format Conversion: Convert between SAM, BAM, and CRAM formats to optimize storage and compatibility.
  • Sorting and Indexing: Sort BAM files by coordinate or read name and create indexes for efficient random access.
  • Quality Control: Generate crucial statistics like mapping rates, insert sizes, and coverage depth.
  • Filtering and Deduplication: Filter reads based on mapping quality or FLAG bits, and mark or remove PCR duplicates.
  • Use Case: After aligning sequencing reads, use this Skill to sort, index, and generate quality control reports for your BAM files, preparing them for downstream variant calling or analysis.

Quick Start

Use the samtools skill to sort the input.bam file by coordinate and then index the sorted file.

Frequently Asked Questions about samtools-bam-processing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sort and index BAM files for downstream NGS analysis?

To sort and index BAM files for NGS analysis, use command-line tools to sort by coordinate or read name and generate index files, enabling efficient random access required for downstream variant calling.

Can I convert CRAM files to BAM without a reference FASTA?

Converting CRAM files to BAM may require a reference FASTA for CRAM operations, as CRAM encoding relies on the reference sequence, though some basic conversions might proceed depending on the specific data embedded.

What is the best way to generate quality control statistics for alignment files?

Generating quality control statistics for alignment files involves using command-line utilities to calculate mapping rates, insert sizes, and coverage depth, providing essential metrics to evaluate NGS pipeline performance.

How do I filter sequencing reads based on mapping quality in BAM files?

Filtering sequencing reads by mapping quality in BAM files uses command-line flags to extract reads meeting specific quality thresholds or FLAG bit criteria, removing low-confidence alignments before downstream analysis.

Do I need samtools 1.17 or higher to process SAM and CRAM files?

Processing SAM, BAM, and CRAM files with this toolkit requires samtools 1.17 or higher to ensure compatibility with the latest format specifications and command-line features for alignment file manipulation.

How do I mark or remove PCR duplicates from BAM files?

Marking or removing PCR duplicates from BAM files involves using command-line tools to identify and flag or eliminate redundant reads, ensuring accurate quantification and reducing bias in downstream variant calling.