Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chipseq_analysis
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Astrocyte
Workflows
BICF
chipseq_analysis
Commits
afa3bbee
Commit
afa3bbee
authored
6 years ago
by
Venkat Malladi
Browse files
Options
Downloads
Patches
Plain Diff
remove annotate peak vennpie and update test.
parent
673c0718
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
workflow/scripts/annotate_peaks.R
+13
-9
13 additions, 9 deletions
workflow/scripts/annotate_peaks.R
workflow/tests/test_annotate_peaks.py
+2
-4
2 additions, 4 deletions
workflow/tests/test_annotate_peaks.py
with
15 additions
and
13 deletions
workflow/scripts/annotate_peaks.R
+
13
−
9
View file @
afa3bbee
...
...
@@ -40,17 +40,26 @@ design <- read.csv(design_file, sep ='\t')
files
<-
as.list
(
as.character
(
design
$
Peaks
))
names
(
files
)
<-
design
$
Condition
# Granges of files
peaks
<-
lapply
(
files
,
readPeakFile
,
as
=
"GRanges"
,
header
=
FALSE
)
peakAnnoList
<-
lapply
(
peaks
,
annotatePeak
,
TxDb
=
txdb
,
annoDb
=
annodb
,
tssRegion
=
c
(
-3000
,
3000
),
verbose
=
FALSE
)
column_names
<-
c
(
"chr"
,
"start"
,
"end"
,
"width"
,
"strand_1"
,
"name"
,
"score"
,
"strand"
,
"signalValue"
,
"pValue"
,
"qValue"
,
"peak"
,
"annotation"
,
"geneChr"
,
"geneStart"
,
"geneEnd"
,
"geneLength"
,
"geneStrand"
,
"geneId"
,
"transcriptId"
,
"distanceToTSS"
,
"ENSEMBL"
,
"symbol"
,
"geneName"
)
peakAnnoList
<-
lapply
(
files
,
annotatePeak
,
TxDb
=
txdb
,
annoDb
=
annodb
,
tssRegion
=
c
(
-3000
,
3000
),
verbose
=
FALSE
)
for
(
index
in
c
(
1
:
length
(
peakAnnoList
)))
{
filename
<-
paste
(
names
(
files
)[
index
],
".chipseeker_annotation.csv"
,
sep
=
""
)
write.table
(
as.data.frame
(
peakAnnoList
[[
index
]]),
filename
,
sep
=
","
,
quote
=
F
)
filename
<-
paste
(
names
(
peaks
)[
index
],
".chipseeker_annotation.csv"
,
sep
=
""
)
df
<-
as.data.frame
(
peakAnnoList
[[
index
]])
colnames
(
df
)
<-
column_names
write.table
(
df
[
,
!
(
names
(
df
)
%in%
c
(
'strand_1'
))],
filename
,
sep
=
","
,
quote
=
F
,
row.names
=
F
)
# Draw individual plots
# Define names of Plots
pie_name
<-
paste
(
names
(
files
)[
index
],
".chipseeker_pie.pdf"
,
sep
=
""
)
vennpie_name
<-
paste
(
names
(
files
)[
index
],
".chipseeker_vennpie.pdf"
,
sep
=
""
)
upsetplot_name
<-
paste
(
names
(
files
)[
index
],
".chipseeker_upsetplot.pdf"
,
sep
=
""
)
# Pie Plots
...
...
@@ -58,11 +67,6 @@ for(index in c(1:length(peakAnnoList))) {
plotAnnoPie
(
peakAnnoList
[[
index
]])
dev.off
()
# Venn Diagrams
pdf
(
vennpie_name
)
vennpie
(
peakAnnoList
[[
index
]])
dev.off
()
# Upset Plot
pdf
(
upsetplot_name
)
upsetplot
(
peakAnnoList
[[
index
]])
...
...
This diff is collapsed.
Click to expand it.
workflow/tests/test_annotate_peaks.py
+
2
−
4
View file @
afa3bbee
...
...
@@ -13,8 +13,7 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
@pytest.mark.singleend
def
test_annotate_peaks_singleend
():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCSR238SGC.chipseeker_pie.pdf
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCSR238SGC.chipseeker_pie.pdf
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCSR238SGC.chipseeker_pie.pdf
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCSR238SGC.chipseeker_upsetplot.pdf
'
))
annotation_file
=
test_output_path
+
'
ENCSR238SGC.chipseeker_annotation.csv
'
assert
os
.
path
.
exists
(
annotation_file
)
assert
utils
.
count_lines
(
annotation_file
)
==
152839
...
...
@@ -23,8 +22,7 @@ def test_annotate_peaks_singleend():
@pytest.mark.pairedend
def
test_annotate_peaks_pairedend
():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCSR217LRF.chipseeker_pie.pdf
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCSR217LRF.chipseeker_pie.pdf
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCSR217LRF.chipseeker_pie.pdf
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCSR217LRF.chipseeker_upsetplot.pdf
'
))
annotation_file
=
test_output_path
+
'
ENCSR217LRF.chipseeker_annotation.csv
'
assert
os
.
path
.
exists
(
annotation_file
)
assert
utils
.
count_lines
(
annotation_file
)
==
25390
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment