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
8991d010
Commit
8991d010
authored
6 years ago
by
Venkat Malladi
Browse files
Options
Downloads
Plain Diff
Update tests and merge.
parents
e6955b5c
4a653c8f
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
workflow/main.nf
+1
-1
1 addition, 1 deletion
workflow/main.nf
workflow/scripts/experiment_qc.py
+26
-5
26 additions, 5 deletions
workflow/scripts/experiment_qc.py
workflow/tests/test_experiment_qc.py
+10
-0
10 additions, 0 deletions
workflow/tests/test_experiment_qc.py
with
37 additions
and
6 deletions
workflow/main.nf
+
1
−
1
View file @
8991d010
...
@@ -198,7 +198,7 @@ process experimentQC {
...
@@ -198,7 +198,7 @@ process experimentQC {
output:
output:
file '*.{p
ng
,npz}' into deepToolsStats
file '*.{p
df
,npz}' into deepToolsStats
script:
script:
...
...
This diff is collapsed.
Click to expand it.
workflow/scripts/experiment_qc.py
+
26
−
5
View file @
8991d010
...
@@ -77,10 +77,10 @@ def generate_read_summary(design, extension):
...
@@ -77,10 +77,10 @@ def generate_read_summary(design, extension):
return
mbs_filename
return
mbs_filename
def
check_correlation
(
mbs
):
def
check_
spearman_
correlation
(
mbs
):
'''
Check Spearman pairwise correlation of samples based on read counts.
'''
'''
Check Spearman pairwise correlation of samples based on read counts.
'''
spearman_filename
=
'
heatmap_SpearmanCorr.p
ng
'
spearman_filename
=
'
heatmap_SpearmanCorr.p
df
'
spearman_params
=
"
--corMethod spearman --skipZero
"
+
\
spearman_params
=
"
--corMethod spearman --skipZero
"
+
\
"
--plotTitle
\"
Spearman Correlation of Read Counts
\"
"
+
\
"
--plotTitle
\"
Spearman Correlation of Read Counts
\"
"
+
\
"
--whatToPlot heatmap --colorMap RdYlBu --plotNumbers
"
"
--whatToPlot heatmap --colorMap RdYlBu --plotNumbers
"
...
@@ -96,12 +96,31 @@ def check_correlation(mbs):
...
@@ -96,12 +96,31 @@ def check_correlation(mbs):
out
,
err
=
spearman_correlation
.
communicate
()
out
,
err
=
spearman_correlation
.
communicate
()
def
check_pearson_correlation
(
mbs
):
'''
Check Pearson pairwise correlation of samples based on read counts.
'''
pearson_filename
=
'
heatmap_PearsonCorr.pdf
'
pearson_params
=
"
--corMethod pearson --skipZero
"
+
\
"
--plotTitle
\"
Pearson Correlation of Read Counts
\"
"
+
\
"
--whatToPlot heatmap --colorMap RdYlBu --plotNumbers
"
pearson_command
=
(
"
plotCorrelation -in %s %s -o %s
"
%
(
mbs
,
pearson_params
,
pearson_filename
)
)
logger
.
info
(
"
Running deeptools with %s
"
,
pearson_command
)
pearson_correlation
=
subprocess
.
Popen
(
pearson_command
,
shell
=
True
)
out
,
err
=
pearson_correlation
.
communicate
()
def
check_coverage
(
design
,
extension
):
def
check_coverage
(
design
,
extension
):
'''
Asses the sequencing depth of samples.
'''
'''
Asses the sequencing depth of samples.
'''
bam_files
=
'
'
.
join
(
design
[
'
bam_reads
'
])
bam_files
=
'
'
.
join
(
design
[
'
bam_reads
'
])
labels
=
'
'
.
join
(
design
[
'
sample_id
'
])
labels
=
'
'
.
join
(
design
[
'
sample_id
'
])
coverage_filename
=
'
coverage.p
ng
'
coverage_filename
=
'
coverage.p
df
'
coverage_params
=
"
-n 1000000 --plotTitle
\"
Sample Coverage
\"
"
+
\
coverage_params
=
"
-n 1000000 --plotTitle
\"
Sample Coverage
\"
"
+
\
"
--ignoreDuplicates --minMappingQuality 10
"
"
--ignoreDuplicates --minMappingQuality 10
"
...
@@ -137,7 +156,7 @@ def update_controls(design):
...
@@ -137,7 +156,7 @@ def update_controls(design):
def
check_enrichment
(
sample_id
,
control_id
,
sample_reads
,
control_reads
,
extension
):
def
check_enrichment
(
sample_id
,
control_id
,
sample_reads
,
control_reads
,
extension
):
'''
Asses the enrichment per sample.
'''
'''
Asses the enrichment per sample.
'''
fingerprint_filename
=
sample_id
+
'
_fingerprint.p
ng
'
fingerprint_filename
=
sample_id
+
'
_fingerprint.p
df
'
fingerprint_command
=
(
fingerprint_command
=
(
"
plotFingerprint -b %s %s --extendReads %d --labels %s %s --plotFile %s
"
"
plotFingerprint -b %s %s --extendReads %d --labels %s %s --plotFile %s
"
...
@@ -167,7 +186,9 @@ def main():
...
@@ -167,7 +186,9 @@ def main():
# Run correlation
# Run correlation
mbs_filename
=
generate_read_summary
(
design_df
,
extension
)
mbs_filename
=
generate_read_summary
(
design_df
,
extension
)
check_correlation
(
mbs_filename
)
check_spearman_correlation
(
mbs_filename
)
check_pearson_correlation
(
mbs_filename
)
# Run coverage
# Run coverage
check_coverage
(
design_df
,
extension
)
check_coverage
(
design_df
,
extension
)
...
...
This diff is collapsed.
Click to expand it.
workflow/tests/test_experiment_qc.py
+
10
−
0
View file @
8991d010
...
@@ -41,6 +41,11 @@ def test_spearman_singleend():
...
@@ -41,6 +41,11 @@ def test_spearman_singleend():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
heatmap_SpearmanCorr.png
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
heatmap_SpearmanCorr.png
'
))
@pytest.mark.singleend
def
test_pearson_singleend
():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
heatmap_PearsonCorr.png
'
))
@pytest.mark.singleend
@pytest.mark.singleend
def
test_fingerprint_singleend
():
def
test_fingerprint_singleend
():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB144FDT_fingerprint.png
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB144FDT_fingerprint.png
'
))
...
@@ -58,6 +63,11 @@ def test_spearman_pairedend():
...
@@ -58,6 +63,11 @@ def test_spearman_pairedend():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
heatmap_SpearmanCorr.png
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
heatmap_SpearmanCorr.png
'
))
@pytest.mark.pairdend
def
test_pearson_pairedend
():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
heatmap_PearsonCorr.png
'
))
@pytest.mark.pairdend
@pytest.mark.pairdend
def
test_fingerprint_pairedend
():
def
test_fingerprint_pairedend
():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB568IYX_fingerprint.png
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB568IYX_fingerprint.png
'
))
...
...
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