Skip to content
Snippets Groups Projects
Commit 623c227a authored by Holger Brandl's avatar Holger Brandl
Browse files

cont khan pipeline

parent 8e6e0e04
No related branches found
No related tags found
No related merge requests found
## enable snippet spinning
source <(curl https://raw.githubusercontent.com/holgerbrandl/datautils/v1.4/R/spinr/spin_utils.sh 2>&1 2>/dev/null)
#source <(curl https://raw.githubusercontent.com/holgerbrandl/datautils/v1.4/R/spinr/spin_utils.sh 2>&1 2>/dev/null)
## configure paths
......@@ -79,4 +78,5 @@ cat("<embed src=\"./bc.pdf\" width=\"900px\" height=\"700px\">")
' | spinsnip "bowtie2_qc"
}
\ No newline at end of file
}
export -f cs_bowtie_qc
\ No newline at end of file
## extract chromosome from bam file
samtools view -bo test.bam /home/brandl/mnt/chip-seq_study/ChIPSeq_February_2014/alignments_trimmed_nomulti_pooled/H2Az.bam 1
########################################################################################################################
## macs2 playground
macs2 -n --broad --gsize
#macs2 -n --gsize
########################################################################################################################
### deeptools
## https://github.com/fidelram/deepTools/wiki/All-command-line-options#bamCorrelate
#bamCorrelate bins --bamfiles $bamFiles --region 10:1:100000 --plotFile="bam_correlation.png" --numberOfProcessors=4 --corMethod spearman
## see how well bam files correlate using untrimmed data
bamCorrelate bins --bamfiles $bamFiles --plotFile="bam_correlation_untrimmed.png" --numberOfProcessors=4 --corMethod spearman
########################################################################################################################
### Peak calling with SPP
Rscript /home/brandl/bin/phantompeakqualtools/run_spp.R -c="../alignments_untrimmed/H2Az_Rep1_Lane2_Lib4454.0001.bam" -savp -out="test.txt"
########################################################################################################################
### other qc
## http://www.nature.com/nmeth/journal/v11/n1/full/nmeth.2786.html
# Teytelman et al. discovered that highly expressed loci were always enriched in ChIP peaks, regardless of which protein was pulled dow
#########################################################################################################################
#### CHANCE
mcdir $baseDir/qc_chance
## convert example to sam format
bamToBed -i $baseDir/alignments_trimmed/H2Az_Rep1_Lane1_Lib4454_ca.bam > H2Az_Rep1_Lane1_Lib4454_ca.bed
samtools view -h -o H2Az_Rep1_Lane1_Lib4454_ca.sam $baseDir/alignments_trimmed/H2Az_Rep1_Lane1_Lib4454_ca.bam
/local/home/henry/bin/CHANCE/run_chance_linux.sh /usr/local/MATLAB/MATLAB_Compiler_Runtime/v717/
########################################################################################################################
## Use phantompeakqualtools to calculate quality tag (strand cross-correlation of peak)
# did the antibody-treatment enrich sufficiently so that the ChIP signal can be separated from the background signal?
## --> use https://code.google.com/p/phantompeakqualtools/
mcdir $baseDir/qc_phantompeaks
#Rscript /local/home/brandl/bin/phantompeakqualtools/run_spp.R
#Rscript run_spp.R <bamfile> -savp -out=<outfile>
ctrlBam=$baseDir/alignments_untrimmed/H3-3_Rep1_Lane1_Lib4453.bam
#DEBUG ctrlBam=$baseDir/alignments_untrimmed/H3K4me3_Rep2_Lane2_Lib4455.bam
for bamFile in $baseDir/alignments_untrimmed/*bam ; do
echo "processing $bamFile..."
# Rscript /home/brandl/bin/phantompeakqualtools/run_spp.R -c=$bamFile -savp -ou t=$(basename $bamFile).pt.log
## one output file is enough because output is tabular including inpuyt file name
# Rscript /home/brandl/bin/phantompeakqualtools/run_spp.R -c=$bamFile -i=$ctrlBam -savp -savd -odir=$(pwd) -out=phantom_qc.txt
## with control
# ( Rscript /home/brandl/bin/phantompeakqualtools/run_spp.R -c=$bamFile -savp -savd -odir=$(pwd) -out=phantom_qc_noctrl.txt &> $(basename $bamFile).pt.log ) &
## without control
# ( Rscript /home/brandl/bin/phantompeakqualtools/run_spp.R -c=$bamFile -savp -savd -odir=$(pwd) -out=phantom_qc_noctrl.txt &> $(basename $bamFile).pt.log ) &
done
wait
## todo visualize results
#phantom output format
#format:Filename<tab>numReads<tab>estFragLen<tab>corr_estFragLen<tab>PhantomPeak<tab>corr_phantomPeak<tab>argmin_corr<tab>min_corr<tab>Normalized SCC (NSC)<tab>Relative SCC (RSC)<tab>QualityTag)
mailme "phantom qc done"
########################################################################################################################
### motifs
## run meme-chip
########################################################################################################################
### profiles
## try deepTools
## differential binding diffbind
## tbd
## docs
## http://blog.joncairns.com/2013/08/what-you-need-to-know-about-bash-functions/
## load lsf helpers
source <(curl https://dl.dropboxusercontent.com/u/113630701/datautils/bash/lsf_utils.sh 2>&1 2>/dev/null)
## enable snippet spinning
source <(curl https://dl.dropboxusercontent.com/u/113630701/datautils/R/utils/spinr.sh 2>&1 2>/dev/null)
## define common binaries
export PATH=/projects/bioinfo/holger/bin/bowtie2-2.2.2:$PATH
export PATH=/projects/bioinfo/holger/bin/tophat-2.0.13.Linux_x86_64:$PATH
export PATH=/home/brandl/bin/cufflinks-2.2.1.Linux_x86_64:$PATH
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment