当前位置: 首页>编程语言>正文

ChIP-seq数据分析实战训练(一)

ChIP-seq数据分析实战训练(一)

一、安装软件(conda)

###创建小环境
conda create -n chip
###激活小环境
conda activate chip 
###安装软件
conda install -y sratools trim-galore samtools deeptools homer bowtie2 bowtie MACS2

二、下载数据

参考文献

Brookes, E. et al. Polycomb associates genome-wide with a specific RNA polymerase II variant, and regulates metabolic genes in ESCs. Cell Stem Cell 10, 157–170 (2012).

数据下载链接

下载Accession List

ChIP-seq数据分析实战训练(一),第1张
cd /public/workspace/fangwen/learn/chip-seq/
#将SRR_Acc_List.txt文件上传服务器
###创建文件夹
mkdir {sra,raw,clean,align,peaks,motif,qc}
###批量下载
cat SRR_Acc_List.txt |while read id;do ( nohup $prefetch $id & );done

中间有几个文件下载失败:prefetch SRR号,单独下载

默认下载目录:~/ncbi/public/sra/

ls -lh ~/ncbi/public/sra/
#由默认目录链接到当前目录下
ln -s ~/ncbi/public/sra/  /public/workspace/fangwen/learn/chip-seq/sra

三、SRR数据转换为fastq文件

下载RunInfo Table (旧版)

ChIP-seq数据分析实战训练(一),第2张

制作config文件

#观察需要的文件在哪两列
head -1 runtable.txt |tr '\t' '\n' |cat -n
less -s runtable.txt

法一:用编程

cut -f 7,10 runtable.txt |cut -d":" -f 2 |sed 's/ChIPSeq//g' | sed 's/MockIP//g'|sed  's/^ //' |tr ' ' '_' |perl -alne '{$h{$F[0]}++ if exists $h{$F[0]}; $h{$F[0]}=1 unless exists $h{$F[0]};print "$F[0]$h{$F[0]}\t$F[1]"}' > config 

法二:直接用excel制作config文件

法三:vim

cut -f 7,10 runtable.txt |cut -d":" -f 2 |sed 's/ChIPSeq//g' | sed 's/MockIP//g'|sed  's/^ //' |tr ' ' '_' >config
vim config

单端测序数据的sra转fasq

cat config|while read id;
do echo $id
arr=($id)
srr=${arr[1]}
sample=${arr[0]}
nohup fastq-dump -A  $sample -O raw/  --gzip --split-3  ${srr}.sra & 
done
ChIP-seq数据分析实战训练(一),第3张

参考资料:

https://www.jianshu.com/p/1384173c353b


https://www.xamrdz.com/lan/5gj1848908.html

相关文章: