Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Safia Saci
rosePigs
Commits
baa6c9c0
Commit
baa6c9c0
authored
Jun 07, 2021
by
Safia Saci
Browse files
Upload New File
parent
35b2313b
Changes
1
Hide whitespace changes
Inline
Side-by-side
diffBind_analysis.R
0 → 100644
View file @
baa6c9c0
# Packages -------
library
(
DiffBind
)
library
(
tidyverse
)
library
(
rtracklayer
)
# input file
samples
<-
read.csv2
(
"sampleSheetCons.csv"
)
DBdata
<-
dba
(
sampleSheet
=
samples
,
config
=
list
(
doBlacklist
=
FALSE
,
doGreylist
=
FALSE
,
RunParallel
=
FALSE
))
# applicate the greyList
greyList
<-
import.bed
(
"gl.bed"
)
DBdata
<-
dba.blacklist
(
DBdata
,
greylist
=
greyList
)
#dba count
db
<-
dba.count
(
DBdata
,
summits
=
FALSE
)
saveRDS
(
db
,
"dbCountCons.RDS"
)
#-----------------
dbaCount
<-
readRDS
(
"dbCountCons.RDS"
)
info
<-
dba.show
(
dbaCount
)
libsizes
<-
cbind
(
LibReads
=
info
$
Reads
,
FRiP
=
info
$
FRiP
,
PeakReads
=
round
(
info
$
Reads
*
info
$
FRiP
))
rownames
(
libsizes
)
<-
info
$
ID
png
(
"dbaCount.png"
)
plot
(
dbaCount
)
dev.off
()
#Normalizing the data
result
<-
dba.normalize
(
dbaCount
)
#Establishing a model design and contrast
# TODO reordonner la ligne
result
<-
dba.contrast
(
dbaCount
,
reorderMeta
=
list
(
Condition
=
"fasted"
))
#Performing the differential analysis
result
<-
dba.analyze
(
result
)
dba.show
(
result
,
bContrasts
=
TRUE
)
png
(
"diff_an_dba_cpg.png"
)
plot
(
result
,
contrast
=
1
)
dev.off
()
#Retrieving the differentially bound sites
result.DB_line
<-
dba.report
(
result
,
contrast
=
1
)
result.DB_cons
<-
dba.report
(
result
,
contrast
=
2
)
saveRDS
(
result.DB_line
,
"dba_report_Cons_line.RDS"
)
saveRDS
(
result.DB_cons
,
"dba_report_cons_cond.RDS"
)
# Plotting in DiffBind
png
(
"dba_ven_line_con3.png"
)
dba.plotVenn
(
result
,
bDB
=
TRUE
,
bGain
=
TRUE
,
bLoss
=
TRUE
)
dev.off
()
png
(
"dba_PCA_line_cons2.png"
)
dba.plotPCA
(
result
,
contrast
=
2
,
label
=
DBA_FACTOR
)
dev.off
()
png
(
"dba_plot_cobs.png"
)
dba.plotMA
(
result
)
dev.off
()
png
(
"dba_volcano_cons.png"
)
dba.plotVolcano
(
result
)
dev.off
()
png
(
"dba_boxplot_cons.png"
)
pvals
<-
dba.plotBox
(
result
)
dev.off
()
hmap
<-
colorRampPalette
(
c
(
"magenta"
,
"white"
,
"blue"
))(
n
=
13
)
png
(
"dba_heatMap_cpg.png"
)
readscores
<-
dba.plotHeatmap
(
result
,
contrast
=
1
,
correlations
=
FALSE
,
scale
=
"row"
,
colScheme
=
hmap
)
dev.off
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment