Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mosaicatcher Update
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Thomas Weber
Mosaicatcher Update
Commits
1c7e1b7e
Commit
1c7e1b7e
authored
6 years ago
by
Tobias Marschall
Browse files
Options
Downloads
Patches
Plain Diff
Change rule filter_calls to retain all calls that overlap with any merged call
parent
d8d94142
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Snakefile
+3
-2
3 additions, 2 deletions
Snakefile
utils/apply_filter.py
+32
-0
32 additions, 0 deletions
utils/apply_filter.py
with
35 additions
and
2 deletions
Snakefile
+
3
−
2
View file @
1c7e1b7e
...
...
@@ -617,11 +617,12 @@ rule mosaiClassifier_make_call:
rule filter_calls:
input:
calls = "sv_calls/{sample}/{window}_fixed_norm.{bpdens}/simpleCalls_llr{llr}_poppriors{pop_priors}_haplotags{use_haplotags}_gtcutoff{gtcutoff}_regfactor{regfactor}_filterFALSE.txt"
inputcalls = "sv_calls/{sample}/{window}_fixed_norm.{bpdens}/simpleCalls_llr{llr}_poppriors{pop_priors}_haplotags{use_haplotags}_gtcutoff{gtcutoff}_regfactor{regfactor}_filterFALSE.txt",
mergedcalls = "postprocessing/merge/{sample}/{window}_fixed_norm.{bpdens}/simpleCalls_llr{llr}_poppriors{pop_priors}_haplotags{use_haplotags}_gtcutoff{gtcutoff}_regfactor{regfactor}.txt",
output:
calls = "sv_calls/{sample}/{window}_fixed_norm.{bpdens,selected_j[0-9\\.]+_s[0-9\\.]+_scedist[0-9\\.]+}/simpleCalls_llr{llr}_poppriors{pop_priors,(TRUE|FALSE)}_haplotags{use_haplotags,(TRUE|FALSE)}_gtcutoff{gtcutoff,[0-9\\.]+}_regfactor{regfactor,[0-9]+}_filterTRUE.txt"
shell:
'utils/filter
_MosaiCatcher_calls
.p
l
{input.calls}
| awk \'BEGIN {{OFS="\\t"}} (NR==1) || ($16=="PASS") {{$16=""; print}}\'
> {output.calls}'
'utils/
apply_
filter.p
y
{input.
input
calls}
{input.mergedcalls}
> {output.calls}'
rule mosaiClassifier_calc_probs:
...
...
This diff is collapsed.
Click to expand it.
utils/apply_filter.py
0 → 100755
+
32
−
0
View file @
1c7e1b7e
#!/usr/bin/env python
"""
Retains calls that overlap with a call after filtering and merging.
That is, output all calls in the input sets that are present in the
provided merged set.
"""
import
sys
from
argparse
import
ArgumentParser
import
pandas
as
pd
def
main
():
parser
=
ArgumentParser
(
prog
=
'
apply_filter.py
'
,
description
=
__doc__
)
parser
.
add_argument
(
'
inputcalls
'
,
metavar
=
'
INPUTCALLS
'
,
help
=
'
Input call set
'
)
parser
.
add_argument
(
'
mergedcalls
'
,
metavar
=
'
MERGEDCALLS
'
,
help
=
'
Merged calls used to decide which input calls to retain
'
)
args
=
parser
.
parse_args
()
input_calls
=
pd
.
read_csv
(
args
.
inputcalls
,
sep
=
'
\t
'
)
merged_calls
=
pd
.
read_csv
(
args
.
mergedcalls
,
sep
=
'
,
'
,
engine
=
'
python
'
)
input_calls
[
'
selected
'
]
=
False
for
chrom
,
start
,
end
in
merged_calls
[[
'
chrom
'
,
'
start
'
,
'
end
'
]].
values
:
input_calls
.
loc
[(
input_calls
.
chrom
==
chrom
)
&
(
input_calls
.
start
<
end
)
&
(
input_calls
.
end
>
start
),
'
selected
'
]
=
True
output_calls
=
input_calls
[
input_calls
.
selected
].
drop
(
columns
=
[
'
selected
'
])
output_calls
.
to_csv
(
sys
.
stdout
,
sep
=
'
\t
'
,
index
=
False
)
if
__name__
==
'
__main__
'
:
main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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