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
Admin message
Mise à jour de sécurité de Gitlab Jeudi 24 Avril entre 21h00 et 22h00
Show more breadcrumbs
SVdetection
svlib
Commits
b987ff07
Commit
b987ff07
authored
6 years ago
by
Thomas Faraut
Browse files
Options
Downloads
Patches
Plain Diff
correcting a bug in remove_duplicate in __init__
parent
d3425681
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
svreader/__init__.py
+1
-27
1 addition, 27 deletions
svreader/__init__.py
with
1 addition
and
27 deletions
svreader/__init__.py
+
1
−
27
View file @
b987ff07
...
...
@@ -223,32 +223,6 @@ class SVReader(object):
return
vcf_records
def
RemoveDuplicatePass
(
self
,
records
,
cutoff
=
1
):
vcf_records_without_duplicate
=
[]
for
idx
,
record
in
enumerate
(
records
):
if
self
.
CheckForDuplicate
(
idx
,
record
,
records
,
cutoff
):
vcf_records_without_duplicate
.
append
(
record
)
else
:
print
(
"
removed entry %d %s identified as exact duplicate
"
%
(
idx
,
record
))
return
vcf_records_without_duplicate
def
CheckForDuplicate
(
self
,
idx
,
record
,
records
,
cutoff
):
for
test_idx
,
test_record
in
enumerate
(
records
):
if
idx
!=
test_idx
:
if
record
.
chrom
==
test_record
.
chrom
:
if
abs
(
record
.
start
-
test_record
.
start
)
+
abs
(
record
.
end
-
test_record
.
end
)
<
cutoff
:
# We make the assumption that two variants with
# exactly the same breakpoints have the same
# supporting information hence we simply use the
# identifier to distinguish them and keep
# the one with the smaller identifier
if
test_idx
>
idx
:
return
False
return
True
def
GeneralFilterPass
(
self
,
record
,
minlen
,
maxlen
):
return
(
abs
(
record
.
sv_len
)
>=
minlen
and
abs
(
record
.
sv_len
)
<=
maxlen
)
...
...
@@ -258,7 +232,7 @@ class SVReader(object):
def
bnd_merge
(
sef
,
svtype
,
records
):
return
records
# nothing to do in the majority of cases
def
remove_duplicate
(
sef
,
svtype
,
records
):
def
remove_duplicate
(
sef
,
records
):
return
records
# nothing to do in the majority of tools (see pindel)
...
...
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