数据下载

  1. wkdir=`pwd`
  2. mkdir $wkdir/data
  3. cd $wkdir/data
  4. prefetch SRR13195578 SRR13195579 SRR13195580 SRR13195581 SRR13195582 SRR13195583 SRR13195584 SRR13195585 SRR13195586 SRR13195587 SRR13195588 SRR13195589 --max-size u
  5. cd SRR13195578/
  6. fasterq-dump SRR13195578.sra

https://www.ncbi.nlm.nih.gov/bioproject/682443

https://www.ncbi.nlm.nih.gov/bioproject/?term=GSE162640

质控

  1. mkdir $wkdir/1_qc
  2. cd $wkdir/1_qc
  3. sample="SRR13195578"
  4. fastp \
  5. -i $wkdir/data/${sample}/${sample}_1.fastq \
  6. -I $wkdir/data/${sample}/${sample}_2.fastq \
  7. -o ${sample}_1.fp.fq.gz \
  8. -O ${sample}_2.fp.fq.gz \
  9. -j ${sample}.json \
  10. -h ${sample}.html \
  11. &> ${sample}.fp.log

比对

方法一(Bowtie2)

构建索引

  1. mkdir $wkdir/2_mapping_bowtie2
  2. cd $wkdir/2_mapping_bowtie2
  3. mkdir ref
  4. bowtie2-build \
  5. $wkdir/ncbi_dataset/data/GCF_000001735.4/GCF_000001735.4_TAIR10.1_genomic.fna \
  6. ref/genome \
  7. &> bowtie2-build.log

比对

  1. bowtie2 \
  2. -x $wkdir/2_mapping/ref/genome \
  3. -1 $wkdir/1_qc/${sample}_1.fp.fq.gz \
  4. -2 $wkdir/1_qc/${sample}_2.fp.fq.gz \
  5. -S ${sample}.sam \
  6. -p 4 \
  7. 1> ${sample}_bowtie2_align.log \
  8. 2> ${sample}_bowtie2_align.err

方法二(BWA)

构建索引

  1. mkdir $wkdir/2_mapping_bwa
  2. cd $wkdir/2_mapping_bwa
  3. mkdir ref

比对

  1. bwa mem \
  2. -M reference_genome.fa \
  3. sample1_R1_trimmed.fq \
  4. sample1_R2_trimmed.fq \
  5. > sample1_aligned.sam

过滤

方法一(picard)

排序

  1. mkdir $wkdir/3_filter_picard
  2. cd $wkdir/3_filter_picard
  3. samtools view \
  4. ${sample}.sam \
  5. -Sb \
  6. -q 20 | \
  7. samtools sort \
  8. -o ${sample}_sorted.bam \
  9. -@ 4 \
  10. &> ${sample}_sort_bam.log

过滤

去除PCR重复

  1. java -jar picard.jar MarkDuplicates \
  2. I=${sample}_sorted.bam \
  3. O=${sample}_aligned_dedup.bam \
  4. M=${sample}_duplicate_metrics.txt \
  5. REMOVE_DUPLICATES=true \
  6. &> ${sample}_picard.log
  7. # $EBROOTPICARD/picard.jar

方法二(deepTools)

  1. mkdir $wkdir/3_filter_deeptools
  2. cd $wkdir/3_filter_deeptools

参考

  1. 手把手教你学ChIP-seq数据分析 3
  2. ChIP-seq数据比对实战