BAM-filtration

Remove mitochondrial reads, blacklist regions, PCR duplicates, and unmapped reads from coordinate-sorted BAMs.

12|3|Updated Nov 4, 2025
One-click install
npx skills add https://github.com/BIsnake2001/ChromSkills --skill bam-filtration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: BAM-filtration
Source: https://github.com/BIsnake2001/ChromSkills/tree/main/2.BAM-filtration
Command: npx skills add https://github.com/BIsnake2001/ChromSkills --skill bam-filtration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cleans raw BAM files by removing artifacts such as mitochondrial reads, blacklist regions, PCR duplicates, and unmapped reads to produce a clean BAM ready for peak calling.

Core Features & Use Cases

  • Detects BAM inputs that are coordinate-sorted and contain read groups and filters artifacts to produce cleaned outputs per sample.
  • Optionally prompts for blacklist usage if blacklist file is missing, and applies blacklist filtering when provided.
  • Initializes a project directory structure and organizes outputs under a per-sample filtered_bam folder, including temporary data as needed.
  • Outputs cleaned BAMs (sample.filtered.bam) and indices (sample.filtered.bam.bai), suitable for QC and downstream peak calling workflows.

Quick Start

Place your raw BAMs in the working directory and run the skill to generate cleaned BAMs in the project output folder.

Frequently Asked Questions about BAM-filtration

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

FAQPage Schema
How do I remove artifacts from BAM files for ChIP-seq and ATAC-seq peak calling?

BAM filtration removes artifacts such as mitochondrial reads, blacklist regions, PCR duplicates, and unmapped reads from coordinate-sorted BAMs to produce clean files ready for downstream peak calling.

What artifacts should I filter out of raw BAM files before running peak calling?

Before peak calling, raw BAM files should be filtered to remove mitochondrial reads, reads in blacklist regions, PCR duplicates, and unmapped reads to ensure clean data and accurate peak detection.

Do I need a coordinate-sorted BAM with read group information for filtration?

Yes, BAM filtration requires coordinate-sorted BAM files that contain read group (RG) information to properly process and clean the data for both ChIP-seq and ATAC-seq analyses.

Can I perform BAM filtration without a predefined blacklist regions file?

Yes, if a blacklist file is missing, the process optionally prompts for blacklist usage and applies filtering when provided, otherwise proceeding with mitochondrial read removal, deduplication, and unmapped-read removal.

What output files are generated after cleaning raw BAM files for peak calls?

Cleaning raw BAM files generates a filtered BAM named sample.filtered.bam along with its index file sample.filtered.bam.bai, organized under a per-sample filtered_bam folder within the project directory.