Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
svlib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SVdetection
svlib
Commits
32349bb4
Commit
32349bb4
authored
5 years ago
by
Thomas Faraut
Browse files
Options
Downloads
Patches
Plain Diff
added filter_monomorph and filter_callrate flag added
parent
ee3dbee1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
svreader/annotation.py
+7
-7
7 additions, 7 deletions
svreader/annotation.py
with
7 additions
and
7 deletions
svreader/annotation.py
+
7
−
7
View file @
32349bb4
...
...
@@ -204,7 +204,6 @@ class AnnotateReader(VCFReader):
def
getHeader
(
self
):
return
self
.
vcf_reader
.
header
def
add_annotation_metadata
(
self
):
self
.
addInfo
(
"
SOURCEID
"
,
1
,
"
String
"
,
"
The source sv identifier
"
)
...
...
@@ -520,7 +519,8 @@ def add_filter_infos_header(reader):
reader
.
addFilter
(
"
ABFREQ
"
,
"
AB frequency <0.3 for >50% heterosamples
"
)
def
variant_filtration
(
SVSet
,
reader
):
def
variant_filtration
(
variants
,
reader
,
filter_monomorph
=
False
,
filter_callrate
=
False
):
"""
Filtering the candidate CNVs according to the following criteria
- non duplicate sites
- variant sites
...
...
@@ -534,15 +534,15 @@ def variant_filtration(SVSet, reader):
add_callrate_infos_header
(
reader
)
add_filter_infos_header
(
reader
)
for
sv
in
SVSet
:
for
sv
in
variants
:
info
=
sv
.
record
.
info
sv
.
record
.
info
[
'
CALLRATE
'
]
=
sv
.
call_rate
(
13
)
sv
.
record
.
info
[
'
VARIANTCALLRATE
'
]
=
sv
.
variant_call_rate
(
13
)
if
sv
.
call_rate
(
13
)
<
0.75
:
if
sv
.
call_rate
(
13
)
<
0.75
and
filter_callrate
:
sv
.
filter
.
add
(
"
CALLRATE
"
)
if
not
sv
.
polymorph
():
if
not
sv
.
polymorph
()
and
filter_monomorph
:
sv
.
filter
.
add
(
"
MONOMORPH
"
)
if
'
NONDUPLICATEOVERLAP
'
in
info
and
info
[
'
NONDUPLICATEOVERLAP
'
]
>
0.
7
:
if
'
NONDUPLICATEOVERLAP
'
in
info
and
info
[
'
NONDUPLICATEOVERLAP
'
]
>
0.
8
:
sv
.
filter
.
add
(
"
OVERLAP
"
)
if
"
DUPLICATESCORE
"
in
info
is
not
None
and
info
[
'
DUPLICATESCORE
'
]
>
-
2
:
sv
.
filter
.
add
(
"
DUPLICATE
"
)
...
...
@@ -559,7 +559,7 @@ def AB_filtering(variant_set):
if
Heterozygote
(
s
):
valid_AB_freq
.
append
((
s
.
get
(
'
AB
'
)[
0
]
>
0.3
))
if
(
len
(
valid_AB_freq
)
>
0
and
sum
(
valid_AB_freq
)
<
len
(
valid_AB_freq
)
/
2
):
sum
(
valid_AB_freq
)
<
len
(
valid_AB_freq
)
/
2
):
sv
.
filter
.
add
(
"
ABFREQ
"
)
...
...
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