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
b8588c1a
Commit
b8588c1a
authored
7 years ago
by
Venkat Malladi
Browse files
Options
Downloads
Patches
Plain Diff
Update files used.
parent
c41e1217
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
workflow/scripts/map_qc.py
+7
-6
7 additions, 6 deletions
workflow/scripts/map_qc.py
with
7 additions
and
6 deletions
workflow/scripts/map_qc.py
+
7
−
6
View file @
b8588c1a
...
...
@@ -166,7 +166,6 @@ def dedup_mapped(bam, bam_basename, paired):
shlex
.
split
(
sambamba_markdup_command
),
stderr
=
fh
)
os
.
remove
(
tmp_dup_mark_filename
+
'
.bai
'
)
# Remove duplicates
final_bam_prefix
=
bam_basename
+
"
.filt.nodup
"
...
...
@@ -174,10 +173,10 @@ def dedup_mapped(bam, bam_basename, paired):
if
paired
:
# paired-end data
samtools_dedupe_command
=
\
"
samtools view -F 1804 -f 2 -b %s
"
%
(
b
am
)
"
samtools view -F 1804 -f 2 -b %s
"
%
(
tmp_dup_mark_filen
am
e
)
else
:
samtools_dedupe_command
=
\
"
samtools view -F 1804 -b %s
"
%
(
b
am
)
"
samtools view -F 1804 -b %s
"
%
(
tmp_dup_mark_filen
am
e
)
with
open
(
final_bam_filename
,
'
w
'
)
as
fh
:
logger
.
info
(
samtools_dedupe_command
)
...
...
@@ -200,7 +199,7 @@ def dedup_mapped(bam, bam_basename, paired):
subprocess
.
check_call
(
shlex
.
split
(
flagstat_command
),
stdout
=
fh
)
os
.
remove
(
bam
)
return
final_bam
_filename
return
tmp_dup_mark
_filename
def
compute_complexity
(
bam
,
paired
,
bam_basename
):
...
...
@@ -253,6 +252,8 @@ def compute_complexity(bam, paired, bam_basename):
pbc_file
=
pd
.
read_csv
(
tmp_pbc_file_qc_filename
,
sep
=
'
\t
'
,
header
=
None
,
names
=
pbc_headers
)
pbc_file
.
to_csv
(
pbc_file_qc_filename
,
header
=
True
,
sep
=
'
\t
'
,
index
=
False
)
os
.
remove
(
bam
)
os
.
remove
(
bam
+
'
.bai
'
)
os
.
remove
(
tmp_pbc_file_qc_filename
)
...
...
@@ -278,10 +279,10 @@ def main():
filter_bam_filename
=
filter_mapped_se
(
bam
,
bam_basename
)
# Remove duplicates
de
dup_bam_filename
=
dedup_mapped
(
filter_bam_filename
,
bam_basename
,
paired
)
mark
dup_bam_filename
=
dedup_mapped
(
filter_bam_filename
,
bam_basename
,
paired
)
# Compute library complexity
compute_complexity
(
de
dup_bam_filename
,
paired
,
bam_basename
)
compute_complexity
(
mark
dup_bam_filename
,
paired
,
bam_basename
)
if
__name__
==
'
__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