ChIPseq factor using homer

# —- using homer for peak calling (under conda environment ‘myperl’) —-
http://homer.ucsd.edu/homer/ngs/index.html

findPeaks -style -o auto -i

Even I don’t like typing the same commands over and over again. The following command performs the standard set of analysis commands so that you can do better things while your data is processed.

analyzeChIP-Seq.pl [general options] [-A | B | C | D sub-program options]

i.e. a common use: analyzeChIP-Seq.pl Factor-ChIP-Seq/ hg18r -i Input-ChIP-Seq -focus -A factor_alignment_file.bed factor_alignment_file2.bed

This command performs 4 separate tasks labeled as A,B,C & D:

A. Runs makeTagDirectory to parse alignment files, set up the tag directory, and performs basic QC such as tag auto correlation and checks for sequence bias.
B. Runs make makeUCSCfile and findPeaks to generate UCSC Genome Browser files and peak files for the experiment.
C. Runs findMotifsGenome.pl to determine enriched motifs in your ChIP-Seq peaks.
D. Runs annotatePeaks.pl to generate an annotated peak file and performs GO analysis on genes found near the peaks.

As output, this program will create standard files in the “Tag Directory” including an “index.html” file that links you to each of the output files.

#–
Due to the large size of the results, I will send them in another mail with my Gmail account. Based on the percent mapped reads in MultiQC multiqc_report.html and correlation_heatmap.png. I’d suggest excluding the sample HEK293_mock_r3, HEK293_mock_r2, and hTERT_LT_r1 from the downstream analyses.

In general, we should keep the replicates as much as possible since the more replicates, the higher the statistical power for the downstream analysis.

For the differential analysis, I performed the following diffreps for HEK293 and hTERT.
diffReps.pl –treatment HEK293_LT+sT_r1.dedup.sorted.bed HEK293_LT+sT_r2.dedup.sorted.bed HEK293_LT+sT_r3.dedup.sorted.bed –btr HEK293_LT+sT_r1_Input.dedup.sorted.bed HEK293_LT+sT_r2_Input.dedup.sorted.bed HEK293_LT+sT_r3_Input.dedup.sorted.bed –control HEK293_mock_r1.dedup.sorted.bed –bco HEK293_mock_r1_Input.dedup.sorted.bed –gname hg19 –report HEK293_LT+sT_0.001.diff.gt.txt –nsd sharp –meth gt –window 1000 -frag 200 –nproc 10 –pval 0.001;
diffReps.pl –treatment hTERT_LT+sT_r1.dedup.sorted.bed hTERT_LT+sT_r2.dedup.sorted.bed –btr hTERT_LT+sT_r1_Input.dedup.sorted.bed hTERT_LT+sT_r2_Input.dedup.sorted.bed –control hTERT_mock_r1.dedup.sorted.bed hTERT_mock_r2.dedup.sorted.bed –bco hTERT_mock_r1_Input.dedup.sorted.bed hTERT_mock_r2_Input.dedup.sorted.bed –gname hg19 –report hTERT_LT+sT_0.001.diff.gt.txt –nsd sharp –meth gt –window 1000 -frag 200 –nproc 10 –pval 0.001;
diffReps.pl –treatment hTERT_LT_r2.dedup.sorted.bed –btr hTERT_LT_r2_Input.dedup.sorted.bed –control hTERT_mock_r1.dedup.sorted.bed hTERT_mock_r2.dedup.sorted.bed –bco hTERT_mock_r1_Input.dedup.sorted.bed hTERT_mock_r2_Input.dedup.sorted.bed –gname hg19 –report hTERT_LT_0.001.diff.gt.txt –nsd sharp –meth gt –window 1000 -frag 200 –nproc 10 –pval 0.001;

In the commands above, I took the mock-groups as control. I didn’t run diffreps for PFSK-1 samples since I couldn’t find the mock-groups.

You can find the bam-, bed- and bigwigs-files in the corresponding directories. In the next step, I’d choose suitable tools for predicting functional transcriptional regulators based on the geneset/peak_regions if you think the peak regions in the current results make sense.

HEK293_mock_r3,
HEK293_mock_r2,
hTERT_LT_r1

#TODO: draw a circles covering 3 type of samples#
# If the most peaks are covered from each other –> Success!

#/pkgs/homer-/share/homer-/configureHomer.pl.

makeTagDirectory [options] [alignment file 2] …

getDifferentialPeaksReplicates.pl -t Oct4-r1/ Oct4-r2/ -i Input-r1/ Input-r2/ -genome hg19 > outputPeaks.txt
getDifferentialPeaksReplicates.pl -t Oct4-r1/ Oct4-r2/ -b Sox2-r1/ Sox2-r2/ -i Input-r1/ Input-r2/ > outputPeaks.txt
annotatePeaks.pl tss hg19 > tss.txt

perl /path-to-homer/configureHomer.pl -install hg19 (to download the hg19 version of the human genome)
perl ~/anaconda3/envs/myperl/share/homer/configureHomer.pl -list
perl ~/anaconda3/envs/myperl/share/homer/configureHomer.pl -install human
hg19 v6.4 human genome and annotation for UCSC hg19
hg38 v6.4 human genome and annotation for UCSC hg38

makeTagDirectory HEK293_LT+sT ../picard/HEK293_LT+sT_r1.dedup.sorted.bam ../picard/HEK293_LT+sT_r2.dedup.sorted.bam ../picard/HEK293_LT+sT_r3.dedup.sorted.bam
makeTagDirectory HEK293_LT+sT_Input ../picard/HEK293_LT+sT_r1_Input.dedup.sorted.bam ../picard/HEK293_LT+sT_r2_Input.dedup.sorted.bam ../picard/HEK293_LT+sT_r3_Input.dedup.sorted.bam
makeTagDirectory hTERT_LT+sT ../picard/hTERT_LT+sT_r1.dedup.sorted.bam ../picard/hTERT_LT+sT_r2.dedup.sorted.bam
makeTagDirectory hTERT_LT+sT_Input ../picard/hTERT_LT+sT_r1_Input.dedup.sorted.bam ../picard/hTERT_LT+sT_r2_Input.dedup.sorted.bam
makeTagDirectory PFSK-1A_LT+sT ../picard/PFSK-1A_LT+sT_r1.dedup.sorted.bam ../picard/PFSK-1A_LT+sT_r2.dedup.sorted.bam
makeTagDirectory PFSK-1A_LT+sT_IgG ../picard/PFSK-1A_LT+sT_r1_IgG.dedup.sorted.bam ../picard/PFSK-1A_LT+sT_r2_IgG.dedup.sorted.bam
makeTagDirectory PFSK-1B_LT+sT ../picard/PFSK-1B_LT+sT_r1.dedup.sorted.bam ../picard/PFSK-1B_LT+sT_r2.dedup.sorted.bam
makeTagDirectory PFSK-1B_LT+sT_Input ../picard/PFSK-1B_LT+sT_r1_Input.dedup.sorted.bam ../picard/PFSK-1B_LT+sT_r2_Input.dedup.sorted.bam

for sample in HEK293_LT+sT_r1 HEK293_LT+sT_r2 HEK293_LT+sT_r3; do
makeTagDirectory ${sample} ../picard/${sample}.dedup.sorted.bam
makeTagDirectory ${sample}_Input ../picard/${sample}_Input.dedup.sorted.bam
done
for sample in hTERT_LT+sT_r1 hTERT_LT+sT_r2 PFSK-1B_LT+sT_r1 PFSK-1B_LT+sT_r2; do
makeTagDirectory ${sample} ../picard/${sample}.dedup.sorted.bam
makeTagDirectory ${sample}_Input ../picard/${sample}_Input.dedup.sorted.bam
done
for sample in PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r2; do
makeTagDirectory ${sample} ../picard/${sample}.dedup.sorted.bam
makeTagDirectory ${sample}_IgG ../picard/${sample}_IgG.dedup.sorted.bam
done

./HEK293_LT+sT_r1.dedup.sorted.bam
./HEK293_LT+sT_r1_Input.dedup.sorted.bam
./HEK293_LT+sT_r2.dedup.sorted.bam
./HEK293_LT+sT_r2_Input.dedup.sorted.bam
./HEK293_LT+sT_r3.dedup.sorted.bam
./HEK293_LT+sT_r3_Input.dedup.sorted.bam

#./HEK293_mock_r1.dedup.sorted.bam
#./HEK293_mock_r1_Input.dedup.sorted.bam
##./HEK293_mock_r2.dedup.sorted.bam —
##./HEK293_mock_r2_Input.dedup.sorted.bam —
##./HEK293_mock_r3.dedup.sorted.bam —
##./HEK293_mock_r3_Input.dedup.sorted.bam —
##./hTERT_LT_r1.dedup.sorted.bam —
##./hTERT_LT_r1_Input.dedup.sorted.bam —
#./hTERT_LT_r2.dedup.sorted.bam
#./hTERT_LT_r2_Input.dedup.sorted.bam

./hTERT_LT+sT_r1.dedup.sorted.bam
./hTERT_LT+sT_r1_Input.dedup.sorted.bam
./hTERT_LT+sT_r2.dedup.sorted.bam
./hTERT_LT+sT_r2_Input.dedup.sorted.bam
#./hTERT_mock_r1.dedup.sorted.bam
#./hTERT_mock_r1_Input.dedup.sorted.bam
#./hTERT_mock_r2.dedup.sorted.bam
#./hTERT_mock_r2_Input.dedup.sorted.bam

./PFSK-1A_LT+sT_r1.dedup.sorted.bam
./PFSK-1A_LT+sT_r1_IgG.dedup.sorted.bam
./PFSK-1A_LT+sT_r2.dedup.sorted.bam
./PFSK-1A_LT+sT_r2_IgG.dedup.sorted.bam

./PFSK-1B_LT+sT_r1.dedup.sorted.bam
./PFSK-1B_LT+sT_r1_Input.dedup.sorted.bam
./PFSK-1B_LT+sT_r2.dedup.sorted.bam
./PFSK-1B_LT+sT_r2_Input.dedup.sorted.bam

picard MergeSamFiles O=HEK293_LT+sT.dedup.sorted.bam I=HEK293_LT+sT_r1.dedup.sorted.bam I=HEK293_LT+sT_r2.dedup.sorted.bam I=HEK293_LT+sT_r3.dedup.sorted.bam
picard MergeSamFiles O=hTERT_LT+sT.dedup.sorted.bam I=hTERT_LT+sT_r1.dedup.sorted.bam I=hTERT_LT+sT_r2.dedup.sorted.bam
picard MergeSamFiles O=PFSK-1A_LT+sT.dedup.sorted.bam I=PFSK-1A_LT+sT_r1.dedup.sorted.bam I=PFSK-1A_LT+sT_r2.dedup.sorted.bam
picard MergeSamFiles O=PFSK-1B_LT+sT.dedup.sorted.bam I=PFSK-1B_LT+sT_r1.dedup.sorted.bam I=PFSK-1B_LT+sT_r2.dedup.sorted.bam
picard MergeSamFiles O=HEK293_LT+sT_Input.dedup.sorted.bam I=HEK293_LT+sT_r1_Input.dedup.sorted.bam I=HEK293_LT+sT_r2_Input.dedup.sorted.bam I=HEK293_LT+sT_r3_Input.dedup.sorted.bam
picard MergeSamFiles O=hTERT_LT+sT_Input.dedup.sorted.bam I=hTERT_LT+sT_r1_Input.dedup.sorted.bam I=hTERT_LT+sT_r2_Input.dedup.sorted.bam
picard MergeSamFiles O=PFSK-1A_LT+sT_Input.dedup.sorted.bam I=PFSK-1A_LT+sT_r1_Input.dedup.sorted.bam I=PFSK-1A_LT+sT_r2_Input.dedup.sorted.bam
picard MergeSamFiles O=PFSK-1B_LT+sT_Input.dedup.sorted.bam I=PFSK-1B_LT+sT_r1_Input.dedup.sorted.bam I=PFSK-1B_LT+sT_r2_Input.dedup.sorted.bam

for sample in HEK293_LT+sT_r1 HEK293_LT+sT_r2 HEK293_LT+sT_r3 hTERT_LT+sT_r1 hTERT_LT+sT_r2 PFSK-1B_LT+sT_r1 PFSK-1B_LT+sT_r2; do
makeUCSCfile ${sample} -pseudo 1 -bigWig /home/jhuang/REFs/hg19.chromSizes -o auto -style chipseq -norm 1e7 -normLength 100 -fsize 1
makeUCSCfile ${sample}_Input -pseudo 1 -bigWig /home/jhuang/REFs/hg19.chromSizes -o auto -style chipseq -norm 1e7 -normLength 100 -fsize 1
done
for sample in PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r2; do
makeUCSCfile ${sample} -pseudo 1 -bigWig /home/jhuang/REFs/hg19.chromSizes -o auto -style chipseq -norm 1e7 -normLength 100 -fsize 1
makeUCSCfile ${sample}_IgG -pseudo 1 -bigWig /home/jhuang/REFs/hg19.chromSizes -o auto -style chipseq -norm 1e7 -normLength 100 -fsize 1
done

#or makeBigWig.pl
##under (ngi_chipseq_ac2)
#for sample in HEK293_LT+sT_r1 HEK293_LT+sT_r1_Input HEK293_LT+sT_r2 HEK293_LT+sT_r2_Input HEK293_LT+sT_r3 HEK293_LT+sT_r3_Input hTERT_LT+sT_r1 hTERT_LT+sT_r1_Input hTERT_LT+sT_r2 hTERT_LT+sT_r2_Input PFSK-1B_LT+sT_r1 PFSK-1B_LT+sT_r1_Input PFSK-1B_LT+sT_r2 PFSK-1B_LT+sT_r2_Input
#for sample in PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r1_IgG PFSK-1A_LT+sT_r2 PFSK-1A_LT+sT_r2_IgG; do
# cd ${sample}
# gunzip ${sample}.ucsc.bedGraph.gz
# bedGraphToBigWig ${sample}.ucsc.bedGraph ~/REFs/hg19.chromSizes ${sample}.ucsc.bw
# cd ..
#done

for sample in HEK293_LT+sT_r1 HEK293_LT+sT_r2 HEK293_LT+sT_r3 hTERT_LT+sT_r1 hTERT_LT+sT_r2 PFSK-1B_LT+sT_r1 PFSK-1B_LT+sT_r2; do
for sample in PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r2; do
cd ${sample}
#mv peaks.txt peaks_.txt
mv ${sample}.ucsc.bedGraph ${sample}.ucsc.bedGraph_
mv ${sample}.ucsc.bw ${sample}.ucsc.bw_
cd ..
cd ${sample}_IgG
#mv peaks.txt peaks_.txt
mv ${sample}_IgG.ucsc.bedGraph ${sample}_IgG.ucsc.bedGraph_
mv ${sample}_IgG.ucsc.bw ${sample}_IgG.ucsc.bw_
cd ..
done

# peak calling
for sample in HEK293_LT+sT_r1 HEK293_LT+sT_r2 HEK293_LT+sT_r3 hTERT_LT+sT_r1 hTERT_LT+sT_r2 PFSK-1B_LT+sT_r1 PFSK-1B_LT+sT_r2; do
findPeaks ${sample} -style factor -size 1000 -minDist 2000 -gsize 3e9 -F 4.0 -P 0.0001 -L 0 -o auto -i ${sample}_Input
done
for sample in PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r2; do
findPeaks ${sample} -style factor -size 1000 -minDist 2000 -gsize 3e9 -F 4.0 -P 0.0001 -L 0 -o auto -i ${sample}_IgG
done

echo “library(VennDiagram)” > draw_venn.R
cat PFSK-1A_LT+sT_r2/geneNames_.txt >> draw_venn.R
cat PFSK-1B_LT+sT_r1/geneNames_.txt >> draw_venn.R
cat PFSK-1B_LT+sT_r2/geneNames_.txt >> draw_venn.R
#echo “print(length(PFSK_1B_r1[!duplicated(PFSK_1B_r1)]))”
#4396
echo “y<-intersect(intersect(PFSK_1A_r2,PFSK_1B_r1),PFSK_1B_r2)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’block_4396.txt’,sep=’,’)” >> draw_venn.R
#6828,922,638
echo “y<-setdiff(PFSK_1A_r2,union(PFSK_1B_r1,PFSK_1B_r2))" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’block_6828.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(PFSK_1B_r1,union(PFSK_1A_r2,PFSK_1B_r2))" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’block_922.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(PFSK_1B_r2,union(PFSK_1A_r2,PFSK_1B_r1))" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’block_638.txt’,sep=’,’)” >> draw_venn.R
#2279,546,1722
echo “y<-setdiff(intersect(PFSK_1A_r2,PFSK_1B_r1),PFSK_1B_r2)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’block_2279.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(intersect(PFSK_1B_r1,PFSK_1B_r2),PFSK_1A_r2)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’block_546.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(intersect(PFSK_1B_r2,PFSK_1A_r2),PFSK_1B_r1)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’block_1722.txt’,sep=’,’)” >> draw_venn.R
echo “venn.diagram(x = list(PFSK_1A_r2,PFSK_1B_r1,PFSK_1B_r2),category.names=c(‘PFSK-1A_r2’, ‘PFSK-1B_r1’ , ‘PFSK-1B_r2’), filename = ‘PFSK_venn.tiff’, output=TRUE)” >> draw_venn.R

#https://www.oreilly.com/library/view/the-r-book/9780470510247/ch002-sec073.html

echo “library(VennDiagram)” > draw_venn.R
cat HEK293_LT+sT_r2/geneNames_.txt >> draw_venn.R
cat HEK293_LT+sT_r3/geneNames_.txt >> draw_venn.R
echo “venn.diagram(x = list(HEK293_r2,HEK293_r3),category.names=c(‘HEK293_r2’, ‘HEK293_r3’), filename = ‘HEK293_venn.tiff’, output=TRUE)” >> draw_venn.R
echo “y<-intersect(HEK293_r2,HEK293_r3)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’HEK293_492.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(HEK293_r2,HEK293_r3)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’HEK293_2403.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(HEK293_r3,HEK293_r2)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’HEK293_655.txt’,sep=’,’)” >> draw_venn.R

echo “library(VennDiagram)” > draw_venn.R
cat PFSK-1A_LT+sT_r2/geneNames_.txt >> draw_venn.R
cat PFSK-1B_LT+sT_r1/geneNames_.txt >> draw_venn.R
cat PFSK-1B_LT+sT_r2/geneNames_.txt >> draw_venn.R
cat hTERT_LT+sT_r1/geneNames_.txt >> draw_venn.R
cat hTERT_LT+sT_r2/geneNames_.txt >> draw_venn.R
cat HEK293_LT+sT_r2/geneNames_.txt >> draw_venn.R
cat HEK293_LT+sT_r3/geneNames_.txt >> draw_venn.R
echo “PFSK<-union(union(PFSK_1A_r2,PFSK_1B_r1),PFSK_1B_r2)" >> draw_venn.R
echo “hTERT<-union(hTERT_r1,hTERT_r2)" >> draw_venn.R
echo “HEK293<-union(HEK293_r2,HEK293_r3)" >> draw_venn.R
echo “venn.diagram(x = list(PFSK,hTERT,HEK293),category.names=c(‘PFSK’, ‘hTERT’, ‘HEK293’), filename = ‘PFSK+hTERT+HEK293_venn.tiff’, output=TRUE)” >> draw_venn.R
#1084
echo “y<-intersect(intersect(PFSK,hTERT),HEK293)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’PFSK+hTERT+HEK293_1084.txt’,sep=’,’)” >> draw_venn.R
#12154,437,300
echo “y<-setdiff(PFSK,union(hTERT,HEK293))" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’PFSK+hTERT+HEK293_12154.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(hTERT,union(PFSK,HEK293))" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’PFSK+hTERT+HEK293_437.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(HEK293,union(PFSK,hTERT))" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’PFSK+hTERT+HEK293_300.txt’,sep=’,’)” >> draw_venn.R
#1969,42,2124
echo “y<-setdiff(intersect(PFSK,hTERT),HEK293)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’PFSK+hTERT+HEK293_1969.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(intersect(hTERT,HEK293),PFSK)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’PFSK+hTERT+HEK293_42.txt’,sep=’,’)” >> draw_venn.R
echo “y<-setdiff(intersect(HEK293,PFSK),hTERT)" >> draw_venn.R
echo “write.table(y[!duplicated(y)],’PFSK+hTERT+HEK293_2124.txt’,sep=’,’)” >> draw_venn.R

~/Tools/csv2xls-0.4/csv_to_xls.py PFSK-1A_LT+sT_r1/annotatedPeaks.txt PFSK-1A_LT+sT_r2/annotatedPeaks.txt PFSK-1B_LT+sT_r1/annotatedPeaks.txt PFSK-1B_LT+sT_r2/annotatedPeaks.txt hTERT_LT+sT_r1/annotatedPeaks.txt hTERT_LT+sT_r2/annotatedPeaks.txt HEK293_LT+sT_r1/annotatedPeaks.txt HEK293_LT+sT_r2/annotatedPeaks.txt HEK293_LT+sT_r3/annotatedPeaks.txt -d$’\t’ -o annotatedPeaks.xls

~/Tools/csv2xls-0.4/csv_to_xls.py PFSK_638.txt PFSK_4396.txt PFSK_6828.txt PFSK_546.txt PFSK_1722.txt PFSK_922.txt PFSK_2279.txt -d’,’ -o PFSK_venn_members.xls
~/Tools/csv2xls-0.4/csv_to_xls.py hTERT_2583.txt hTERT_438.txt hTERT_511.txt -d’,’ -o hTERT_venn_members.xls
~/Tools/csv2xls-0.4/csv_to_xls.py HEK293_655.txt HEK293_492.txt HEK293_2403.txt -d’,’ -o HEK293_venn_members.xls
~/Tools/csv2xls-0.4/csv_to_xls.py HEK293_655.txt HEK293_492.txt HEK293_2403.txt -d’,’ -o HEK293_venn_members.xls

~/Tools/csv2xls-0.4/csv_to_xls.py PFSK+hTERT+HEK293_42.txt PFSK+hTERT+HEK293_12154.txt PFSK+hTERT+HEK293_300.txt PFSK+hTERT+HEK293_1969.txt PFSK+hTERT+HEK293_437.txt PFSK+hTERT+HEK293_2124.txt PFSK+hTERT+HEK293_1084.txt -d’,’ -o PFSK+hTERT+HEK293_venn_members.xls

hTERT_LT+sT_hTERT_LT+sT_r1_peaks.txt

cp ./homer/hTERT_LT+sT_r2/peaks.bed beds/hTERT_LT+sT_r2_peaks.bed
cp ./homer/PFSK-1A_LT+sT_r2/peaks.bed beds/PFSK-1A_LT+sT_r2_peaks.bed
cp ./homer/PFSK-1B_LT+sT_r2/peaks.bed beds/PFSK-1B_LT+sT_r2_peaks.bed
cp ./homer/hTERT_LT+sT_r1/peaks.bed beds/hTERT_LT+sT_r1_peaks.bed
cp ./homer/PFSK-1A_LT+sT_r1/peaks.bed beds/PFSK-1A_LT+sT_r1_peaks.bed
cp ./homer/PFSK-1B_LT+sT_r1/peaks.bed beds/PFSK-1B_LT+sT_r1_peaks.bed
cp ./homer/HEK293_LT+sT_r1/peaks.bed beds/HEK293_LT+sT_r1_peaks.bed
cp ./homer/HEK293_LT+sT_r3/peaks.bed beds/HEK293_LT+sT_r3_peaks.bed
cp ./homer/HEK293_LT+sT_r2/peaks.bed beds/HEK293_LT+sT_r2_peaks.bed

for sample in PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r2 PFSK-1B_LT+sT_r1 PFSK-1B_LT+sT_r2 hTERT_LT+sT_r1 hTERT_LT+sT_r2 HEK293_LT+sT_r1 HEK293_LT+sT_r2 HEK293_LT+sT_r3; do
# delete the headers in *_noheader
grep -v “^#” ${sample}/peaks.txt > ${sample}/peaks.noh
awk ‘BEGIN {OFS=”\t”} {print $2,$3,$4,”homer_peak_”NR,$11}’ ${sample}/peaks.noh > ${sample}/peaks.bed;
#bedops -n -1 ${sample}/peaks.b /ref/Homo_sapiens/UCSC/hg19/blacklists/hg19-blacklist.bed > ${sample}/peaks.bed;
rm ${sample}/*.noh ${sample}/*.b
annotatePeaks.pl ${sample}/peaks.txt hg19 > ${sample}/annotatedPeaks.txt
done
for sample in PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r2 PFSK-1B_LT+sT_r1 PFSK-1B_LT+sT_r2 hTERT_LT+sT_r1 hTERT_LT+sT_r2 HEK293_LT+sT_r1 HEK293_LT+sT_r2 HEK293_LT+sT_r3; do
cut -d$’\t’ -f16-16 ${sample}/annotatedPeaks.txt > ${sample}/geneNames.txt
#mv ${sample}.bed ../K27_additional_diffreps_bed_bw
done

library(VennDiagram)

# Generate 3 sets of 200 words
set1 <- paste(rep("word_" , 200) , sample(c(1:1000) , 200 , replace=F) , sep="") set2 <- paste(rep("word_" , 200) , sample(c(1:1000) , 200 , replace=F) , sep="") set3 <- paste(rep("word_" , 200) , sample(c(1:1000) , 200 , replace=F) , sep="") # Chart venn.diagram( x = list(set1, set2, set3), category.names = c("Set 1" , "Set 2 " , "Set 3"), filename = '#14_venn_diagramm.png', output=TRUE ) #http://homer.ucsd.edu/homer/ngs/mergePeaks.html mergePeaks -d 2000 PFSK-1A_LT+sT_r2/peaks.txt PFSK-1B_LT+sT_r1/peaks.txt PFSK-1B_LT+sT_r2/peaks.txt -prefix PFSK -venn PFSK_venn.txt -matrix PFSK mergePeaks -d 2000 hTERT_LT+sT_r1/peaks.txt hTERT_LT+sT_r2/peaks.txt -prefix hTERT -venn hTERT_venn.txt -matrix hTERT mergePeaks -d 2000 HEK293_LT+sT_r1/peaks.txt HEK293_LT+sT_r2/peaks.txt HEK293_LT+sT_r3/peaks.txt -prefix HEK293 -venn HEK293_venn.txt -matrix HEK293 mergePeaks -d 2000 PFSK-1A_LT+sT_r2/peaks.txt PFSK-1B_LT+sT_r1/peaks.txt PFSK-1B_LT+sT_r2/peaks.txt hTERT_LT+sT_r2/peaks.txt HEK293_LT+sT_r2/peaks.txt -prefix all -venn all_venn.txt -matrix all mergePeaks -d 200 hTERT_hTERT_LT+sT_r1_peaks.txt_hTERT_LT+sT_r2_peaks.txt PFSK_PFSK-1A_LT+sT_r2_peaks.txt_PFSK-1B_LT+sT_r1_peaks.txt_PFSK-1B_LT+sT_r2_peaks.txt HEK293_HEK293_LT+sT_r2_peaks.txt_HEK293_LT+sT_r3_peaks.txt -venn hTERT_PFSK_HEK293_venn.txt -matrix hTERT_PFSK_HEK293 getDifferentialPeaksReplicates.pl -t HEK293_LT+sT_r1 HEK293_LT+sT_r2 HEK293_LT+sT_r3 -i HEK293_LT+sT_r1_Input HEK293_LT+sT_r2_Input HEK293_LT+sT_r3_Input -genome hg19 -use peaks.txt > outputPeaks_HEK293_LT+sT.txt
getDifferentialPeaksReplicates.pl -t hTERT_LT+sT_r1 hTERT_LT+sT_r2 -i hTERT_LT+sT_r1_Input hTERT_LT+sT_r2_Input -genome hg19 -use peaks.txt > outputPeaks_hTERT_LT+sT.txt
getDifferentialPeaksReplicates.pl -t PFSK-1B_LT+sT_r1 PFSK-1B_LT+sT_r2 -i PFSK-1B_LT+sT_r1_Input PFSK-1B_LT+sT_r2_Input -genome hg19 -use peaks.txt > outputPeaks_PFSK-1B_LT+sT.txt
getDifferentialPeaksReplicates.pl -t PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r2 -b PFSK-1A_LT+sT_r1_IgG PFSK-1A_LT+sT_r2_IgG -genome hg19 -use peaks.txt > outputPeaks_PFSK-1A_LT+sT.txt
getDifferentialPeaksReplicates.pl -t PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r2 -b PFSK-1A_LT+sT_r1_IgG PFSK-1A_LT+sT_r2_IgG -genome hg19 -use peaks.txt -balanced > outputPeaks_PFSK-1A_LT+sT_balanced.txt
#getDifferentialPeaksReplicates.pl -t Oct4-r1/ Oct4-r2/ -b Sox2-r1/ Sox2-r2/ -i Input-r1/ Input-r2/ -genome hg19 -use peaks.txt > outputPeaks.txt
#annotatePeaks.pl tss hg19 > tss.txt

#-use peaks.txt -style (findPeaks style to use for finding peaks), Note that in the method not using 1000nt as size!
getDifferentialPeaksReplicates.pl -t HEK293_LT+sT_r1 HEK293_LT+sT_r2 HEK293_LT+sT_r3 -i HEK293_LT+sT_r1_Input HEK293_LT+sT_r2_Input HEK293_LT+sT_r3_Input -genome hg19 > outPeaks_HEK293_LT+sT.txt
getDifferentialPeaksReplicates.pl -t hTERT_LT+sT_r1 hTERT_LT+sT_r2 -i hTERT_LT+sT_r1_Input hTERT_LT+sT_r2_Input -genome hg19 > outPeaks_hTERT_LT+sT.txt
getDifferentialPeaksReplicates.pl -t PFSK-1B_LT+sT_r1 PFSK-1B_LT+sT_r2 -i PFSK-1B_LT+sT_r1_Input PFSK-1B_LT+sT_r2_Input -genome hg19 > outPeaks_PFSK-1B_LT+sT.txt
getDifferentialPeaksReplicates.pl -t PFSK-1A_LT+sT_r1 PFSK-1A_LT+sT_r2 -b PFSK-1A_LT+sT_r1_IgG PFSK-1A_LT+sT_r2_IgG -genome hg19 -all > outPeaks_PFSK-1A_LT+sT.txt

#Differential Peaks: 28461 of 33474 (85.02% passed)

#PeakID chr start end strand Normalized Tag Count focus ratio findPeaks Score Total Tags (normalized to Control Experiment) Control Tags Fold Change vs Control p-value vs Control Clonal Fold Change
chr8-63 chr8 14682096 14683096 + 12.2 0.556 53.000000 35.6 8.0 4.46 1.69e-12 0.97
chr11-32 chr11 16593837 16594837 + 11.5 0.596 51.000000 33.6 8.0 4.20 3.19e-11 0.98

HEK293_LT+sT_r1/peaks.txt HEK293_LT+sT_r2/peaks.txt HEK293_LT+sT_r3/peaks.txt Total Name
X 834 HEK293_LT+sT_r3/peaks.txt
X 2798 HEK293_LT+sT_r2/peaks.txt
X X 320 HEK293_LT+sT_r2/peaks.txt|HEK293_LT+sT_r3/peaks.txt
X 192 HEK293_LT+sT_r1/peaks.txt
X X 20 HEK293_LT+sT_r1/peaks.txt|HEK293_LT+sT_r3/peaks.txt
X X 109 HEK293_LT+sT_r1/peaks.txt|HEK293_LT+sT_r2/peaks.txt
X X X 42 HEK293_LT+sT_r1/peaks.txt|HEK293_LT+sT_r2/peaks.txt|HEK293_LT+sT_r3/peaks.txt

ChIP-seq

# —————————-
# —— Diffreps-files ——

./V_8_2_3_p600_d8_D2_H3K4me3.dedup.sorted.bam
./V_8_2_3_p600_d8_D2_input.dedup.sorted.bam
./V_8_2_4_p600_d8_D1_H3K4me3.dedup.sorted.bam
./V_8_2_4_p600_d8_D1_input.dedup.sorted.bam

./V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bam
./V_8_3_1_p600_601_d12_D1_input.dedup.sorted.bam
./V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bam
./V_8_3_2_p600_601_d9_D2_input.dedup.sorted.bam

./V_8_0_untreated_D1_H3K4me3.dedup.sorted.bam
./V_8_0_untreated_D1_input.dedup.sorted.bam
./V_8_0_untreated_D2_H3K4me3.dedup.sorted.bam
./V_8_0_untreated_D2_input.dedup.sorted.bam

./V_8_1_5_p601_d8_D2_H3K4me3.dedup.sorted.bam
./V_8_1_5_p601_d8_D2_input.dedup.sorted.bam
./V_8_1_5_p604_d8_D2_H3K4me3.dedup.sorted.bam
./V_8_1_5_p604_d8_D2_input.dedup.sorted.bam
./V_8_1_6_p601_d8_D1_H3K4me3.dedup.sorted.bam
./V_8_1_6_p601_d8_D1_input.dedup.sorted.bam
./V_8_1_6_p604_d8_D1_H3K4me3.dedup.sorted.bam
./V_8_1_6_p604_d8_D1_input.dedup.sorted.bam

./V_8_2_3_p605_d8_D2_H3K4me3.dedup.sorted.bam
./V_8_2_3_p605_d8_D2_input.dedup.sorted.bam
./V_8_2_4_p605_d8_D1_H3K4me3.dedup.sorted.bam
./V_8_2_4_p605_d8_D1_input.dedup.sorted.bam

./V_8_3_1_p604_605_d12_D1_H3K4me3.dedup.sorted.bam
./V_8_3_1_p604_605_d12_D1_input.dedup.sorted.bam

./V_8_3_2_p604_605_d9_D2_H3K4me3.dedup.sorted.bam
./V_8_3_2_p604_605_d9_D2_input.dedup.sorted.bam
./V_8_4_1_p602_d8_D2_H3K4me3.dedup.sorted.bam
./V_8_4_1_p602_d8_D2_input.dedup.sorted.bam
./V_8_4_2_p602_d8_D1_H3K4me3.dedup.sorted.bam
./V_8_4_2_p602_d8_D1_input.dedup.sorted.bam

——————————–
ln -s ./V_8_4_2_p602_d8_D1_H3K27me3.dedup.sorted.bed p602_d8_D1_H3K27me3.dedup.sorted.bed
ln -s ./V_8_4_1_p602_d8_D2_H3K27me3.dedup.sorted.bed p602_d8_D2_H3K27me3.dedup.sorted.bed
#ln -s ./V_8_4_2_p602_d8_D1_input.dedup.sorted.bed p602_d8_D1_input.dedup.sorted.bed
#ln -s ./V_8_4_1_p602_d8_D2_input.dedup.sorted.bed p602_d8_D2_input.dedup.sorted.bed

ln -s ./V_8_2_4_p605_d8_D1_H3K27me3.dedup.sorted.bed p605_d8_D1_H3K27me3.dedup.sorted.bed
ln -s ./V_8_2_3_p605_d8_D2_H3K27me3.dedup.sorted.bed p605_d8_D2_H3K27me3.dedup.sorted.bed
#ln -s ./V_8_2_4_p605_d8_D1_input.dedup.sorted.bed p605_d8_D1_input.dedup.sorted.bed
#ln -s ./V_8_2_3_p605_d8_D2_input.dedup.sorted.bed p605_d8_D2_input.dedup.sorted.bed

ln -s ./V_8_1_6_p604_d8_D1_H3K27me3.dedup.sorted.bed p604_d8_D1_H3K27me3.dedup.sorted.bed
ln -s ./V_8_1_5_p604_d8_D2_H3K27me3.dedup.sorted.bed p604_d8_D2_H3K27me3.dedup.sorted.bed
#ln -s ./V_8_1_6_p604_d8_D1_input.dedup.sorted.bed p604_d8_D1_input.dedup.sorted.bed
#ln -s ./V_8_1_5_p604_d8_D2_input.dedup.sorted.bed p604_d8_D2_input.dedup.sorted.bed

ln -s ./V_8_3_1_p604_605_d12_D1_H3K27me3.dedup.sorted.bed p604_605_d12_D1_H3K27me3.dedup.sorted.bed
ln -s ./V_8_3_2_p604_605_d9_D2_H3K27me3.dedup.sorted.bed p604_605_d9_D2_H3K27me3.dedup.sorted.bed
#ln -s ./V_8_3_1_p604_605_d12_D1_input.dedup.sorted.bed p604_605_d12_D1_input.dedup.sorted.bed
#ln -s ./V_8_3_2_p604_605_d9_D2_input.dedup.sorted.bed p604_605_d9_D2_input.dedup.sorted.bed

for a diffreps results (for example p602_D1_d8 vs p600_D1_d8)
we need four files,
– p602_D1_d8_H3K4me3
– p602_D1_d8_input <-- untreated D1 input - p600_D1_d8_H3K4me3 <-- p600+601_d9_H3K4me3 - p600_D1_d8_input <-- untreated D1 input #diffReps.pl -tr C1.bed C2.bed C3.bed -co S1.bed S2.bed S3.bed -gn mm9 -re diff.nb.txt -me nb diffreps_parameters=" --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001;" #diffreps_parameters=" --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001;" for histoneType in H3K4me3; do #p602_d8 echo "diffReps.pl --treatment ../picard/p602_d8_D1_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report LT_d8_D1.diff.gt.txt ${diffreps_parameters}" echo "diffReps.pl --treatment ../picard/p602_d8_D2_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LT_d8_D2.diff.gt.txt ${diffreps_parameters}" echo "diffReps.pl --treatment ../picard/p602_d8_D1_${histoneType}.dedup.sorted.bed ../picard/p602_d8_D2_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_${histoneType}.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LT_d8.diff.gt.txt ${diffreps_parameters}" #p605_d8 echo "diffReps.pl --treatment ../picard/p605_d8_D1_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report LTtr_d8_D1.diff.gt.txt ${diffreps_parameters}" echo "diffReps.pl --treatment ../picard/p605_d8_D2_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LTtr_d8_D2.diff.gt.txt ${diffreps_parameters}" echo "diffReps.pl --treatment ../picard/p605_d8_D1_${histoneType}.dedup.sorted.bed ../picard/p605_d8_D2_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_${histoneType}.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LTtr_d8.diff.gt.txt ${diffreps_parameters}" #p604_d8 echo "diffReps.pl --treatment ../picard/p604_d8_D1_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report sT_d8_D1.diff.gt.txt ${diffreps_parameters}" echo "diffReps.pl --treatment ../picard/p604_d8_D2_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_d8_D2.diff.gt.txt ${diffreps_parameters}" echo "diffReps.pl --treatment ../picard/p604_d8_D1_${histoneType}.dedup.sorted.bed ../picard/p604_d8_D2_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_${histoneType}.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_d8.diff.gt.txt ${diffreps_parameters}" #p604_605_d8 echo "diffReps.pl --treatment ../picard/p604_605_d12_D1_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report sT_LTtr_d8_D1.diff.gt.txt ${diffreps_parameters}" echo "diffReps.pl --treatment ../picard/p604_605_d9_D2_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_LTtr_d8_D2.diff.gt.txt ${diffreps_parameters}" echo "diffReps.pl --treatment ../picard/p604_605_d12_D1_${histoneType}.dedup.sorted.bed ../picard/p604_605_d9_D2_${histoneType}.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_${histoneType}.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_${histoneType}.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_LTtr_d8.diff.gt.txt ${diffreps_parameters}" done # ---- #p602_d8 diffReps.pl --treatment ../picard/p602_d8_D1_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report LT_d8_D1.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p602_d8_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LT_d8_D2.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p602_d8_D1_H3K4me3.dedup.sorted.bed ../picard/p602_d8_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LT_d8.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; #p605_d8 diffReps.pl --treatment ../picard/p605_d8_D1_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report LTtr_d8_D1.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p605_d8_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LTtr_d8_D2.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p605_d8_D1_H3K4me3.dedup.sorted.bed ../picard/p605_d8_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LTtr_d8.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; #p604_d8 diffReps.pl --treatment ../picard/p604_d8_D1_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report sT_d8_D1.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p604_d8_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_d8_D2.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p604_d8_D1_H3K4me3.dedup.sorted.bed ../picard/p604_d8_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_d8.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; #p604_605_d8 diffReps.pl --treatment ../picard/p604_605_d12_D1_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report sT_LTtr_d8_D1.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p604_605_d9_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_LTtr_d8_D2.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p604_605_d12_D1_H3K4me3.dedup.sorted.bed ../picard/p604_605_d9_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_LTtr_d8.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; #-- #p600_601_d8 diffReps.pl --treatment ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_0_untreated_D1_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report p600_601_d12_D1.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_0_untreated_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report p600_601_d9_D2.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_0_untreated_D1_H3K4me3.dedup.sorted.bed ../picard/V_8_0_untreated_D2_H3K4me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report p600_601_d9or12.diff.gt.txt --nsd sharp --meth gt --window 1000 -frag 200 --nproc 10 --pval 0.0001; #600+601 vs untreated # Treatment files: V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed # Control files: V_8_0_untreated_D1_input.dedup.sorted.bed V_8_0_untreated_D2_input.dedup.sorted.bed # Treatment background: ../picard/V_8_0_untreated_D1_H3K4me3.dedup.sorted.bed ../picard/V_8_0_untreated_D2_H3K4me3.dedup.sorted.bed # Control background: V_8_0_untreated_D1_input.dedup.sorted.bed V_8_0_untreated_D2_input.dedup.sorted.bed --btr --control --bco # ---- #p602_d8 #diffReps.pl --treatment ../picard/p602_d8_D1_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report LT_d8_D1.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p602_d8_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LT_d8_D2.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p602_d8_D1_H3K27me3.dedup.sorted.bed ../picard/p602_d8_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LT_d8.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; #p605_d8 #diffReps.pl --treatment ../picard/p605_d8_D1_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report LTtr_d8_D1.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p605_d8_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LTtr_d8_D2.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p605_d8_D1_H3K27me3.dedup.sorted.bed ../picard/p605_d8_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report LTtr_d8.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; #p604_d8 #diffReps.pl --treatment ../picard/p604_d8_D1_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report sT_d8_D1.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p604_d8_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_d8_D2.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p604_d8_D1_H3K27me3.dedup.sorted.bed ../picard/p604_d8_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_d8.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; #p604_605_d8 #diffReps.pl --treatment ../picard/p604_605_d12_D1_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report sT_LTtr_d8_D1.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p604_605_d9_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_LTtr_d8_D2.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/p604_605_d12_D1_H3K27me3.dedup.sorted.bed ../picard/p604_605_d9_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report sT_LTtr_d8.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; #-- #p600_601_d8 diffReps.pl --treatment ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --control ../picard/V_8_0_untreated_D1_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed --gname hg19 --report p600_601_d12_D1.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_0_untreated_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report p600_601_d9_D2.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; diffReps.pl --treatment ../picard/V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed ../picard/V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed --btr ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --control ../picard/V_8_0_untreated_D1_H3K27me3.dedup.sorted.bed ../picard/V_8_0_untreated_D2_H3K27me3.dedup.sorted.bed --bco ../picard/V_8_0_untreated_D1_input.dedup.sorted.bed ../picard/V_8_0_untreated_D2_input.dedup.sorted.bed --gname hg19 --report p600_601_d9or12.diff.gt.txt --nsd broad --meth gt --window 10000 -frag 200 --nproc 10 --pval 0.0001; # ----------------------- # ------ BED-files ------ # ~/Tools/diffreps/bin/diffReps.pl --treatment ../picard/${sample}_h3k27me3.dedup.sorted.bed --control ../picard/${sample}_input.dedup.sorted.bed --nsd broad --gname hg19 --report ${sample}.diff.gt.txt --meth gt --window 10000 --frag 200 --nproc 10 --pval 0.0001; \ # grep -v "#" ${sample}.diff.gt.txt > diff.gt.txt; \
# grep -v “Start” diff.gt.txt > diff.gt.txt_; \
# grep “Up” diff.gt.txt > diff.up.gt.txt; \

for diffreps_res in p605_d3_vs_p600_d3.diff.gt.txt p604_d3_vs_p601_d3_D2.diff.gt.txt p604_d3_vs_p601_d3_D1.diff.gt.txt p604_d8_vs_p601_d8.diff.gt.txt p604_d8_vs_p601_d8_D2.diff.gt.txt p604_d8_vs_p601_d8_D1.diff.gt.txt p604_d3_vs_p601_d3.diff.gt.txt p605_d8_vs_p600_d8_D2.diff.gt.txt p605_d3_vs_p600_d3_D2.diff.gt.txt p605_d8_vs_p600_d8_D1.diff.gt.txt p605_d8_vs_p600_d8.diff.gt.txt p605_d3_vs_p600_d3_D1.diff.gt.txt; do
for diffreps_res in p600_601_d12_D1.diff.gt.txt p600_601_d9_D2.diff.gt.txt p600_601_d9or12.diff.gt.txt; do
# delete the headers in *_noheader
grep -v “^#” ${diffreps_res} > ${diffreps_res}_noh
grep -v “^Chrom” ${diffreps_res}_noh > ${diffreps_res}_noheader
awk ‘BEGIN {OFS=”\t”} {print $1,$2,$3,”diffreps_peak_”NR,$12}’ ${diffreps_res}_noheader > peaks.bed_;
bedops -n -1 peaks.bed_ /ref/Homo_sapiens/UCSC/hg19/blacklists/hg19-blacklist.bed > ${diffreps_res}.bed;
#mv ${diffreps_res}.bed ../K27_additional_diffreps_bed_bw
done

# —————————————————-
# —- using ChIPseqSpikeInFree for NORMALIZATION —-

ln -s V_8_4_2_p602_d8_D1_H3K27me3.dedup.sorted.bam p602_d8_D1_H3K27me3.dedup.sorted.bam
ln -s V_8_4_1_p602_d8_D2_H3K27me3.dedup.sorted.bam p602_d8_D2_H3K27me3.dedup.sorted.bam
ln -s V_8_2_4_p605_d8_D1_H3K27me3.dedup.sorted.bam p605_d8_D1_H3K27me3.dedup.sorted.bam
ln -s V_8_2_3_p605_d8_D2_H3K27me3.dedup.sorted.bam p605_d8_D2_H3K27me3.dedup.sorted.bam
ln -s V_8_1_6_p604_d8_D1_H3K27me3.dedup.sorted.bam p604_d8_D1_H3K27me3.dedup.sorted.bam
ln -s V_8_1_5_p604_d8_D2_H3K27me3.dedup.sorted.bam p604_d8_D2_H3K27me3.dedup.sorted.bam
ln -s V_8_3_1_p604_605_d12_D1_H3K27me3.dedup.sorted.bam p604_605_d12_D1_H3K27me3.dedup.sorted.bam
ln -s V_8_3_2_p604_605_d9_D2_H3K27me3.dedup.sorted.bam p604_605_d9_D2_H3K27me3.dedup.sorted.bam
ln -s V_8_0_untreated_D1_input.dedup.sorted.bam untreated_D1_input.dedup.sorted.bam
ln -s V_8_0_untreated_D2_input.dedup.sorted.bam untreated_D2_input.dedup.sorted.bam

#if (!requireNamespace(“BiocManager”, quietly = TRUE))
# install.packages(“BiocManager”)
#BiocManager::install(“Rsamtools”)
#BiocManager::install(“GenomicRanges”)
#BiocManager::install(“GenomicAlignments”)

#install.packages(“devtools”)
library(devtools)
#install_github(“stjude/ChIPseqSpikeInFree”)
packageVersion(‘ChIPseqSpikeInFree’)

metaFile <- "/home/jhuang/DATA/Data_Denise_ChIPSeq_Protocol2/Data_H3K4me3/sample_meta.txt" setwd("/home/jhuang/DATA/Data_Denise_ChIPSeq_Protocol2/Data_H3K4me3/results_H3K4me3/picard") bams <- c("p602_d8_D1_H3K4me3.dedup.sorted.bam","p602_d8_D2_H3K4me3.dedup.sorted.bam","p605_d8_D1_H3K4me3.dedup.sorted.bam","p605_d8_D2_H3K4me3.dedup.sorted.bam","p604_d8_D1_H3K4me3.dedup.sorted.bam","p604_d8_D2_H3K4me3.dedup.sorted.bam","p604_605_d12_D1_H3K4me3.dedup.sorted.bam","p604_605_d9_D2_H3K4me3.dedup.sorted.bam","p600_601_d12_D1_H3K4me3.dedup.sorted.bam","p600_601_d9_D2_H3K4me3.dedup.sorted.bam", "","","","" "untreated_D1_input.dedup.sorted.bam","untreated_D2_input.dedup.sorted.bam") metaFile <- "/home/jhuang/DATA/Data_Denise_ChIPSeq_Protocol2/Data_H3K27me3/sample_meta__.txt" setwd("/home/jhuang/DATA/Data_Denise_ChIPSeq_Protocol2/Data_H3K27me3/results_H3K27me3/picard") #bams <- c("p602_d8_D1_H3K27me3.dedup.sorted.bam","p602_d8_D2_H3K27me3.dedup.sorted.bam","p605_d8_D1_H3K27me3.dedup.sorted.bam","p605_d8_D2_H3K27me3.dedup.sorted.bam","p604_d8_D1_H3K27me3.dedup.sorted.bam","p604_d8_D2_H3K27me3.dedup.sorted.bam","p604_605_d12_D1_H3K27me3.dedup.sorted.bam","p604_605_d9_D2_H3K27me3.dedup.sorted.bam","untreated_D1_input.dedup.sorted.bam","untreated_D2_input.dedup.sorted.bam") #bams <- c("V_8_1_6_p601_d8_D1_H3K4me3.dedup.sorted.bam","V_8_0_untreated_D2_H3K4me3.dedup.sorted.bam","V_8_3_2_p600_601_d9_D2_input.dedup.sorted.bam","V_8_2_4_p600_d8_D1_input.dedup.sorted.bam","V_8_1_5_p604_d8_D2_H3K4me3.dedup.sorted.bam","V_8_1_6_p604_d8_D1_H3K4me3.dedup.sorted.bam","V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bam","V_8_1_5_p601_d8_D2_input.dedup.sorted.bam","V_8_2_4_p605_d8_D1_H3K4me3.dedup.sorted.bam","V_8_1_5_p601_d8_D2_H3K4me3.dedup.sorted.bam","V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bam","V_8_0_untreated_D1_H3K4me3.dedup.sorted.bam","V_8_3_2_p604_605_d9_D2_H3K4me3.dedup.sorted.bam","V_8_2_3_p605_d8_D2_H3K4me3.dedup.sorted.bam","V_8_0_untreated_D1_input.dedup.sorted.bam","V_8_3_1_p604_605_d12_D1_input.dedup.sorted.bam","V_8_4_1_p602_d8_D2_H3K4me3.dedup.sorted.bam","V_8_0_untreated_D2_input.dedup.sorted.bam","V_8_2_4_p605_d8_D1_input.dedup.sorted.bam","V_8_4_2_p602_d8_D1_H3K4me3.dedup.sorted.bam","V_8_1_6_p604_d8_D1_input.dedup.sorted.bam","V_8_2_4_p600_d8_D1_H3K4me3.dedup.sorted.bam","V_8_3_1_p600_601_d12_D1_input.dedup.sorted.bam","V_8_1_5_p604_d8_D2_input.dedup.sorted.bam","V_8_1_6_p601_d8_D1_input.dedup.sorted.bam","V_8_2_3_p600_d8_D2_H3K4me3.dedup.sorted.bam","V_8_2_3_p605_d8_D2_input.dedup.sorted.bam","V_8_3_2_p604_605_d9_D2_input.dedup.sorted.bam","V_8_4_2_p602_d8_D1_input.dedup.sorted.bam","V_8_2_3_p600_d8_D2_input.dedup.sorted.bam","V_8_3_1_p604_605_d12_D1_H3K4me3.dedup.sorted.bam","V_8_4_1_p602_d8_D2_input.dedup.sorted.bam") bams <- c("V_8_0_untreated_D1_H3K27me3.dedup.sorted.bam","V_8_0_untreated_D1_input.dedup.sorted.bam","V_8_0_untreated_D2_H3K27me3.dedup.sorted.bam","V_8_0_untreated_D2_input.dedup.sorted.bam","V_8_1_5_p601_d3_D2_H3K27me3.dedup.sorted.bam","V_8_1_5_p601_d3_D2_input.dedup.sorted.bam","V_8_1_5_p601_d8_D2_H3K27me3.dedup.sorted.bam","V_8_1_5_p601_d8_D2_input.dedup.sorted.bam","V_8_1_5_p604_d3_D2_H3K27me3.dedup.sorted.bam","V_8_1_5_p604_d3_D2_input.dedup.sorted.bam","V_8_1_5_p604_d8_D2_H3K27me3.dedup.sorted.bam","V_8_1_5_p604_d8_D2_input.dedup.sorted.bam","V_8_1_6_p601_d3_D1_H3K27me3.dedup.sorted.bam","V_8_1_6_p601_d3_D1_input.dedup.sorted.bam","V_8_1_6_p601_d8_D1_H3K27me3.dedup.sorted.bam","V_8_1_6_p601_d8_D1_input.dedup.sorted.bam","V_8_1_6_p604_d3_D1_H3K27me3.dedup.sorted.bam","V_8_1_6_p604_d3_D1_input.dedup.sorted.bam","V_8_1_6_p604_d8_D1_H3K27me3.dedup.sorted.bam","V_8_1_6_p604_d8_D1_input.dedup.sorted.bam","V_8_2_3_p600_d3_D2_H3K27me3.dedup.sorted.bam","V_8_2_3_p600_d3_D2_input.dedup.sorted.bam","V_8_2_3_p600_d8_D2_H3K27me3.dedup.sorted.bam","V_8_2_3_p600_d8_D2_input.dedup.sorted.bam","V_8_2_3_p605_d3_D2_H3K27me3.dedup.sorted.bam","V_8_2_3_p605_d3_D2_input.dedup.sorted.bam","V_8_2_3_p605_d8_D2_H3K27me3.dedup.sorted.bam","V_8_2_3_p605_d8_D2_input.dedup.sorted.bam","V_8_2_4_p600_d3_D1_H3K27me3.dedup.sorted.bam","V_8_2_4_p600_d3_D1_input.dedup.sorted.bam","V_8_2_4_p600_d8_D1_H3K27me3.dedup.sorted.bam","V_8_2_4_p600_d8_D1_input.dedup.sorted.bam","V_8_2_4_p605_d3_D1_H3K27me3.dedup.sorted.bam","V_8_2_4_p605_d3_D1_input.dedup.sorted.bam","V_8_2_4_p605_d8_D1_H3K27me3.dedup.sorted.bam","V_8_2_4_p605_d8_D1_input.dedup.sorted.bam","V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bam","V_8_3_1_p600_601_d12_D1_input.dedup.sorted.bam","V_8_3_1_p604_605_d12_D1_H3K27me3.dedup.sorted.bam","V_8_3_1_p604_605_d12_D1_input.dedup.sorted.bam","V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bam","V_8_3_2_p600_601_d9_D2_input.dedup.sorted.bam","V_8_3_2_p604_605_d9_D2_H3K27me3.dedup.sorted.bam","V_8_3_2_p604_605_d9_D2_input.dedup.sorted.bam","V_8_4_1_p602_d8_D2_H3K27me3.dedup.sorted.bam","V_8_4_1_p602_d8_D2_input.dedup.sorted.bam","V_8_4_2_p602_d8_D1_H3K27me3.dedup.sorted.bam","V_8_4_2_p602_d8_D1_input.dedup.sorted.bam") library("ChIPseqSpikeInFree") ChIPseqSpikeInFree(bamFiles = bams, chromFile = "hg19", metaFile = metaFile, prefix = "k27") #4. Run ChIPseqSpikeInFree pipeline with custom settings for ChIP-seq with unideal enrichment or many very broad enriched regions like H3K9me3 #ChIPseqSpikeInFree(bamFiles = bams, chromFile = "hg19", metaFile = metaFile, prefix = "k27", cutoff_QC = 1, maxLastTurn=0.97) Reporting summary INPUT.p600_601_d9_D2 , ave.SF = 153.6 INPUT.p600_d8_D1 , ave.SF = NA INPUT.p601_d8_D2 , ave.SF = NA INPUT.untreated_D1 , ave.SF = NA INPUT.p604_605_d12_D1 , ave.SF = NA INPUT.untreated_D2 , ave.SF = NA INPUT.p605_d8_D1 , ave.SF = NA INPUT.p604_d8_D1 , ave.SF = NA INPUT.p600_601_d12_D1 , ave.SF = NA INPUT.p604_d8_D2 , ave.SF = NA INPUT.p601_d8_D1 , ave.SF = NA INPUT.p605_d8_D2 , ave.SF = NA INPUT.p604_605_d9_D2 , ave.SF = 252.65 INPUT.p602_d8_D1 , ave.SF = 203.92 INPUT.p600_d8_D2 , ave.SF = NA INPUT.p602_d8_D2 , ave.SF = 263.75 H3K4me3.p602_d8_D1 , ave.SF = 2.87 H3K4me3.p602_d8_D2 , ave.SF = 1 H3K4me3.p605_d8_D1 , ave.SF = 2.74 H3K4me3.p605_d8_D2 , ave.SF = 2.8 H3K4me3.p604_d8_D1 , ave.SF = 2.67 H3K4me3.p604_d8_D2 , ave.SF = 3.56 H3K4me3.p604_605_d12_D1 , ave.SF = 2.44 H3K4me3.p604_605_d9_D2 , ave.SF = 2.77 H3K4me3.p600_601_d9_D2 , ave.SF = 2.46 H3K4me3.p601_d8_D2 , ave.SF = 3.74 H3K4me3.p600_601_d12_D1 , ave.SF = 2.51 H3K4me3.untreated_D1 , ave.SF = 3.74 H3K4me3.p601_d8_D1 , ave.SF = 3.77 H3K4me3.untreated_D2 , ave.SF = 3.13 H3K4me3.p600_d8_D1 , ave.SF = 3.77 H3K4me3.p600_d8_D2 , ave.SF = 3.65 [1] "/home/jhuang/DATA/Data_Denise_ChIPSeq_Protocol2/Data_H3K27me3/results_H3K27me3/picard" > metaFile <- "/home/jhuang/DATA/Data_Denise_ChIPSeq_Protocol2/Data_H3K27me3/sample_meta__part1.txt" > ChIPseqSpikeInFree(bamFiles = bams, chromFile = “hg19”, metaFile = metaFile, prefix = “k27”)
Reporting summary
H3K27me3.untreated_D1 , ave.SF = 2.27
INPUT.untreated_D1 , ave.SF = NA
H3K27me3.untreated_D2 , ave.SF = 2.42
INPUT.untreated_D2 , ave.SF = NA
H3K27me3.p601_d3_D2 , ave.SF = 2.99
INPUT.p601_d3_D2 , ave.SF = NA
H3K27me3.p601_d8_D2 , ave.SF = 3.21
INPUT.p601_d8_D2 , ave.SF = NA
H3K27me3.p604_d3_D2 , ave.SF = 2.3
INPUT.p604_d3_D2 , ave.SF = NA
H3K27me3.p604_d8_D2 , ave.SF = 2
INPUT.p604_d8_D2 , ave.SF = NA
H3K27me3.p601_d3_D1 , ave.SF = 2.43
INPUT.p601_d3_D1 , ave.SF = NA
H3K27me3.p601_d8_D1 , ave.SF = 3.64
INPUT.p601_d8_D1 , ave.SF = NA
H3K27me3.p604_d3_D1 , ave.SF = 1.95
INPUT.p604_d3_D1 , ave.SF = NA
H3K27me3.p604_d8_D1 , ave.SF = 1.83
INPUT.p604_d8_D1 , ave.SF = NA
H3K27me3.p600_d3_D2 , ave.SF = 2.24
INPUT.p600_d3_D2 , ave.SF = NA
H3K27me3.p600_d8_D2 , ave.SF = 1.88
INPUT.p600_d8_D2 , ave.SF = NA
H3K27me3.p605_d3_D2 , ave.SF = 1.5
INPUT.p605_d3_D2 , ave.SF = NA
H3K27me3.p605_d8_D2 , ave.SF = 1.28
INPUT.p605_d8_D2 , ave.SF = NA
H3K27me3.p600_d3_D1 , ave.SF = 2.43
INPUT.p600_d3_D1 , ave.SF = NA
H3K27me3.p600_d8_D1 , ave.SF = 3.64
INPUT.p600_d8_D1 , ave.SF = NA
H3K27me3.p605_d3_D1 , ave.SF = 1.99
INPUT.p605_d3_D1 , ave.SF = NA
H3K27me3.p605_d8_D1 , ave.SF = 1.7
INPUT.p605_d8_D1 , ave.SF = NA
H3K27me3.p600_601_d12 , ave.SF = 1.88
INPUT.p600_601_d12 , ave.SF = NA
H3K27me3.p604_605_d12_D1 , ave.SF = 1.55
INPUT.p604_605_d12_D1 , ave.SF = NA
H3K27me3.p600_601_d9_D2 , ave.SF = 1.52
INPUT.p600_601_d9_D2 , ave.SF = 176.16
H3K27me3.p604_605_d9_D2 , ave.SF = 1.42
INPUT.p604_605_d9_D2 , ave.SF = 289.77
H3K27me3.p602_d8_D2 , ave.SF = 1
INPUT.p602_d8_D2 , ave.SF = 302.51
H3K27me3.p602_d8_D1 , ave.SF = 1.36
INPUT.p602_d8_D1 , ave.SF = 233.88
[–done–]

#TODO
scale=0.005
for sample_id in V_8_0_untreated_D1_H3K27me3 V_8_0_untreated_D1_input V_8_0_untreated_D2_H3K27me3 V_8_0_untreated_D2_input V_8_1_5_p601_d3_D2_H3K27me3 V_8_1_5_p601_d3_D2_input V_8_1_5_p601_d8_D2_H3K27me3 V_8_1_5_p601_d8_D2_input V_8_1_5_p604_d3_D2_H3K27me3 V_8_1_5_p604_d3_D2_input V_8_1_5_p604_d8_D2_H3K27me3 V_8_1_5_p604_d8_D2_input V_8_1_6_p601_d3_D1_H3K27me3 V_8_1_6_p601_d3_D1_input V_8_1_6_p601_d8_D1_H3K27me3 V_8_1_6_p601_d8_D1_input V_8_1_6_p604_d3_D1_H3K27me3 V_8_1_6_p604_d3_D1_input V_8_1_6_p604_d8_D1_H3K27me3 V_8_1_6_p604_d8_D1_input V_8_2_3_p600_d3_D2_H3K27me3 V_8_2_3_p600_d3_D2_input V_8_2_3_p600_d8_D2_H3K27me3 V_8_2_3_p600_d8_D2_input V_8_2_3_p605_d3_D2_H3K27me3 V_8_2_3_p605_d3_D2_input V_8_2_3_p605_d8_D2_H3K27me3 V_8_2_3_p605_d8_D2_input V_8_2_4_p600_d3_D1_H3K27me3 V_8_2_4_p600_d3_D1_input V_8_2_4_p600_d8_D1_H3K27me3 V_8_2_4_p600_d8_D1_input V_8_2_4_p605_d3_D1_H3K27me3 V_8_2_4_p605_d3_D1_input V_8_2_4_p605_d8_D1_H3K27me3 V_8_2_4_p605_d8_D1_input V_8_3_1_p600_601_d12_D1_H3K27me3 V_8_3_1_p600_601_d12_D1_input V_8_3_1_p604_605_d12_D1_H3K27me3 V_8_3_1_p604_605_d12_D1_input V_8_3_2_p600_601_d9_D2_H3K27me3 V_8_3_2_p600_601_d9_D2_input V_8_3_2_p604_605_d9_D2_H3K27me3 V_8_3_2_p604_605_d9_D2_input V_8_4_1_p602_d8_D2_H3K27me3 V_8_4_1_p602_d8_D2_input V_8_4_2_p602_d8_D1_H3K27me3 V_8_4_2_p602_d8_D1_input; do
#echo “genomeCoverageBed -bg -scale $scale -i ${sample_id}.dedup.sorted.bed -g hg19.chromSizes > ${sample_id}.bedGraph”
#echo “bedGraphToBigWig ${sample_id}.bedGraph hg19.chromSizes ${sample_id}.bw”
cat ${sample_id}.dedup.sorted.bed | wc -l
done

15000000/(19887819*2,46)=0,306597771

>>> 15000000/(9117917*2.27)
>>> 15000000/(15193982*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined

>>> 15000000/(14086858*2.42)
>>> 15000000/(19058379*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined

>>> 15000000/(14179266*2.99)
>>> 15000000/(17897602*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined

#2#
>>> 15000000/(4078851*3.21)
>>> 15000000/(20283412*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(12246632*2.3)
>>> 15000000/(17484127*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(5375629*2.0)
>>> 15000000/(18196405*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined

#3#
>>> 15000000/(4028212*2.43)
>>> 15000000/(9777309*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(1996024*3.64)
>>> 15000000/(13109916*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(5439084*1.95)
>>> 15000000/(12455769*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined

#4#
>>> 15000000/(4223238*1.83)
>>> 15000000/(14306705*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(16258718*2.24)
>>> 15000000/(25624031*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(17673314*1.88)
>>> 15000000/(21605671*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined

#5#
>>> 15000000/(20156038*1.5)
>>> 15000000/(27551196*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(19584378*1.28)
>>> 15000000/(24649041*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(4028212*2.43)
>>> 15000000/(25624031*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined

#6#
>>> 15000000/(1996024*3.64)
>>> 15000000/(21605671*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(20538589*1.99)
>>> 15000000/(27551196*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(29653756*1.7)
>>> 15000000/(24649041*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined

#7#
>>> 15000000/(13123083*1.88)
>>> 15000000/(24558038*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(11348597*1.55)
>>> 15000000/(23594386*NA)
Traceback (most recent call last):
File ““, line 1, in
NameError: name ‘NA’ is not defined
>>> 15000000/(29754706*1.52)
>>> 15000000/(4622019*176.16)
0.01842265550189603

#8#
>>> 15000000/(30340171*1.42)
>>> 15000000/(2867648*289.77)
0.018051446022723225
>>> 15000000/(21552600*1.0)
>>> 15000000/(1945885*302.51)
0.025482049392126956
>>> 15000000/(22630562*1.36)
>>> 15000000/(3175236*233.88)
0.020198641637665635

genomeCoverageBed -bg -scale 0.7247192001658386 -i V_8_0_untreated_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_0_untreated_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_0_untreated_D1_H3K27me3.bedGraph hg19.chromSizes V_8_0_untreated_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_0_untreated_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_0_untreated_D1_input.bedGraph
bedGraphToBigWig V_8_0_untreated_D1_input.bedGraph hg19.chromSizes V_8_0_untreated_D1_input.bw
genomeCoverageBed -bg -scale 0.4400091991725917 -i V_8_0_untreated_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_0_untreated_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_0_untreated_D2_H3K27me3.bedGraph hg19.chromSizes V_8_0_untreated_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_0_untreated_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_0_untreated_D2_input.bedGraph
bedGraphToBigWig V_8_0_untreated_D2_input.bedGraph hg19.chromSizes V_8_0_untreated_D2_input.bw
genomeCoverageBed -bg -scale 0.3538069183571812 -i V_8_1_5_p601_d3_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_5_p601_d3_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_1_5_p601_d3_D2_H3K27me3.bedGraph hg19.chromSizes V_8_1_5_p601_d3_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_1_5_p601_d3_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_1_5_p601_d3_D2_input.bedGraph
bedGraphToBigWig V_8_1_5_p601_d3_D2_input.bedGraph hg19.chromSizes V_8_1_5_p601_d3_D2_input.bw
#2#
genomeCoverageBed -bg -scale 1.145640572862721 -i V_8_1_5_p601_d8_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_5_p601_d8_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_1_5_p601_d8_D2_H3K27me3.bedGraph hg19.chromSizes V_8_1_5_p601_d8_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_1_5_p601_d8_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_1_5_p601_d8_D2_input.bedGraph
bedGraphToBigWig V_8_1_5_p601_d8_D2_input.bedGraph hg19.chromSizes V_8_1_5_p601_d8_D2_input.bw
genomeCoverageBed -bg -scale 0.5325332818390218 -i V_8_1_5_p604_d3_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_5_p604_d3_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_1_5_p604_d3_D2_H3K27me3.bedGraph hg19.chromSizes V_8_1_5_p604_d3_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_1_5_p604_d3_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_1_5_p604_d3_D2_input.bedGraph
bedGraphToBigWig V_8_1_5_p604_d3_D2_input.bedGraph hg19.chromSizes V_8_1_5_p604_d3_D2_input.bw
genomeCoverageBed -bg -scale 1.3951855680516643 -i V_8_1_5_p604_d8_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_5_p604_d8_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_1_5_p604_d8_D2_H3K27me3.bedGraph hg19.chromSizes V_8_1_5_p604_d8_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_1_5_p604_d8_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_1_5_p604_d8_D2_input.bedGraph
bedGraphToBigWig V_8_1_5_p604_d8_D2_input.bedGraph hg19.chromSizes V_8_1_5_p604_d8_D2_input.bw

#3#
genomeCoverageBed -bg -scale 1.532401846321107 -i V_8_1_6_p601_d3_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_6_p601_d3_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_1_6_p601_d3_D1_H3K27me3.bedGraph hg19.chromSizes V_8_1_6_p601_d3_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_1_6_p601_d3_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_1_6_p601_d3_D1_input.bedGraph
bedGraphToBigWig V_8_1_6_p601_d3_D1_input.bedGraph hg19.chromSizes V_8_1_6_p601_d3_D1_input.bw
genomeCoverageBed -bg -scale 2.0645438736603974 -i V_8_1_6_p601_d8_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_6_p601_d8_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_1_6_p601_d8_D1_H3K27me3.bedGraph hg19.chromSizes V_8_1_6_p601_d8_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_1_6_p601_d8_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_1_6_p601_d8_D1_input.bedGraph
bedGraphToBigWig V_8_1_6_p601_d8_D1_input.bedGraph hg19.chromSizes V_8_1_6_p601_d8_D1_input.bw
genomeCoverageBed -bg -scale 1.4142652866379142 -i V_8_1_6_p604_d3_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_6_p604_d3_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_1_6_p604_d3_D1_H3K27me3.bedGraph hg19.chromSizes V_8_1_6_p604_d3_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_1_6_p604_d3_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_1_6_p604_d3_D1_input.bedGraph
bedGraphToBigWig V_8_1_6_p604_d3_D1_input.bedGraph hg19.chromSizes V_8_1_6_p604_d3_D1_input.bw

#4#
genomeCoverageBed -bg -scale 1.940861801176114 -i V_8_1_6_p604_d8_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_6_p604_d8_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_1_6_p604_d8_D1_H3K27me3.bedGraph hg19.chromSizes V_8_1_6_p604_d8_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_1_6_p604_d8_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_1_6_p604_d8_D1_input.bedGraph
bedGraphToBigWig V_8_1_6_p604_d8_D1_input.bedGraph hg19.chromSizes V_8_1_6_p604_d8_D1_input.bw
genomeCoverageBed -bg -scale 0.411866948638175 -i V_8_2_3_p600_d3_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_3_p600_d3_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_2_3_p600_d3_D2_H3K27me3.bedGraph hg19.chromSizes V_8_2_3_p600_d3_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_2_3_p600_d3_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_2_3_p600_d3_D2_input.bedGraph
bedGraphToBigWig V_8_2_3_p600_d3_D2_input.bedGraph hg19.chromSizes V_8_2_3_p600_d3_D2_input.bw
genomeCoverageBed -bg -scale 0.4514559863676569 -i V_8_2_3_p600_d8_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_3_p600_d8_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_2_3_p600_d8_D2_H3K27me3.bedGraph hg19.chromSizes V_8_2_3_p600_d8_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_2_3_p600_d8_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_2_3_p600_d8_D2_input.bedGraph
bedGraphToBigWig V_8_2_3_p600_d8_D2_input.bedGraph hg19.chromSizes V_8_2_3_p600_d8_D2_input.bw

#5#
genomeCoverageBed -bg -scale 0.49612924921058393 -i V_8_2_3_p605_d3_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_3_p605_d3_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_2_3_p605_d3_D2_H3K27me3.bedGraph hg19.chromSizes V_8_2_3_p605_d3_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_2_3_p605_d3_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_2_3_p605_d3_D2_input.bedGraph
bedGraphToBigWig V_8_2_3_p605_d3_D2_input.bedGraph hg19.chromSizes V_8_2_3_p605_d3_D2_input.bw
genomeCoverageBed -bg -scale 0.5983723353378902 -i V_8_2_3_p605_d8_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_3_p605_d8_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_2_3_p605_d8_D2_H3K27me3.bedGraph hg19.chromSizes V_8_2_3_p605_d8_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_2_3_p605_d8_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_2_3_p605_d8_D2_input.bedGraph
bedGraphToBigWig V_8_2_3_p605_d8_D2_input.bedGraph hg19.chromSizes V_8_2_3_p605_d8_D2_input.bw
genomeCoverageBed -bg -scale 1.532401846321107 -i V_8_2_4_p600_d3_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_4_p600_d3_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_2_4_p600_d3_D1_H3K27me3.bedGraph hg19.chromSizes V_8_2_4_p600_d3_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_2_4_p600_d3_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_2_4_p600_d3_D1_input.bedGraph
bedGraphToBigWig V_8_2_4_p600_d3_D1_input.bedGraph hg19.chromSizes V_8_2_4_p600_d3_D1_input.bw

#6#
genomeCoverageBed -bg -scale 2.0645438736603974 -i V_8_2_4_p600_d8_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_4_p600_d8_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_2_4_p600_d8_D1_H3K27me3.bedGraph hg19.chromSizes V_8_2_4_p600_d8_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_2_4_p600_d8_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_2_4_p600_d8_D1_input.bedGraph
bedGraphToBigWig V_8_2_4_p600_d8_D1_input.bedGraph hg19.chromSizes V_8_2_4_p600_d8_D1_input.bw
genomeCoverageBed -bg -scale 0.3670012795042082 -i V_8_2_4_p605_d3_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_4_p605_d3_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_2_4_p605_d3_D1_H3K27me3.bedGraph hg19.chromSizes V_8_2_4_p605_d3_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_2_4_p605_d3_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_2_4_p605_d3_D1_input.bedGraph
bedGraphToBigWig V_8_2_4_p605_d3_D1_input.bedGraph hg19.chromSizes V_8_2_4_p605_d3_D1_input.bw
genomeCoverageBed -bg -scale 0.29755183160489707 -i V_8_2_4_p605_d8_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_4_p605_d8_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_2_4_p605_d8_D1_H3K27me3.bedGraph hg19.chromSizes V_8_2_4_p605_d8_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_2_4_p605_d8_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_2_4_p605_d8_D1_input.bedGraph
bedGraphToBigWig V_8_2_4_p605_d8_D1_input.bedGraph hg19.chromSizes V_8_2_4_p605_d8_D1_input.bw

#7#
genomeCoverageBed -bg -scale 0.6079915370690957 -i V_8_3_1_p600_601_d12_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_3_1_p600_601_d12_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_3_1_p600_601_d12_D1_H3K27me3.bedGraph hg19.chromSizes V_8_3_1_p600_601_d12_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_3_1_p600_601_d12_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_3_1_p600_601_d12_D1_input.bedGraph
bedGraphToBigWig V_8_3_1_p600_601_d12_D1_input.bedGraph hg19.chromSizes V_8_3_1_p600_601_d12_D1_input.bw
genomeCoverageBed -bg -scale 0.8527414758704278 -i V_8_3_1_p604_605_d12_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_3_1_p604_605_d12_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_3_1_p604_605_d12_D1_H3K27me3.bedGraph hg19.chromSizes V_8_3_1_p604_605_d12_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_3_1_p604_605_d12_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_3_1_p604_605_d12_D1_input.bedGraph
bedGraphToBigWig V_8_3_1_p604_605_d12_D1_input.bedGraph hg19.chromSizes V_8_3_1_p604_605_d12_D1_input.bw
genomeCoverageBed -bg -scale 0.3316591685574571 -i V_8_3_2_p600_601_d9_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_3_2_p600_601_d9_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_3_2_p600_601_d9_D2_H3K27me3.bedGraph hg19.chromSizes V_8_3_2_p600_601_d9_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_3_2_p600_601_d9_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_3_2_p600_601_d9_D2_input.bedGraph
bedGraphToBigWig V_8_3_2_p600_601_d9_D2_input.bedGraph hg19.chromSizes V_8_3_2_p600_601_d9_D2_input.bw

#8#
genomeCoverageBed -bg -scale 0.3481648235169848 -i V_8_3_2_p604_605_d9_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_3_2_p604_605_d9_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_3_2_p604_605_d9_D2_H3K27me3.bedGraph hg19.chromSizes V_8_3_2_p604_605_d9_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_3_2_p604_605_d9_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_3_2_p604_605_d9_D2_input.bedGraph
bedGraphToBigWig V_8_3_2_p604_605_d9_D2_input.bedGraph hg19.chromSizes V_8_3_2_p604_605_d9_D2_input.bw
genomeCoverageBed -bg -scale 0.6959717157094736 -i V_8_4_1_p602_d8_D2_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_4_1_p602_d8_D2_H3K27me3.bedGraph
bedGraphToBigWig V_8_4_1_p602_d8_D2_H3K27me3.bedGraph hg19.chromSizes V_8_4_1_p602_d8_D2_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_4_1_p602_d8_D2_input.dedup.sorted.bed -g hg19.chromSizes > V_8_4_1_p602_d8_D2_input.bedGraph
bedGraphToBigWig V_8_4_1_p602_d8_D2_input.bedGraph hg19.chromSizes V_8_4_1_p602_d8_D2_input.bw
genomeCoverageBed -bg -scale 0.4873680010556468 -i V_8_4_2_p602_d8_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_4_2_p602_d8_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_4_2_p602_d8_D1_H3K27me3.bedGraph hg19.chromSizes V_8_4_2_p602_d8_D1_H3K27me3.bw
genomeCoverageBed -bg -scale 0.02 -i V_8_4_2_p602_d8_D1_input.dedup.sorted.bed -g hg19.chromSizes > V_8_4_2_p602_d8_D1_input.bedGraph
bedGraphToBigWig V_8_4_2_p602_d8_D1_input.bedGraph hg19.chromSizes V_8_4_2_p602_d8_D1_input.bw

#./V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed
#15000000/(19887819*2,46)=0,306597771
scale=0.306597771
genomeCoverageBed -bg -scale $scale -i V_8_3_2_p600_601_d9_D2_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > V_8_3_2_p600_601_d9_D2_H3K4me3.bedGraph
bedGraphToBigWig V_8_3_2_p600_601_d9_D2_H3K4me3.bedGraph hg19.chromSizes V_8_3_2_p600_601_d9_D2_H3K4me3.bw

#./V_8_1_5_p601_d8_D2_H3K4me3.dedup.sorted.bed
#15000000/(11143929*3,74)=0,359899564
scale=0.359899564
genomeCoverageBed -bg -scale $scale -i V_8_1_5_p601_d8_D2_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_5_p601_d8_D2_H3K4me3.bedGraph
bedGraphToBigWig V_8_1_5_p601_d8_D2_H3K4me3.bedGraph hg19.chromSizes V_8_1_5_p601_d8_D2_H3K4me3.bw

#./V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed
#15000000/(11175216*2,51)=0,534763321
scale=0.534763321
genomeCoverageBed -bg -scale $scale -i V_8_3_1_p600_601_d12_D1_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > V_8_3_1_p600_601_d12_D1_H3K4me3.bedGraph
bedGraphToBigWig V_8_3_1_p600_601_d12_D1_H3K4me3.bedGraph hg19.chromSizes V_8_3_1_p600_601_d12_D1_H3K4me3.bw

#./V_8_0_untreated_D1_H3K4me3.dedup.sorted.bed
#15000000/(9830800*3,74)=0,407972412
scale=0.407972412
genomeCoverageBed -bg -scale $scale -i V_8_0_untreated_D1_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > V_8_0_untreated_D1_H3K4me3.bedGraph
bedGraphToBigWig V_8_0_untreated_D1_H3K4me3.bedGraph hg19.chromSizes V_8_0_untreated_D1_H3K4me3.bw

#./V_8_1_6_p601_d8_D1_H3K4me3.dedup.sorted.bed
#15000000/(6208322*3,77)=0,64087846
scale=0.64087846
genomeCoverageBed -bg -scale $scale -i V_8_1_6_p601_d8_D1_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > V_8_1_6_p601_d8_D1_H3K4me3.bedGraph
bedGraphToBigWig V_8_1_6_p601_d8_D1_H3K4me3.bedGraph hg19.chromSizes V_8_1_6_p601_d8_D1_H3K4me3.bw

#./V_8_0_untreated_D2_H3K4me3.dedup.sorted.bed
#15000000/(11028176*3,13)=0,434553481
scale=0.434553481
genomeCoverageBed -bg -scale $scale -i V_8_0_untreated_D2_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > V_8_0_untreated_D2_H3K4me3.bedGraph
bedGraphToBigWig V_8_0_untreated_D2_H3K4me3.bedGraph hg19.chromSizes V_8_0_untreated_D2_H3K4me3.bw

#lrwxrwxrwx 1 jhuang jhuang 95 Sep 16 14:21 V_8_1_6_p601_d8_D1_H3K4me3.fastq.gz -> ../Raw_Data_orig/200226_NB501882_0182_AHV3YWBGXC/nf194/8_1_6_601_d8_H3K4me3_S13_R1_001.fastq.gz
#lrwxrwxrwx 1 jhuang jhuang 95 Sep 16 14:24 V_8_2_4_p600_d8_D1_H3K4me3.fastq.gz -> ../Raw_Data_orig/200226_NB501882_0182_AHV3YWBGXC/nf194/8_1_6_601_d8_H3K4me3_S13_R1_001.fastq.gz
#-rw-rw-r– 1 jhuang jhuang 421M Sep 19 14:08 V_8_1_6_p601_d8_D1_H3K4me3.dedup.sorted.bed
#-rw-rw-r– 1 jhuang jhuang 421M Sep 19 17:55 V_8_2_4_p600_d8_D1_H3K4me3.dedup.sorted.bed
#./V_8_2_4_p600_d8_D1_H3K4me3.dedup.sorted.bed
#15000000/(6208322*3,77)=0,64087846
scale=0.64087846
genomeCoverageBed -bg -scale $scale -i V_8_2_4_p600_d8_D1_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_4_p600_d8_D1_H3K4me3.bedGraph
bedGraphToBigWig V_8_2_4_p600_d8_D1_H3K4me3.bedGraph hg19.chromSizes V_8_2_4_p600_d8_D1_H3K4me3.bw

#./V_8_2_3_p600_d8_D2_H3K4me3.dedup.sorted.bed
#15000000/(15228808*3,65)=0,269856251
scale=0.269856251
genomeCoverageBed -bg -scale $scale -i V_8_2_3_p600_d8_D2_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > V_8_2_3_p600_d8_D2_H3K4me3.bedGraph
bedGraphToBigWig V_8_2_3_p600_d8_D2_H3K4me3.bedGraph hg19.chromSizes V_8_2_3_p600_d8_D2_H3K4me3.bw

#Due to the input files not having the signicant signal, they are normalized with an estimated scale factor (=0.02).

#cat p602_d8_D2_H3K4me3.dedup.sorted.bed|wc -l
#15000000/(1945885*263,75)=0,029226824
#scale=0.029226824
#genomeCoverageBed -bg -scale $scale -i p602_d8_D2_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p602_d8_D2_H3K4me3.bedGraph
#bedGraphToBigWig p602_d8_D2_H3K4me3.bedGraph hg19.chromSizes p602_d8_D2_H3K4me3.bw
#15000000/(4622019*153,6)=0,021128483

scale=0.02
for sample_id in V_8_3_2_p600_601_d9_D2_input V_8_2_4_p600_d8_D1_input V_8_1_5_p601_d8_D2_input V_8_0_untreated_D1_input V_8_3_1_p604_605_d12_D1_input V_8_0_untreated_D2_input V_8_2_4_p605_d8_D1_input V_8_1_6_p604_d8_D1_input V_8_3_1_p600_601_d12_D1_input V_8_1_5_p604_d8_D2_input V_8_1_6_p601_d8_D1_input V_8_2_3_p605_d8_D2_input V_8_3_2_p604_605_d9_D2_input V_8_4_2_p602_d8_D1_input V_8_2_3_p600_d8_D2_input V_8_4_1_p602_d8_D2_input; do
genomeCoverageBed -bg -scale $scale -i ${sample_id}.dedup.sorted.bed -g hg19.chromSizes > ${sample_id}.bedGraph
bedGraphToBigWig ${sample_id}.bedGraph hg19.chromSizes ${sample_id}.bw
done

Reporting summary
H3K4me3.LT , ave.SF = 2.353
H3K4me3.LTtr , ave.SF = 2.77
H3K4me3.sT , ave.SF = 2.86
H3K4me3.sT_LTtr , ave.SF = 2.605
INPUT.untreated , ave.SF = NA

H3K4me3.LT_D1 , ave.SF = 2.87 p602_d8_D1
H3K4me3.LT_D2 , ave.SF = 1 p602_d8_D2
H3K4me3.LTtr_D1 , ave.SF = 2.74 p605_d8_D1
H3K4me3.LTtr_D2 , ave.SF = 2.8 p605_d8_D2

H3K4me3.sT_D1 , ave.SF = 2.67 p604_d8_D1
H3K4me3.sT_D2 , ave.SF = 3.56 p604_d8_D2
H3K4me3.sT_LTtr_D1 , ave.SF = 2.44 p604_605_d12_D1
H3K4me3.sT_LTtr_D2 , ave.SF = 2.77 p604_605_d9_D2
INPUT.untreated_D1 , ave.SF = NA
INPUT.untreated_D2 , ave.SF = NA

Reporting summary
H3K27me3.p602_d8_D1 , ave.SF = 1.36
H3K27me3.p602_d8_D2 , ave.SF = 1
H3K27me3.p605_d8_D1 , ave.SF = 1.7
H3K27me3.p605_d8_D2 , ave.SF = 1.28

H3K27me3.p604_d8_D1 , ave.SF = 1.83
H3K27me3.p604_d8_D2 , ave.SF = 2.2
H3K27me3.p604_605_d12_D1 , ave.SF = 1.55
H3K27me3.p604_605_d9_D2 , ave.SF = 1.41
INPUT.untreated_D1 , ave.SF = NA
INPUT.untreated_D2 , ave.SF = NA
[–done–]

cat p602_d8_D1.dedup.sorted.bed|wc -l
15000000/(5908897*2,67)=0,950765858
scale=0.950765858
genomeCoverageBed -bg -scale $scale -i p604_d8_D1_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p604_d8_D1_H3K4me3.bedGraph
bedGraphToBigWig p604_d8_D1_H3K4me3.bedGraph hg19.chromSizes p604_d8_D1_H3K4me3.bw

# —-
dat <- read.table("test_SF.txt", sep="\t",header=TRUE,fill=TRUE,stringsAsFactors = FALSE, quote="",check.names=F) SF <- dat$SF #The libSize vector represents the column (sample specific) sums of features, i.e. the total number of reads for a sample or depth of coverage. It is used by fitZig. #https://bedops.readthedocs.io/en/latest/content/reference/statistics/bedmap.html #15730156 (15730156 is the total number of mapped reads). libSize=`cat p602_d8_D1_H3K4me3.dedup.sorted.bed|wc -l` SF=2.87 scale=`15000000/($libSize*$SF)` 15000000/(15730156*2,87)=0,332258678 scale=0.332258678 genomeCoverageBed -bg -scale $scale -i p602_d8_D1_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p602_d8_D1_H3K4me3.bedGraph
bedGraphToBigWig p602_d8_D1_H3K4me3.bedGraph hg19.chromSizes p602_d8_D1_H3K4me3.bw
cat p602_d8_D2_H3K4me3.dedup.sorted.bed|wc -l
15000000/(28496276*1)=0,52638457
scale=0.52638457
genomeCoverageBed -bg -scale $scale -i p602_d8_D2_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p602_d8_D2_H3K4me3.bedGraph
bedGraphToBigWig p602_d8_D2_H3K4me3.bedGraph hg19.chromSizes p602_d8_D2_H3K4me3.bw
cat p605_d8_D1_H3K4me3.dedup.sorted.bed|wc -l
15000000/(20580696*2,74)=0,265999389
scale=0.265999389
genomeCoverageBed -bg -scale $scale -i p605_d8_D1_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p605_d8_D1_H3K4me3.bedGraph
bedGraphToBigWig p605_d8_D1_H3K4me3.bedGraph hg19.chromSizes p605_d8_D1_H3K4me3.bw
cat p605_d8_D2_H3K4me3.dedup.sorted.bed|wc -l
15000000/(19899357*2,8)=0,269211857
scale=0.269211857
genomeCoverageBed -bg -scale $scale -i p605_d8_D2_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p605_d8_D2_H3K4me3.bedGraph
bedGraphToBigWig p605_d8_D2_H3K4me3.bedGraph hg19.chromSizes p605_d8_D2_H3K4me3.bw

cat p604_d8_D1_H3K4me3.dedup.sorted.bed|wc -l
15000000/(5908897*2,67)=0,950765858
scale=0.950765858
genomeCoverageBed -bg -scale $scale -i p604_d8_D1_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p604_d8_D1_H3K4me3.bedGraph
bedGraphToBigWig p604_d8_D1_H3K4me3.bedGraph hg19.chromSizes p604_d8_D1_H3K4me3.bw
cat p604_d8_D2_H3K4me3.dedup.sorted.bed|wc -l
15000000/(12671796*3,56)=0,332508758
scale=0.332508758
genomeCoverageBed -bg -scale $scale -i p604_d8_D2_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p604_d8_D2_H3K4me3.bedGraph
bedGraphToBigWig p604_d8_D2_H3K4me3.bedGraph hg19.chromSizes p604_d8_D2_H3K4me3.bw
cat p604_605_d12_D1_H3K4me3.dedup.sorted.bed|wc -l
15000000/(13541815*2,44)=0,453967285
scale=0.453967285
genomeCoverageBed -bg -scale $scale -i p604_605_d12_D1_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p604_605_d12_D1_H3K4me3.bedGraph
bedGraphToBigWig p604_605_d12_D1_H3K4me3.bedGraph hg19.chromSizes p604_605_d12_D1_H3K4me3.bw
cat p604_605_d9_D2_H3K4me3.dedup.sorted.bed|wc -l
15000000/(21675907*2,77)=0,249824031
scale=0.249824031
genomeCoverageBed -bg -scale $scale -i p604_605_d9_D2_H3K4me3.dedup.sorted.bed -g hg19.chromSizes > p604_605_d9_D2_H3K4me3.bedGraph
bedGraphToBigWig p604_605_d9_D2_H3K4me3.bedGraph hg19.chromSizes p604_605_d9_D2_H3K4me3.bw

#0.25 for untreated
scale=0.25
genomeCoverageBed -bg -scale $scale -i V_8_0_untreated_D1_input.dedup.sorted.bed -g hg19.chromSizes > untreated_D1_input.bedGraph
bedGraphToBigWig untreated_D1_input.bedGraph hg19.chromSizes untreated_D1_input.bw
genomeCoverageBed -bg -scale $scale -i V_8_0_untreated_D2_input.dedup.sorted.bed -g hg19.chromSizes > untreated_D2_input.bedGraph
bedGraphToBigWig untreated_D2_input.bedGraph hg19.chromSizes untreated_D2_input.bw

ChIPseqSpikeInFree: A Spike-in Free ChIP-Seq Normalization Approach for Detecting Global Changes in Histone Modifications Background

https://github.com/stjude/ChIPseqSpikeInFree

Example:
> library(“ChIPseqSpikeInFree”)
> metaFile <- "/DATA/Data_Denise_ChIPSeq_Protocol2/Data_H3K27me3/sample_meta__part1.txt" > ChIPseqSpikeInFree(bamFiles = bams, chromFile = “hg19”, metaFile = metaFile, prefix = “k27”)
#–>ave.SF = 2.46
cat ${sample_id}.dedup.sorted.bed | wc -l #–>19887819
15000000/(19887819*2,46)=0,306597771
genomeCoverageBed -bg -scale 0.306597771 -i V_8_0_untreated_D1_H3K27me3.dedup.sorted.bed -g hg19.chromSizes > V_8_0_untreated_D1_H3K27me3.bedGraph
bedGraphToBigWig V_8_0_untreated_D1_H3K27me3.bedGraph hg19.chromSizes V_8_0_untreated_D1_H3K27me3.bw

A Spike-in Free ChIP-Seq Normalization Approach for Detecting Global Changes in Histone Modifications
Background

Traditional reads per million (RPM) normalization method is inappropriate for the evaluation of ChIP-seq data when the treatment or mutation has the global effect. Changes in global levels of histone modifications can be detected by using exogenous reference spike-in controls. However, most of the ChIP-seq studies have overlooked the normalization problem that have to be corrected with spike-in. A method that retrospectively renormalize data sets without spike-in is lacking.

We observed that some highly enriched regions were retained despite global changes by oncogenic mutations or drug treatment and that the proportion of reads within these regions was inversely associated with total histone mark levels. Therefore, we developped ChIPseqSpikeInFree, a novel ChIP-seq normalization method to effectively determine scaling factors for samples across various conditions and treatments, which does not rely on exogenous spike-in chromatin or peak detection to reveal global changes in histone modification occupancy. This method is capable of revealing the similar magnitude of global changes as the spike-in method.

In summary, ChIPseqSpikeInFree can estimate scaling factors for ChIP-seq samples without exogenous spike-in or without input. When ChIP-seq is done with spike-in protocol but high variation of Spike-In reads between samples are observed, ChIPseqSpikeInFree can help you determine a more reliable scaling factor than ChIP-Rx method. It’s not recommended to run ChIPseqSpikeInFree blindly without any biological evidences like Western Blotting to prove the global change at protein level between your control and treatment samples.

PiGx is a collection of genomics pipelines

http://bioinformatics.mdc-berlin.de/pigx/

PiGx: Pipelines in Genomics
What is PiGx?

PiGx is a collection of genomics pipelines. All pipelines are easily configured with a simple sample sheet and a descriptive settings file. The result is a set of comprehensive, interactive HTML reports with interesting findings about your samples.
Publication

Wurmus R, Uyar Bora, Osberg B, Franke V, Gosdschan A, Wreczycka K, Ronen J, Akalin A. PiGx: Reproducible genomics analysis pipelines with GNU Guix. Gigascience. 2018 Oct 2. doi: 10.1093/gigascience/giy123. PubMed PMID: 30277498.
DocumentationSample Reports

PiGx includes the following pipelines:
PiGx BSseq for raw fastq read data of bisulfite experiments
PiGx RNAseq for RNAseq samples
PiGx scRNAseq for single cell dropseq analysis
PiGx ChIPseq for reads from ChIPseq experiments
PiGx CRISPR (work in progress) for the analysis of sequence mutations in CRISPR-CAS9 targeted amplicon sequencing data

RNANR: a new set of algorithms for the exploration of RNA kinetics land-scapes at the secondary structure level

Motivation:Kinetics is key to understand many phenomena involving RNAs, such as co-transcriptional folding and riboswitches. Exact out-of-equilibrium studies induce extreme computa-tional demands, leading state-of-the-art methods to rely on approximated kinetics landscapes, ob-tained using sampling strategies that strive to generate the key landmarks of the landscape top-ology. However, such methods are impeded by a large level of redundancy within sampled sets.Such a redundancy is uninformative, and obfuscates important intermediate states, leading to anincomplete vision of RNA dynamics.

Results:We introduce RNANR, a new set of algorithms for the exploration of RNA kinetics land-scapes at the secondary structure level. RNANR considers locally optimal structures, a reduced setof RNA conformations, in order to focus its sampling on basins in the kinetic landscape. Along withan exhaustive enumeration, RNANR implements a novel non-redundant stochastic sampling, andoffers a rich array of structural parameters. Our tests on both real and random RNAs reveal thatRNANR allows to generate more unique structures in a given time than its competitors, and allowsa deeper exploration of kinetics landscapes.

Availability and implementation:RNANR is freely available at https://project.inria.fr/rnalands/rnanr.

Contact:yann.ponty@lix.polytechnique.fr

RNAlishapes: a tool for structural analysis of classes of RNAs

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1636479/

The knowledge about classes of non-coding RNAs (ncRNAs) is growing very fast and it is mainly the structure which is the common characteristic property shared by members of the same class. For correct characterization of such classes it is therefore of great importance to analyse the structural features in great detail. In this manuscript I present RNAlishapes which combines various secondary structure analysis methods, such as suboptimal folding and shape abstraction, with a comparative approach known as RNA alignment folding. RNAlishapes makes use of an extended thermodynamic model and covariance scoring, which allows to reward covariation of paired bases. Applying the algorithm to a set of bacterial trp-operon leaders using shape abstraction it was able to identify the two alternating conformations of this attenuator. Besides providing in-depth analysis methods for aligned RNAs, the tool also shows a fairly well prediction accuracy. Therefore, RNAlishapes provides the community with a powerful tool for structural analysis of classes of RNAs and is also a reasonable method for consensus structure prediction based on sequence alignments. RNAlishapes is available for online use and download at http://rna.cyanolab.de.

Binning

Binning
=======

Scripts required to calculate tetramer frequencies and create input files for ESOM.
See: Dick, G.J., A. Andersson, B.J. Baker, S.S. Simmons, B.C. Thomas, A.P. Yelton, and J.F. Banfield (2009). Community-wide analysis of microbial genome sequence signatures. Genome Biology, 10: R85
Open Access: http://genomebiology.com/2009/10/8/R85

How to ESOM?
============

These instructions are for ESOM-based for binning: see http://databionic-esom.sourceforge.net/ for software download and manual.

1. Generate input files.
————————-
* Although not necessary but we recommend adding some reference genomes based on your 16s/OTU analysis as ‘controls’. The idea is that, if the ESOM worked, your reference genome should form a bin itself. You may do this by downloading genomes in fasta format from any public database, preferably a complete single sequence genome.
* Use the `esomWrapper.pl` script to create the relevant input files for ESOM. In order to run this script, you’ll need to have all your sequence(in fasta format) files with the same extension in the same folder. For example:
`perl esomWrapper.pl -path fasta_folder -ext fa`
For more help and examples, type:
`perl esomWrapper.pl -h`

* The script will use the fasta file to produce three tab-delimited files that ESOM requires:
* Learn file = a table of tetranucleotide frequencies (.lrn)
* Names file = a list of the names of each contig (.names)
* Class file = a list of the class of each contig, which can be used to color data points, etc. ( .cls)

**NOTE:**`class number`: The esom mapping requires that you define your sequences as classes. We generally define all the sequences that belong to your query (meatgenome for example) as 0 and all the others 1, 2 and so on. think of these as your predefined bins, each sequence that has the same class number will be assigned the same color in the map.

* These files are generated using Anders Anderssons perl script `tetramer_freqs _esom.pl` which needs to be in the same folder as the `esomWrapper.pl`. To see how to use the `tetramer_freqs _esom.pl` independent of the wrapper, type:
`perl tetramer_freqs _esom.pl -h`

2. Run ESOM:
————-
* On you termial, run w/ following command from anywhere (X11 must be enabled):
`./esomana`
* Load .lrn, .names, and .cls files (File > load .lrn etc.)
* Normalize the data(optional, but recommended): under data tab, see Z-transform, RobustZT, or To\[0,1\] as described in the users manual. I find that this RobustZT makes the map look cleaner.

3. Train the data:
——————-
###Using the GUI
* Tools > Training:
* Parameters: use default parameters with the following exceptions. Note this is what seems work best for AMD datasets but the complete parameter space has not been fully optimized. David Soergel (Brenner Lab) is working on this:
* Training algorithm: K-batch
* Number of rows/columns in map: I use ~5-6 times more neurons than there are data points. E.g. for 12000 data points (window, NOT contigs) I use 200 rows x 328 columns (~65600 neurons).
* Start value for radius = 50 (increase/decrease for smaller/larger maps).
* I’ve never seen a benefit to training for more than 20 epochs for the AMD data.
* Hit ‘START’ — training will take 10 minutes to many hours depending on the size of the data set and parameters used.

###From the terminal
* At this point, you may also choose to add additional data (like coverage) to your contigs. You may do so using the `addInfo2lrn.pl` script **OR** by simply using the flag `-info` in `esomTrain.pl`.
* `esomTrain.pl` script maybe used to train the data without launching the GUI. This script will add the additional information to the lrn file (using `-info`), normalize it and train the ESOM. Type `perl esomTrain.pl -h` in your terminal to see the help document for this script.
* To view the results of the training, simply launch ESOM by following the instructions in *Step 5: Loading a previous project* to load the relevant files.
* Resume analysis from *Step 4: Analyzing the output*

4. Analyzing the output:
————————
* Best viewed (see VIEW tab) with UMatrix background, tiled display. Use Zoom, Color, Bestmatch size to get desired view. Also viewing without data points drawn (uncheck “Draw bestmatches”) helps to see the underlying data structure.
* Use CLASSES tab to rename and recolor classes.
* To select a region of the map, go to DATA tab then draw a shape with mouse (holding left click), close it with right click. Data points will be selected and displayed in DATA tab.
* To assign data points to bins, use the CLASS tab and using your pointer draw a boundary around the region of interest (e.g. using the data structure as a guide — see also “contours” box in VIEW tab which might help to delineate bins). This will assign each data point to a class (bin). The new .cls file can be saved (`File > Save .cls`) for further analysis.

5. Loading a previous project:
——————————
* On you termial, run w/ following command from anywhere (X11 must be enabled): `./esomana`
* `File > load .wts`

Questions?
———-
* [Gregory J. Dick](http://www.earth.lsa.umich.edu/geomicrobiology/Index.html “Geomicro Homepage”),
gdick \[AT\] umich \[DOT\] edu,
Assistant Professor, Michigan Geomicrobiology Lab,
University of Michigan
* [Sunit Jain](http://www.sunitjain.com “Sunit’s Homepage”),
sunitj \[AT\] umich \[DOT\] edu,
Bioinformatics Specialist, Michigan Geomicrobiology Lab,
University of Michigan.

BigWig tools

[TXT] bedGraphToBigWig.txt
[TXT] bigWigAverageOverBed.txt
[TXT] bigWigCorrelate.txt
[TXT] bigWigInfo.txt
[TXT] bigWigMerge.txt
[TXT] bigWigSummary.txt
[TXT] bigWigToBedGraph.txt
[TXT] bigWigToWig.txt
[TXT] qacToWig.txt
[TXT] wigCorrelate.txt
[TXT] wigEncode.txt
[TXT] wigToBigWig.txt

BamM is a c library, wrapped in python, that parses BAM files.

BamM is a c library, wrapped in python, that parses BAM files. The code is intended to provide a faster, more stable interface to parsing BAM files than PySam, but doesn’t implement all / any of PySam’s features.

Do you want all the links that join two contigs in a BAM?
Do you need to get coverage?
Would you like to just work out the insert size and orientation of some mapped reads?

Then BamM is for you!
$ bamm make -d -c read1.R1.fq.gz read1.R2.fq.gz …
$ bamm parse -c covs.tsv -l links.tsv -i inserts.tsv -b mapping.bam
$ bamm extract -g BIN_1.fna -b mapping.bam

BMGE (Block Mapping and Gathering with Entropy) is a program that selects regions in a multiple sequence alignment that are suited for phylogenetic inference

ftp://ftp.pasteur.fr/pub/GenSoft/projects/BMGE/
http://mobyle.pasteur.fr/cgi-bin/portal.py

Criscuolo A, Gribaldo S (2010) BMGE (Block Mapping and Gathering with Entropy): selection of phylogenetic informative regions from multiple sequence alignments. BMC Evolutionary Biology 10:210.

BMGE (Block Mapping and Gathering with Entropy) is a program that selects regions in a multiple sequence alignment that are suited for phylogenetic inference. BMGE selects characters that are biologically relevant, thanks to the use of standard similarity matrices such as PAM or BLOSUM. Moreover, BMGE provides other character- or sequence-removal operations, such stationary-based character trimming (that provides a subset of compositionally homogeneous characters) or removal of sequences containing a too large proportion of gaps. Finally, BMGE can simply be used to perform standard conversion operations among DNA-, codon-, RY- and amino acid-coding sequences.