Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chipseq_analysis
Manage
Activity
Members
Labels
Plan
Issues
19
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
chipseq_analysis
Commits
487b307d
Commit
487b307d
authored
6 years ago
by
Venkat Malladi
Browse files
Options
Downloads
Patches
Plain Diff
Update cross correlation filenames to be shorter.
parent
f760c6df
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!20
Resolve "Use SampleIds/ Experiment Id as file names throughtout pipeline"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
workflow/scripts/xcor.py
+11
-3
11 additions, 3 deletions
workflow/scripts/xcor.py
workflow/tests/test_xcor.py
+4
-4
4 additions, 4 deletions
workflow/tests/test_xcor.py
with
15 additions
and
7 deletions
workflow/scripts/xcor.py
+
11
−
3
View file @
487b307d
...
...
@@ -22,6 +22,13 @@ logger.propagate = False
logger
.
setLevel
(
logging
.
INFO
)
# the order of this list is important.
# strip_extensions strips from the right inward, so
# the expected right-most extensions should appear first (like .gz)
# Modified from J. Seth Strattan
STRIP_EXTENSIONS
=
[
'
.gz
'
,
'
.tagAlign
'
,
'
.bedse
'
,
'
bedpe
'
]
def
get_args
():
'''
Define arguments.
'''
...
...
@@ -60,7 +67,8 @@ def check_tools():
def
xcor
(
tag
,
paired
):
'''
Use spp to calculate cross-correlation stats.
'''
tag_basename
=
os
.
path
.
basename
(
utils
.
strip_extensions
(
tag
,
[
'
.gz
'
]))
extension
tag_basename
=
os
.
path
.
basename
(
utils
.
strip_extensions
(
tag
,
STRIP_EXTENSIONS
))
uncompressed_tag_filename
=
tag_basename
...
...
@@ -83,8 +91,8 @@ def xcor(tag, paired):
out
,
err
=
utils
.
run_pipe
(
steps
,
outfile
=
subsampled_tag_filename
)
# Calculate Cross-correlation QC scores
cc_scores_filename
=
subsampled_
tag_
fil
ename
+
"
.cc.qc
"
cc_plot_filename
=
subsampled_
tag_
fil
ename
+
"
.cc.plot.pdf
"
cc_scores_filename
=
tag_
bas
ename
+
"
.cc.qc
"
cc_plot_filename
=
tag_
bas
ename
+
"
.cc.plot.pdf
"
# CC_SCORE FILE format
# Filename <tab>
...
...
This diff is collapsed.
Click to expand it.
workflow/tests/test_xcor.py
+
4
−
4
View file @
487b307d
...
...
@@ -10,8 +10,8 @@ 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
,
'
ENCFF833BLU.
filt.nodup.tagAlign.15.tagAlign.gz.
cc.plot.pdf
'
))
qc_file
=
os
.
path
.
join
(
test_output_path
,
"
ENCFF833BLU.
filt.nodup.tagAlign.15.tagAlign.gz.
cc.qc
"
)
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENCFF833BLU.cc.plot.pdf
'
))
qc_file
=
os
.
path
.
join
(
test_output_path
,
"
ENCFF833BLU.cc.qc
"
)
df_xcor
=
pd
.
read_csv
(
qc_file
,
sep
=
"
\t
"
,
header
=
None
)
assert
df_xcor
[
2
].
iloc
[
0
]
==
'
190,200,210
'
assert
df_xcor
[
8
].
iloc
[
0
]
==
1.025906
...
...
@@ -20,8 +20,8 @@ def test_map_qc_singleend():
@pytest.mark.pairedend
def
test_map_qc_pairedend
():
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENC
FF582IOZ_val_2ENCFF957SQS_val_1.filt.nodup.tagAlign.15.tagAlign.gz
.cc.plot.pdf
'
))
qc_file
=
os
.
path
.
join
(
test_output_path
,
"
ENC
FF582IOZ_val_2ENCFF957SQS_val_1.filt.nodup.tagAlign.15.tagAlign.gz
.cc.qc
"
)
assert
os
.
path
.
exists
(
os
.
path
.
join
(
test_output_path
,
'
ENC
LB568IYX
.cc.plot.pdf
'
))
qc_file
=
os
.
path
.
join
(
test_output_path
,
"
ENC
LB568IYX
.cc.qc
"
)
df_xcor
=
pd
.
read_csv
(
qc_file
,
sep
=
"
\t
"
,
header
=
None
)
assert
df_xcor
[
2
].
iloc
[
0
]
==
'
210,220,475
'
assert
df_xcor
[
8
].
iloc
[
0
]
==
1.062032
...
...
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