$ more bowtie_ATAC.pl
@files = <*_trimmed_1.fastq.gz>;
foreach $file (@files)
{
$file=~s/_trimmed_1.fastq.gz//;
print "`bowtie2 --threads 4 --local --maxins 2000 -x /g/korbel2/StrandSeq/Test_HJ/reference/bowtie2_mm10/genome_mm10 -1 ".$file."_trimmed_1.fastq.gz -2 ".$file."_trimmed_2.fastq.gz 2> ".$file.".bowtie.log | samtools view -bT /g/korbel/shared/datasets/refgenomes/mouse/Mus_musculus_mm10.fa - > ".$file.".raw.bam`;\n\n";
}
수정본
@files = <*_trimmed_1.fq.gz>;
foreach $file (@files)
{
$file=~s/_trimmed_1.fq.gz//;
print "`bowtie2 --threads 4 --local --maxins 2000 -x /home/user/Justin2/jwoong/reference/mm10_index -1 ".$file."_trimmed_1.fq.gz -2 ".$file."_trimmed_2.fq.g
z 2> ".$file.".bowtie.log | samtools view -bT /home/user/Justin2/jwoong/reference/mm10.fa - > ".$file.".raw.bam`;\n\n";
}
Bowtie2 options / Samtools view option
--threads 4 : 쓰레드 4개 사용
--local : local read assignment (지역 매칭)
--maxins 2000 : read1과 read2 사이의 genome이 2000bp
-x : reference 위치
-1 : paired-end에서 read1
-2 : paired-end에서 read2
| : OR
view -bT : sam파일을 bam파일로 변환(+reference sequence를 포함)
perl bowtie_ATAC.pl > bowtie_ATAC_auto.pl
$ more bowtie_ATAC_auto.pl
`bowtie2 --threads 4 --local --maxins 2000 -x /home/user/Justin2/jwoong/reference/mm10_index -1 mESC_ATACseq_day0_1_atac2_trimmed_1.fq.gz -2 mESC_ATACseq_da
y0_1_atac2_trimmed_2.fq.gz 2> mESC_ATACseq_day0_1_atac2.bowtie.log | samtools view -bT /home/user/Justin2/jwoong/reference/mm10.fa - > mESC_ATACseq_day0_1_a
tac2.raw.bam`;
`bowtie2 --threads 4 --local --maxins 2000 -x /home/user/Justin2/jwoong/reference/mm10_index -1 mESC_ATACseq_day0_2_atac2_trimmed_1.fq.gz -2 mESC_ATACseq_da
y0_2_atac2_trimmed_2.fq.gz 2> mESC_ATACseq_day0_2_atac2.bowtie.log | samtools view -bT /home/user/Justin2/jwoong/reference/mm10.fa - > mESC_ATACseq_day0_2_a
tac2.raw.bam`;
./bowtie_ATAC_auto.sh
$ more bowtie_ATAC_auto.sh
#!/bin/bash
#module load Bowtie2/2.3.2-foss-2016b
#module load SAMtools/1.3.1-foss-2016b
perl bowtie_ATAC_auto.pl
$ chmod +x ./bowtie_ATAC_auto.sh
or
$ perl bowtie_ATAC_auto.pl