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
cf00e0e5
Commit
cf00e0e5
authored
6 years ago
by
Venkat Malladi
Browse files
Options
Downloads
Patches
Plain Diff
Update file names and output for filter reads.
parent
e57b3605
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
+3
-3
3 additions, 3 deletions
workflow/main.nf
workflow/scripts/map_qc.py
+2
-2
2 additions, 2 deletions
workflow/scripts/map_qc.py
workflow/tests/test_map_qc.py
+10
-8
10 additions, 8 deletions
workflow/tests/test_map_qc.py
with
15 additions
and
13 deletions
workflow/main.nf
+
3
−
3
View file @
cf00e0e5
...
...
@@ -161,9 +161,9 @@ process filterReads {
set sampleId, file('*.bam'), file('*.bai'), experimentId, biosample, factor, treatment, replicate, controlId into dedupReads
set sampleId, file('*.bam'), experimentId, biosample, factor, treatment, replicate, controlId into convertReads
file '*flagstat.qc' into dedupReadsStats
file '*pbc.qc' into dedupReadsComplexity
file '*dup.qc' into dupReads
file '*
.
flagstat.qc' into dedupReadsStats
file '*
.
pbc.qc' into dedupReadsComplexity
file '*
.de
dup.qc' into dupReads
script:
...
...
This diff is collapsed.
Click to expand it.
workflow/scripts/map_qc.py
+
2
−
2
View file @
cf00e0e5
...
...
@@ -169,7 +169,7 @@ def dedup_mapped(bam, bam_basename, paired):
# Remove duplicates
final_bam_prefix
=
bam_basename
+
"
.
filt.no
dup
"
final_bam_prefix
=
bam_basename
+
"
.
de
dup
"
final_bam_filename
=
final_bam_prefix
+
"
.bam
"
if
paired
:
# paired-end data
...
...
@@ -206,7 +206,7 @@ def dedup_mapped(bam, bam_basename, paired):
def
compute_complexity
(
bam
,
paired
,
bam_basename
):
'''
Calculate library complexity .
'''
pbc_file_qc_filename
=
bam_basename
+
"
.
filt.nodup.
pbc.qc
"
pbc_file_qc_filename
=
bam_basename
+
"
.pbc.qc
"
tmp_pbc_file_qc_filename
=
"
tmp.%s
"
%
(
pbc_file_qc_filename
)
# Sort by name
...
...
This diff is collapsed.
Click to expand it.
workflow/tests/test_map_qc.py
+
10
−
8
View file @
cf00e0e5
...
...
@@ -10,13 +10,14 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
@pytest.mark.singleend
def
test_map_qc_singleend
():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCFF646LXU.filt.nodup.bam
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCFF646LXU.filt.nodup.bam.bai
'
))
filtered_reads_report
=
test_output_path
+
'
ENCFF646LXU.filt.nodup.flagstat.qc
'
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB831RUI.dedup.bam
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB831RUI.dedup.bam.bai
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB831RUI.dedup.qc
'
))
filtered_reads_report
=
test_output_path
+
'
ENCLB831RUI.dedup.flagstat.qc
'
samtools_report
=
open
(
filtered_reads_report
).
readlines
()
assert
'
64962570 + 0 in total
'
in
samtools_report
[
0
]
assert
'
64962570 + 0 mapped (100.00%:N/A)
'
in
samtools_report
[
4
]
library_complexity
=
test_output_path
+
'
ENC
FF646LXU.filt.nodup
.pbc.qc
'
library_complexity
=
test_output_path
+
'
ENC
LB831RUI
.pbc.qc
'
df_library_complexity
=
pd
.
read_csv
(
library_complexity
,
sep
=
'
\t
'
)
assert
df_library_complexity
[
"
NRF
"
].
iloc
[
0
]
==
0.926192
assert
df_library_complexity
[
"
PBC1
"
].
iloc
[
0
]
==
0.926775
...
...
@@ -25,13 +26,14 @@ def test_map_qc_singleend():
@pytest.mark.pairedend
def
test_map_qc_pairedend
():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCFF293YFE_val_2ENCFF330MCZ_val_1.filt.nodup.bam
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCFF293YFE_val_2ENCFF330MCZ_val_1.filt.nodup.bambai
'
))
filtered_reads_report
=
test_output_path
+
'
ENCFF293YFE_val_2ENCFF330MCZ_val_1.filt.nodup.flagstat.qc
'
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB568IYX.dedup.bam
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB568IYX.dedup.bam.bai
'
))
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCLB568IYX.dedup.qc
'
))
filtered_reads_report
=
test_output_path
+
'
ENCLB568IYX.dedup.flagstat.qc
'
samtools_report
=
open
(
filtered_reads_report
).
readlines
()
assert
'
47389080 + 0 in total
'
in
samtools_report
[
0
]
assert
'
47389080 + 0 mapped (100.00%:N/A)
'
in
samtools_report
[
4
]
library_complexity
=
test_output_path
+
'
ENC
FF293YFE_val_2ENCFF330MCZ_val_1.filt.nodup
.pbc.qc
'
library_complexity
=
test_output_path
+
'
ENC
LB568IYX
.pbc.qc
'
df_library_complexity
=
pd
.
read_csv
(
library_complexity
,
sep
=
'
\t
'
)
assert
df_library_complexity
[
"
NRF
"
].
iloc
[
0
]
==
0.947064
assert
df_library_complexity
[
"
PBC1
"
].
iloc
[
0
]
==
0.946724
...
...
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