Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
atacseq_analysis
Manage
Activity
Members
Labels
Plan
Issues
7
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
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
BICF
Astrocyte
atacseq_analysis
Commits
4c9bb1e9
Commit
4c9bb1e9
authored
5 years ago
by
Holly Ruess
Browse files
Options
Downloads
Patches
Plain Diff
Fix Pool and Pseudoreps
parent
4e7b319a
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!12
Resolve "Fix Pool and Pseudoreps"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
workflow/main.nf
+43
-25
43 additions, 25 deletions
workflow/main.nf
workflow/scripts/experiment_design.py
+1
-31
1 addition, 31 deletions
workflow/scripts/experiment_design.py
workflow/scripts/pool_and_psuedoreplicate.py
+0
-6
0 additions, 6 deletions
workflow/scripts/pool_and_psuedoreplicate.py
with
44 additions
and
62 deletions
workflow/main.nf
+
43
−
25
View file @
4c9bb1e9
...
...
@@ -403,21 +403,26 @@ xcorDesign = xcorReads
// Make Experiment design files to be read in for downstream analysis
process defineExpDesignFiles {
publishDir "$
baseDir/output
/design", mode: 'copy'
publishDir "$
{outDir}
/design", mode: 'copy'
input:
file xcorDesign
file xcorDesign
output:
file '*.tsv' into experimentObjs mode flatten
file '*.tsv' into experimentObjs mode flatten
script:
"""
python3 $baseDir/scripts/experiment_design.py -d $xcorDesign -a
"""
if (params.astrocyte == true) {
"""
module load python/3.6.1-2-anaconda
python3 ${baseDir}/scripts/experiment_design.py -d ${xcorDesign}
"""
}
else {
"""
python3 ${baseDir}/scripts/experiment_design.py -d ${xcorDesign}
"""
}
}
...
...
@@ -427,28 +432,41 @@ process poolAndPsuedoReads {
tag "${experimentObjs.baseName}"
publishDir "$
baseDir/output
/design", mode: 'copy'
publishDir "$
{outDir}
/design", mode: 'copy'
input:
file experimentObjs
file experimentObjs
output:
file '*.tsv' into experimentPoolObjs
file '*.tsv' into experimentPoolObjs
script:
if (pairedEnd) {
"""
python3 $baseDir/scripts/pool_and_psuedoreplicate.py -d $experimentObjs -p -a
"""
}
else {
"""
python3 $baseDir/scripts/pool_and_psuedoreplicate.py -d $experimentObjs -a
"""
}
if (params.astrocyte == true) {
if (pairedEnd) {
"""
module load python/3.6.1-2-anaconda
python3 ${baseDir}/scripts/pool_and_psuedoreplicate.py -d ${experimentObjs} -p
"""
}
else {
"""
module load python/3.6.1-2-anaconda
python3 ${baseDir}/scripts/pool_and_psuedoreplicate.py -d ${experimentObjs}
"""
}
}
else {
if (pairedEnd) {
"""
python3 ${baseDir}/scripts/pool_and_psuedoreplicate.py -d ${experimentObjs} -p
"""
}
else {
"""
python3 ${baseDir}/scripts/pool_and_psuedoreplicate.py -d ${experimentObjs}
"""
}
}
}
...
...
This diff is collapsed.
Click to expand it.
workflow/scripts/experiment_design.py
+
1
−
31
View file @
4c9bb1e9
...
...
@@ -30,33 +30,10 @@ def get_args():
help
=
"
The design file to make experiemnts (tsv format).
"
,
required
=
True
)
parser
.
add_argument
(
'
-a
'
,
'
--atac
'
,
help
=
"
True/False if ATAC-seq or ChIP-seq.
"
,
default
=
False
,
action
=
'
store_true
'
)
args
=
parser
.
parse_args
()
return
args
def
update_controls
(
design
):
'''
Update design file to append controls list.
'''
logger
.
info
(
"
Running control file update.
"
)
file_dict
=
design
[[
'
sample_id
'
,
'
tag_align
'
]]
\
.
set_index
(
'
sample_id
'
).
T
.
to_dict
()
design
[
'
control_tag_align
'
]
=
design
[
'
control_id
'
]
\
.
apply
(
lambda
x
:
file_dict
[
x
][
'
tag_align
'
])
logger
.
info
(
"
Removing rows that are there own control.
"
)
design
=
design
[
design
[
'
control_id
'
]
!=
design
[
'
sample_id
'
]]
return
design
def
make_experiment_design
(
design
):
'''
Make design file by grouping for each experiment
'''
...
...
@@ -70,7 +47,6 @@ def make_experiment_design(design):
def
main
():
args
=
get_args
()
design
=
args
.
design
atac
=
args
.
atac
# Create a file handler
handler
=
logging
.
FileHandler
(
'
experiment_generation.log
'
)
...
...
@@ -79,14 +55,8 @@ def main():
# Read files as dataframes
design_df
=
pd
.
read_csv
(
design
,
sep
=
'
\t
'
)
# Update design file for check_controls
if
not
atac
:
new_design_df
=
update_controls
(
design_df
)
else
:
new_design_df
=
design_df
# write out experiment design files
make_experiment_design
(
new_
design_df
)
make_experiment_design
(
design_df
)
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
workflow/scripts/pool_and_psuedoreplicate.py
+
0
−
6
View file @
4c9bb1e9
...
...
@@ -43,11 +43,6 @@ def get_args():
help
=
"
Cutoff ratio used for choosing controls.
"
,
default
=
1.2
)
parser
.
add_argument
(
'
-a
'
,
'
--atac
'
,
help
=
"
True/False if ATAC-seq or ChIP-seq.
"
,
default
=
False
,
action
=
'
store_true
'
)
args
=
parser
.
parse_args
()
return
args
...
...
@@ -146,7 +141,6 @@ def main():
paired
=
args
.
paired
design
=
args
.
design
cutoff_ratio
=
args
.
cutoff
atac
=
args
.
atac
# Create a file handler
handler
=
logging
.
FileHandler
(
'
experiment_generation.log
'
)
...
...
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