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
3cc1bd73
Commit
3cc1bd73
authored
7 years ago
by
Beibei Chen
Browse files
Options
Downloads
Patches
Plain Diff
remove unessessory files
parent
37906e07
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/main.nf
+1
-4
1 addition, 4 deletions
workflow/main.nf
workflow/scripts/process.py
+0
-77
0 additions, 77 deletions
workflow/scripts/process.py
with
1 addition
and
81 deletions
workflow/main.nf
+
1
−
4
View file @
3cc1bd73
#!/usr/bin/env nextflow
#!/usr/bin/env nextflow
params.design="$baseDir/../test_data/samplesheet.csv"
params.design="$baseDir/../test_data/samplesheet.csv"
params.bams = "$baseDir/../test_data/*.bam"
params.bams = "$baseDir/../test_data/*.bam"
// params.bais = "$baseDir/../test_data/*.bai"
params.peaks = "$baseDir/../test_data/*.broadPeak"
params.peaks = "$baseDir/../test_data/*.broadPeak"
params.genomepath="/project/shared/bicf_workflow_ref/GRCh37"
params.genomepath="/project/shared/bicf_workflow_ref/GRCh37"
toppeakcount =
200
toppeakcount =
-1
design_file = file(params.design)
design_file = file(params.design)
deeptools_design = Channel.fromPath(params.design)
deeptools_design = Channel.fromPath(params.design)
diffbind_design = Channel.fromPath(params.design)
diffbind_design = Channel.fromPath(params.design)
...
@@ -17,8 +16,6 @@
...
@@ -17,8 +16,6 @@
diffbind_bams = Channel.fromPath(params.bams)
diffbind_bams = Channel.fromPath(params.bams)
diffbind_peaks = Channel.fromPath(params.peaks)
diffbind_peaks = Channel.fromPath(params.peaks)
meme_peaks = Channel.fromPath(params.peaks)
meme_peaks = Channel.fromPath(params.peaks)
// deeptools_bamindex = Channel.fromPath(params.bais)
// diffbind_bamindex = Channel.fromPath(params.bais)
process bamindex {
process bamindex {
publishDir "$baseDir/output/", mode: 'copy'
publishDir "$baseDir/output/", mode: 'copy'
...
...
This diff is collapsed.
Click to expand it.
workflow/scripts/process.py
deleted
100644 → 0
+
0
−
77
View file @
37906e07
#!/usr/bin/python
# programmer : bbc
# usage: main function to call all the procedures for chip-seq analysis
import
sys
import
os
import
argparse
as
ap
import
logging
import
pandas
as
pd
import
glob
import
subprocess
from
multiprocessing
import
Pool
import
runDeepTools
import
runMemechip
logging
.
basicConfig
(
level
=
10
)
def
prepare_argparser
():
description
=
"
Make wig file for given bed using bam
"
epilog
=
"
For command line options of each command, type %(prog)% COMMAND -h
"
argparser
=
ap
.
ArgumentParser
(
description
=
description
,
epilog
=
epilog
)
argparser
.
add_argument
(
"
-i
"
,
"
--input
"
,
dest
=
"
infile
"
,
type
=
str
,
required
=
True
,
help
=
"
input design file
"
)
argparser
.
add_argument
(
"
-g
"
,
"
--genome
"
,
dest
=
"
genome
"
,
type
=
str
,
required
=
True
,
help
=
"
genome
"
,
default
=
"
hg19
"
)
argparser
.
add_argument
(
"
--top-peak
"
,
dest
=
"
toppeak
"
,
type
=
int
,
default
=-
1
,
help
=
"
Only use top peaks for motif call
"
)
#argparser.add_argument("-s","--strandtype",dest="stranded",type=str,default="none", choices=["none","reverse","yes"])
#argparser.add_argument("-n","--name",dest="trackName",type=str,default="UserTrack",help = "track name for bedgraph header")
return
(
argparser
)
def
memechip_wrapper
(
args
):
#print args
runMemechip
.
run
(
*
args
)
def
main
():
argparser
=
prepare_argparser
()
args
=
argparser
.
parse_args
()
#dfile = pd.read_csv(args.infile)
#for testing, add testing path to all input files
test_path
=
"
/project/BICF/BICF_Core/bchen4/chipseq_analysis/test/
"
designfile
=
pd
.
read_csv
(
args
.
infile
)
designfile
[
'
Peaks
'
]
=
designfile
[
'
Peaks
'
].
apply
(
lambda
x
:
test_path
+
x
)
designfile
[
'
bamReads
'
]
=
designfile
[
'
bamReads
'
].
apply
(
lambda
x
:
test_path
+
x
)
designfile
[
'
bamControl
'
]
=
designfile
[
'
bamControl
'
].
apply
(
lambda
x
:
test_path
+
x
)
designfile
.
to_csv
(
args
.
infile
+
"
_new
"
,
index
=
False
)
dfile
=
pd
.
read_csv
(
args
.
infile
+
"
_new
"
)
#call deeptools
runDeepTools
.
run
(
args
.
infile
+
"
_new
"
,
args
.
genome
)
#call diffbind
this_script
=
os
.
path
.
abspath
(
__file__
).
split
(
"
/
"
)
folder
=
"
/
"
.
join
(
this_script
[
0
:
len
(
this_script
)
-
1
])
diffbind_command
=
"
Rscript
"
+
folder
+
"
/runDiffBind.R
"
+
args
.
infile
+
"
_new
"
#logging.debug(diffbind_command)
p
=
subprocess
.
Popen
(
diffbind_command
,
shell
=
True
)
p
.
communicate
()
#call chipseeker on original peaks and overlapping peaks
chipseeker_command
=
"
Rscript
"
+
folder
+
"
/runChipseeker.R
"
+
"
,
"
.
join
(
dfile
[
'
Peaks
'
].
tolist
())
+
"
"
+
"
,
"
.
join
(
dfile
[
'
SampleID
'
])
#BC## logging.debug(chipseeker_command)
p
=
subprocess
.
Popen
(
chipseeker_command
,
shell
=
True
)
p
.
communicate
()
overlapping_peaks
=
glob
.
glob
(
'
*diffbind.bed
'
)
overlapping_peak_names
=
[]
for
pn
in
overlapping_peaks
:
overlapping_peak_names
.
append
(
pn
.
split
(
"
_diffbind
"
)[
0
].
replace
(
"
!
"
,
"
non
"
))
chipseeker_overlap_command
=
"
Rscript
"
+
folder
+
"
/runChipseeker.R
"
+
"
,
"
.
join
(
overlapping_peaks
)
+
"
"
+
"
,
"
.
join
(
overlapping_peak_names
)
p
=
subprocess
.
Popen
(
chipseeker_overlap_command
,
shell
=
True
)
p
.
communicate
()
#MEME-chip on all peaks
meme_arglist
=
zip
(
dfile
[
'
Peaks
'
].
tolist
(),[
test_path
+
"
hg19.2bit
"
]
*
dfile
.
shape
[
0
],[
str
(
args
.
toppeak
)]
*
dfile
.
shape
[
0
],
dfile
[
'
SampleID
'
].
tolist
())
#BC# #print meme_arglist
work_pool
=
Pool
(
min
(
12
,
dfile
.
shape
[
0
]))
resultList
=
work_pool
.
map
(
memechip_wrapper
,
meme_arglist
)
work_pool
.
close
()
work_pool
.
join
()
if
__name__
==
"
__main__
"
:
main
()
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