Downloading Public ChIP-Seq Data from GEO/SRA & Diagnostic Read QC
Downloading Public ChIP-Seq Data from GEO/SRA & Diagnostic Read QC
Fetching raw ChIP-seq sequencing data from NCBI GEO and SRA using fasterq-dump, evaluating base quality scores with FastQC, trimming adapters and poly-G tails with fastp, and compiling interactive MultiQC dashboards to identify low-complexity or degraded libraries.
1. Public SRA & GEO Ingestion Architecture
Public repositories such as the NCBI Gene Expression Omnibus (GEO) and the Sequence Read Archive (SRA) store thousands of high-quality ChIP-seq runs. For our Huntington's Disease study, we retrieve matched biological replicates: HD patients vs. healthy controls, alongside their corresponding Input (sheared chromatin without antibody) libraries.
# Create structured project directories
mkdir -p hd_chipseq/{00_raw_fastq,01_trimmed,02_aligned,03_filtered,04_peaks,05_diffbind,06_qc_reports,07_visualization}
cd hd_chipseq
# Download SRA datasets using multi-threaded fasterq-dump
fasterq-dump --split-files --threads 8 --outdir 00_raw_fastq/ SRR2041280 # HD H3K4me3 Rep 1
fasterq-dump --split-files --threads 8 --outdir 00_raw_fastq/ SRR2041281 # HD H3K4me3 Rep 2
fasterq-dump --split-files --threads 8 --outdir 00_raw_fastq/ SRR2041282 # Control H3K4me3 Rep 1
fasterq-dump --split-files --threads 8 --outdir 00_raw_fastq/ SRR2041283 # Control H3K4me3 Rep 2
fasterq-dump --split-files --threads 8 --outdir 00_raw_fastq/ SRR2041284 # HD Input
fasterq-dump --split-files --threads 8 --outdir 00_raw_fastq/ SRR2041285 # Control Input
# Compress raw FASTQ files to conserve disk space
pigz -p 8 00_raw_fastq/*.fastq2. Raw Read Quality Assessment with FastQC
Prior to read trimming or alignment, we run FastQC to inspect base call Phred scores ($Q$), per-base sequence content, GC distribution, and over-represented adapter sequences:
fastqc -t 8 00_raw_fastq/*.fastq.gz -o 06_qc_reports/3. Automated Trimming & Quality Filtering with fastp
ChIP-seq libraries frequently suffer from Illumina adapter read-through when DNA fragments are shorter than the sequencing cycle count. Additionally, NextSeq and NovaSeq two-color chemistries produce spurious poly-G tails when no fluorescent signal is detected. We use fastp to perform adapter detection, poly-G clipping, and quality filtering:
for sample in HD_Rep1 HD_Rep2 Control_Rep1 Control_Rep2 HD_Input Control_Input; do
echo "Processing sample: ${sample}"
fastp \
-i 00_raw_fastq/${sample}.fastq.gz \
-o 01_trimmed/${sample}.trimmed.fastq.gz \
--html 06_qc_reports/${sample}_fastp.html \
--json 06_qc_reports/${sample}_fastp.json \
--trim_poly_g \
--cut_front --cut_tail --cut_mean_quality 20 \
--length_required 35 \
--thread 6
done
# Aggregate all QC statistics into a single interactive HTML report
multiqc 06_qc_reports/ -o 06_qc_reports/multiqc_raw_report/Common Pitfalls & Troubleshooting Checklist
- Java Heap Exhaustion (GATK / Picard): If processes terminate with
java.lang.OutOfMemoryError, set your environment variable explicitly:export _JAVA_OPTIONS="-Xmx16g -Djava.io.tmpdir=/tmp". - Index Timestamp Mismatch: If tools complain that a BAM index is missing or out of date, regenerate with
samtools index -@ 4 sample.bam. - Conda Channel Conflicts: Avoid ABI incompatibilities between bioconda and conda-forge by setting strict priority:
conda config --set channel_priority strict. - Chromosome Naming Contamination: Always verify whether reference FASTA headers use
chr1or1; divergent naming causes silent alignment drops.