{"id":590,"date":"2020-12-08T22:27:43","date_gmt":"2020-12-08T14:27:43","guid":{"rendered":"http:\/\/www.wuchangsong.com\/?p=590"},"modified":"2020-12-10T09:48:28","modified_gmt":"2020-12-10T01:48:28","slug":"atac-seq%e5%88%86%e6%9e%90%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"http:\/\/www.wuchangsong.com\/?p=590","title":{"rendered":"ATAC-seq\u5206\u6790\u6d41\u7a0b\uff08\u4e00\uff09"},"content":{"rendered":"<p>\u9996\u5148\u6839\u636e\u4eca\u5e74\u53d1\u8868\u5728<a href=\"https:\/\/genomebiology.biomedcentral.com\/articles\/10.1186\/s13059-020-1929-3\">Genome Biology<\/a>\u4e0a\u4e00\u7bc7\u7efc\u8ff0\u603b\u89c8\u5206\u6790\u6d41\u7a0b\uff1a<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-593\" src=\"http:\/\/www.wuchangsong.com\/wp-content\/uploads\/2020\/12\/ATAC-300x198.png\" alt=\"\" width=\"300\" height=\"198\" srcset=\"http:\/\/www.wuchangsong.com\/wp-content\/uploads\/2020\/12\/ATAC-300x198.png 300w, http:\/\/www.wuchangsong.com\/wp-content\/uploads\/2020\/12\/ATAC-768x506.png 768w, http:\/\/www.wuchangsong.com\/wp-content\/uploads\/2020\/12\/ATAC-1024x675.png 1024w, http:\/\/www.wuchangsong.com\/wp-content\/uploads\/2020\/12\/ATAC.png 1217w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><br \/>\n\u4f5c\u8005\u5efa\u8bae\u7684\u9884\u5904\u7406\u5206\u6790\u6d41\u7a0b\u4e3a\uff1aFastQC-trimmomatic-BWA-MEM-ATACseqQC\u3002<br \/>\n\u4e00\u3001\u4f7f\u7528Fastqc\u5bf9fastq \u6587\u4ef6\u7684\u6d4b\u5e8f\u8d28\u91cf\u7edf\u8ba1<\/p>\n<pre>for i in `ls *fastq`; do echo \"fastqc -t 4 -o .\/ $i\"; done &gt; fastqc.sh\r\nnohup ParaFly -c fastqc.sh -CPU 18 &amp;<\/pre>\n<p>\u4e8c\u3001Trimmomatic\u8d28\u63a7\uff08\u53ef\u4f7f\u7528 cutadapt,AdapterRemoval v2,Skewer \u548c trimmomatic \u7b49\u8f6f\u4ef6\uff09<br \/>\nThe forward and reverse adapters are slightly different. We will also trim low quality bases at the ends of the reads (quality less than 20). We will only keep reads that are at least 20 bases long. We remove short reads (&lt; 20bp) as they are not useful, they will either be thrown out by the mapping or may interfere with our results at the end.<\/p>\n<pre>mkdir 1.trimmomatic\r\ncd 1.trimmomatic\/\r\nfor i in `cat ..\/samples.txt`\r\ndo\r\n    echo \"java -jar \/opt\/biosoft\/Trimmomatic-0.38\/trimmomatic-0.38.jar PE -threads 20 ..\/$i.1.fastq ..\/$i.2.fastq $i.1.fastq $i.1.unpaired.fastq $i.2.fastq $i.2.unpaired.fastq ILLUMINACLIP:\/opt\/biosoft\/Trimmomatic-0.38\/adapters\/TruSeq3-PE-2.fa:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:20 TOPHRED33 2&gt; $i.trimmomatic.log\"\r\ndone &gt; command.trimmomatic.list\r\nParaFly -c command.trimmomatic.list -CPU 9\r\ncd ..<\/pre>\n<p>\u4e09\u3001Mapping Reads to Reference Genome<\/p>\n<pre>mkdir 2.bowtie2 &amp;&amp; cd 2.bowtie2\r\nbowtie2-build --threads 160 genome.fasta genome\r\nfor i in `cat ..\/samples.txt`\r\ndo\r\n    echo \"bowtie2 -x genome -1 ..\/1.trimmomatic\/$i.1.fastq -2 ..\/1.trimmomatic\/$i.2.fastq -p 160 -I 0 -X 1000 --very-sensitive -S $i.bowtie2.sam 2&gt; $i.bowtie2.log\"\r\ndone &gt; bowtie2.list\r\nParaFly -c bowtie2.list -CPU 9\r\nfor i in `cat ..\/samples.txt`\r\ndo\r\n    echo \"samtools sort -@ 40 -m 8G -o $i.bowtie2.bam -O BAM $i.bowtie2.sam\"\r\ndone &gt; sam2bam.list\r\nParaFly -c sam2bam.list -CPU 9\r\ncd ..\r\n<\/pre>\n<p>\u56db\u3001Filtering Mapped Reads<br \/>\n1\u3001Filter Duplicate Reads<br \/>\n\u53bb\u9664\u91cd\u590d\u53ef\u9009\u62e9samtools\u3001picard\u548csambamba\uff0c\u5176\u4e2dsambamba\u7684\u64cd\u4f5c\u901f\u5ea6\u6700\u5feb\uff0c\u63a8\u8350\u4f7f\u7528\uff0c\u5b89\u88c5\u63a8\u8350\u4f7f\u7528conda<\/p>\n<pre>sambamba markdup -r --overflow-list-size 600000  --tmpdir='.\/' ..\/2.bowtie2\/$i.bowtie2.bam $i.sambamba.rmdup.bam<\/pre>\n<p>&#8211;overflow-list-size=OVERFLOWLISTSIZE<br \/>\nsize of the overflow list where reads, thrown away from the hash table, get a second chance to meet their pairs (default is 200000 reads); increasing the size reduces the number of temporary files created<br \/>\n-r, &#8211;remove-duplicates<br \/>\nremove duplicates instead of just marking them<br \/>\n-t, &#8211;nthreads=NTHREADS<br \/>\nnumber of threads to use<br \/>\nBUGS<br \/>\nExternal sort is not implemented. Thus, memory consumption grows by 2Gb per each 100M reads. Check that you have enough RAM before running the tool.<\/p>\n<p>2\u3001Filter Uninformative Reads<\/p>\n<pre>samtools view -h -f 2 -q 30 $i.sambamba.rmdup.bam |grep -v pilon373| samtools sort -O bam -@ 40 -o - &gt; $i.last.bam\r\nsamtools index $i.last.bam\r\nsamtools index $i.sambamba.rmdup.bam\r\nsamtools flagstat $i.sambamba.rmdup.bam &gt; $i.sambamba.rmdup.stat\r\nsamtools flagstat $i.last.bam &gt; $i.last.stat\r\nbedtools bamtobed -i $i.last.bam &gt; $i.bed\r\n<\/pre>\n<p>3\u3001Check Insert Sizes<\/p>\n<pre>for i in `cat ..\/samples.txt`\r\ndo\r\n    echo \"samtools view $i.last.bam |awk '{print $9}'  &gt; $i.last_length.txt\"\r\ndone &gt; last_bam_length.list\r\nParaFly -c last_bam_length.list -CPU 9<\/pre>\n<p>\u6570\u636e\u53ef\u5bfc\u5165R\u7ed8\u56fe<br \/>\n\u4e94\u3001Peak calling\uff08\u8be6\u7ec6\u53c2\u6570\u53c2\u8003<a href=\"https:\/\/www.jianshu.com\/p\/21e8c51fca23\">https:\/\/www.jianshu.com\/p\/21e8c51fca23<\/a>\uff09<\/p>\n<pre>macs2 callpeak -t ..\/3.filtering\/$i.bed -g 8.9e8 --nomodel --shift -100 --extsize 200 -n $i.peaks --outdir .\/<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\u6839\u636e\u4eca\u5e74\u53d1\u8868\u5728Genome Biology\u4e0a\u4e00\u7bc7\u7efc\u8ff0\u603b\u89c8\u5206\u6790\u6d41\u7a0b\uff1a \u4f5c\u8005\u5efa\u8bae\u7684\u9884\u5904\u7406\u5206\u6790\u6d41\u7a0b\u4e3a\uff1aFastQC-trimmomatic-BWA-MEM-ATACseqQC\u3002 \u4e00\u3001\u4f7f\u7528Fastqc\u5bf9fastq \u6587\u4ef6\u7684\u6d4b\u5e8f\u8d28\u91cf\u7edf\u8ba1 for i in `ls *fastq`; do echo &#8220;fastqc -t 4 -o .\/ $i&#8221;; done &gt; fastqc.sh nohup ParaFly -c fastqc.sh -CPU 18 &amp; \u4e8c\u3001Trimmomatic\u8d28\u63a7\uff08\u53ef\u4f7f\u7528 cutadapt,AdapterRemoval v2,Skewer \u548c trimmomatic \u7b49\u8f6f\u4ef6\uff09 The forward and reverse adapters are slightly different. We will also trim low quality bases at the ends of the reads [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=\/wp\/v2\/posts\/590"}],"collection":[{"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=590"}],"version-history":[{"count":15,"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=\/wp\/v2\/posts\/590\/revisions"}],"predecessor-version":[{"id":608,"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=\/wp\/v2\/posts\/590\/revisions\/608"}],"wp:attachment":[{"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=590"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wuchangsong.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}