Created
August 29, 2012 15:06
-
-
Save arq5x/3513992 to your computer and use it in GitHub Desktop.
Pipeline for NBN ChIP-seq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# alias the raw data files | |
ln -s C0PYJACXX_s7_0_GSL48index_10_SL16067.fastq.gz 0h-IP-nbn.fq.gz | |
ln -s C0PYJACXX_s7_0_GSL48index_11_SL16068.fastq.gz 3Gy-IP-nbn.fq.gz | |
ln -s C0PYJACXX_s7_0_GSL48index_12_SL16069.fastq.gz PpoI-IP-nbn.fq.gz | |
ln -s C0PYJACXX_s7_0_GSL48index_7_SL16064.fastq.gz 0h-Input.fq.gz | |
ln -s C0PYJACXX_s7_0_GSL48index_8_SL16065.fastq.gz 3Gy-Input.fq.gz | |
ln -s C0PYJACXX_s7_0_GSL48index_9_SL16066.fastq.gz PpoI-Input.fq.gz | |
# build a list of sample stubs | |
SAMPLES="0h-Input 0h-IP-nbn 3Gy-Input 3Gy-IP-nbn PpoI-Input PpoI-IP-nbn" | |
# align the raw FASTQ files | |
STEPNAME=bwa-aln | |
GENOME=~/shared/genomes/hg19/bwa/gatk/hg19_gatk.fa | |
WHERE=/home/arq5x/cphg-home/projects/concannon-nibrin-chipseq/orig-fastqs-from-ha | |
export QSUB="qsub -q cphg -W group_list=CPHG -V -l select=1:mem=4000m:ncpus=8 -N $STEPNAME -m bea -M [email protected]" | |
for sample in $SAMPLES | |
do | |
echo "cd $WHERE; bwa aln -t 6 $GENOME $sample.fq.gz > $sample.sai" | $QSUB | |
done | |
# BWA SAMSE | |
STEPNAME=bwa-samse | |
GENOME=~/shared/genomes/hg19/bwa/gatk/hg19_gatk.fa | |
WHERE=/home/arq5x/cphg-home/projects/concannon-nibrin-chipseq | |
export QSUB="qsub -q cphg -W group_list=CPHG -V -l select=1:mem=4000m:ncpus=8 -N $STEPNAME -m bea -M [email protected]" | |
for sample in $SAMPLES | |
do | |
echo "cd $WHERE; bwa samse -n 100 -r '@RG\tID:$sample\tSM:$sample' $GENOME \ | |
orig-fastqs-from-ha/$sample.sai \ | |
orig-fastqs-from-ha/$sample.fq.gz \ | |
| samtools view -Sb - > bam/$sample.bam" \ | |
| $QSUB | |
done | |
# samtools sort | |
STEPNAME=smtls-srt | |
WHERE=/home/arq5x/cphg-home/projects/concannon-nibrin-chipseq | |
export QSUB="qsub -q cphg -W group_list=CPHG -V -l select=1:mem=4000m:ncpus=2 -N $STEPNAME -m bea -M [email protected]" | |
for sample in $SAMPLES | |
do | |
echo "cd $WHERE; samtools sort bam/$sample.bam bam/$sample.possort" | $QSUB | |
done | |
# samtools index | |
STEPNAME=smtls-idx | |
WHERE=/home/arq5x/cphg-home/projects/concannon-nibrin-chipseq | |
export QSUB="qsub -q cphg -W group_list=CPHG -V -l select=1:mem=4000m:ncpus=2 -N $STEPNAME -m bea -M [email protected]" | |
for sample in $SAMPLES | |
do | |
echo "cd $WHERE; samtools index bam/$sample.possort.bam" | $QSUB | |
done | |
# make a MAPQ >=30 BEDGRAPH for each sample | |
STEPNAME=bedgraph | |
WHERE=/home/arq5x/cphg-home/projects/concannon-nibrin-chipseq | |
export QSUB="qsub -q cphg -W group_list=CPHG -V -l select=1:mem=4000m:ncpus=2 -N $STEPNAME -m bea -M [email protected]" | |
for sample in $SAMPLES | |
do | |
echo "cd $WHERE; samtools view -uq 30 bam/$sample.possort.bam | \ | |
bedtools genomecov -ibam - -bg > bam/$sample.possort.bam.q30.bedg" | $QSUB | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment