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
a858f1c3
Commit
a858f1c3
authored
6 years ago
by
Venkat Malladi
Browse files
Options
Downloads
Patches
Plain Diff
First start at adding annotations.
parent
55c0d935
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
workflow/main.nf
+20
-0
20 additions, 0 deletions
workflow/main.nf
workflow/scripts/overlap_peaks.py
+4
-1
4 additions, 1 deletion
workflow/scripts/overlap_peaks.py
workflow/scripts/runChipseeker.R
+26
-31
26 additions, 31 deletions
workflow/scripts/runChipseeker.R
with
50 additions
and
32 deletions
workflow/main.nf
+
20
−
0
View file @
a858f1c3
...
...
@@ -34,6 +34,7 @@ readsList = Channel
pairedEnd = params.pairedEnd
designFile = params.designFile
genomeSize = params.genomeSize
genome = params.genome
chromSizes = params.chromSizes
cutoffRatio = params.cutoffRatio
...
...
@@ -377,3 +378,22 @@ process consensusPeaks {
"""
}
// Annotate Peaks
process peakAnnotation {
publishDir "$baseDir/output/${task.process}", mode: 'copy'
input:
file consensusPeaks
output:
file "*chipseeker*" into chipseeker_originalpeak_output
script:
"""
module load python/2.7.x-anaconda
module load R/3.3.2-gccmkl
Rscript $baseDir/scripts/runChipseeker.R $design_file ${params.genomepath}
"""
}
This diff is collapsed.
Click to expand it.
workflow/scripts/overlap_peaks.py
+
4
−
1
View file @
a858f1c3
...
...
@@ -182,9 +182,12 @@ def main():
design_peaks_df
=
pd
.
read_csv
(
design
,
sep
=
'
\t
'
)
design_files_df
=
pd
.
read_csv
(
files
,
sep
=
'
\t
'
)
# Make a design file for
# Make a design file for
differential binding
design_diff
=
update_design
(
design_files_df
)
# Make a design file for annotating Peaks
design_anno
=
pd
.
DataFrame
()
# Find consenus overlap peaks for each experiment
for
experiment
,
df_experiment
in
design_peaks_df
.
groupby
(
'
experiment_id
'
):
replicated_peak
=
overlap
(
experiment
,
df_experiment
)
...
...
This diff is collapsed.
Click to expand it.
workflow/scripts/runChipseeker.R
+
26
−
31
View file @
a858f1c3
args
=
commandArgs
(
trailingOnly
=
TRUE
)
#if (length(args)==0) {
# stop("At least one argument must be supplied (input file).n", call.=FALSE)
#} else if (length(args)==1) {
# # default output file
# args[3] = "out.txt"
#}
#!/bin/Rscript
library
(
ChIPseeker
)
#Parse the genome path and get genome version
path_elements
=
unlist
(
strsplit
(
args
[
2
],
"[/]"
))
genome
=
path_elements
[
length
(
path_elements
)]
if
(
genome
==
"GRCh37"
)
{
library
(
TxDb.Hsapiens.UCSC.hg19.knownGene
)
txdb
<-
TxDb.Hsapiens.UCSC.hg19.knownGene
}
if
(
genome
==
"GRCm38"
)
{
library
(
TxDb.Mmusculus.UCSC.mm10.knownGene
)
txdb
<-
TxDb.Mmusculus.UCSC.mm10.knownGene
# Create parser object
parser
<-
ArgumentParser
()
# Specify our desired options
parser
$
add_argument
(
"-d"
,
"--design"
,
help
=
"File path to design file"
,
required
=
TRUE
)
parser
$
add_argument
(
"-g"
,
"--genome"
,
help
=
"The genome assembly"
,
required
=
TRUE
)
# Parse arguments
args
<-
parser
$
parse_args
()
# Load UCSC Known Genes
if
(
args
$
genome
==
'GRCh37'
)
{
library
(
TxDb.Hsapiens.UCSC.hg19.knownGene
)
txdb
<-
TxDb.Hsapiens.UCSC.hg19.knownGene
}
else
if
(
args
$
genome
==
'GRCm38'
)
{
library
(
TxDb.Mmusculus.UCSC.mm10.knownGene
)
txdb
<-
TxDb.Mmusculus.UCSC.mm10.knownGene
}
if
(
genome
==
"GRCh38"
)
{
library
(
TxDb.Hsapiens.UCSC.hg38.knownGene
)
txdb
<-
TxDb.Hsapiens.UCSC.hg38.knownGene
else
if
(
args
$
genome
==
'GRCh38'
)
{
library
(
TxDb.Hsapiens.UCSC.hg38.knownGene
)
txdb
<-
TxDb.Hsapiens.UCSC.hg38.knownGene
}
design
<-
read.csv
(
args
[
1
])
files
<-
as.list
(
as.character
(
design
$
Peaks
))
names
(
files
)
<-
design
$
SampleID
peakAnnoList
<-
lapply
(
files
,
annotatePeak
,
TxDb
=
txdb
,
tssRegion
=
c
(
-3000
,
3000
),
verbose
=
FALSE
)
for
(
index
in
c
(
1
:
length
(
peakAnnoList
)))
...
...
@@ -38,8 +34,8 @@ for(index in c(1:length(peakAnnoList)))
filename
<-
paste
(
names
(
files
)[
index
],
".chipseeker_annotation.xls"
,
sep
=
""
)
write.table
(
as.data.frame
(
peakAnnoList
[[
index
]]),
filename
,
sep
=
"\t"
,
quote
=
F
)
#draw individual plot
pie_name
<-
paste
(
names
(
files
)[
index
],
".chipseeker_pie.pdf"
,
sep
=
""
)
vennpie_name
<-
paste
(
names
(
files
)[
index
],
".chipseeker_vennpie.pdf"
,
sep
=
""
)
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
=
""
)
pdf
(
pie_name
)
plotAnnoPie
(
peakAnnoList
[[
index
]])
...
...
@@ -53,4 +49,3 @@ for(index in c(1:length(peakAnnoList)))
}
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