convert bam to bigwig using deepTools by feeding inverse of DESeq’s size Factor

You can read the details laid out by ATpoint about how to use a scale factor with deepTools. He specified it for ATAC-seq/ChIP-seq, but the principles are the same for RNA-seq: calculate a scaling factor with DESeq2 and supply the inverse (!) to bamCoverage –scaleFactor.

https://www.biostars.org/p/317023/

https://hbctraining.github.io/DGE_workshop/lessons/02_DGE_count_normalization.html

## get sizeFactors from created DESeq2Dataset object
dds <- estimateSizeFactors(dds)
sizeFactors(dds)
normalized_counts <- counts(dds, normalized=TRUE)
write.table(normalized_counts, file=”data/normalized_counts.txt”, sep=”\t”, quote=F, col.names=NA)

bamCoverage –bam ${sample}Aligned.sortedByCoord.out.bam -o ../bigWigs/${sample}_norm.bw –binSize 10 –scaleFactor 1/0.5695507 –effectiveGenomeSize 2864785220

bamCoverage –bam a.bam -o a.SeqDepthNorm.bw \
–binSize 10
–normalizeUsing RPGC
–effectiveGenomeSize 2150570000
–ignoreForNormalization chrX
–extendReads

Sure, you can use the DESeq2 scale factor. I don’t recall whether DESeq2 is dividing by the scale factor or multiplying by it. If it’s doing the latter then you don’t need to invert (just compare a normalized and raw count in DESeq2 to be sure).

–skipNonCoveredRegions –binSize 10 –scaleFactor 1/DESeq’s size factor”.

#https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSM3941356
BamCoverage from deepTools (version 3.0.2) was used to generate bigwig tracks with parameters “–skipNonCoveredRegions –binSize 10 –scaleFactor 1/DESeq’s size Factor”.

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