Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
medema-group
BiG-SCAPE
Commits
d924e594
Commit
d924e594
authored
Apr 01, 2018
by
Jorge Navarro Muñoz
Browse files
minor cleanup in variable naming
parent
6358cac0
Changes
1
Hide whitespace changes
Inline
Side-by-side
functions.py
View file @
d924e594
...
...
@@ -102,9 +102,9 @@ def check_overlap(pfd_matrix, overlap_cutoff):
if
row1
[
-
1
]
==
row2
[
-
1
]:
#check if there is overlap between the domains
if
no_overlap
(
int
(
row1
[
3
]),
int
(
row1
[
4
]),
int
(
row2
[
3
]),
int
(
row2
[
4
]))
==
False
:
overlapping_
nucleot
id
e
s
=
overlap
(
int
(
row1
[
3
]),
int
(
row1
[
4
]),
int
(
row2
[
3
]),
int
(
row2
[
4
]))
overlap_perc_loc1
=
overlap_perc
(
overlapping_
nucleot
id
e
s
,
int
(
row1
[
4
])
-
int
(
row1
[
3
]))
overlap_perc_loc2
=
overlap_perc
(
overlapping_
nucleot
id
e
s
,
int
(
row2
[
4
])
-
int
(
row2
[
3
]))
overlapping_
aminoac
ids
=
overlap
(
int
(
row1
[
3
]),
int
(
row1
[
4
]),
int
(
row2
[
3
]),
int
(
row2
[
4
]))
overlap_perc_loc1
=
overlap_perc
(
overlapping_
aminoac
ids
,
int
(
row1
[
4
])
-
int
(
row1
[
3
]))
overlap_perc_loc2
=
overlap_perc
(
overlapping_
aminoac
ids
,
int
(
row2
[
4
])
-
int
(
row2
[
3
]))
#check if the amount of overlap is significant
if
overlap_perc_loc1
>
overlap_cutoff
or
overlap_perc_loc2
>
overlap_cutoff
:
if
float
(
row1
[
1
])
>=
float
(
row2
[
1
]):
#see which has a better score
...
...
@@ -133,6 +133,8 @@ def check_overlap(pfd_matrix, overlap_cutoff):
loci_end
=
int
(
row
[
8
])
domain_start
=
int
(
row
[
3
])
domain_end
=
int
(
row
[
4
])
# uses nucleotide coordinates for sorting
width
=
3
*
(
domain_end
-
domain_start
)
strand
=
row
[
9
].
split
(
":"
)[
-
1
]
if
strand
==
"+"
:
...
...
@@ -569,4 +571,4 @@ def get_composite_bgc_similarities(bgcs_1, bgcs_2, sim_matrix):
if
(
sim
>
max_sim
[
0
]):
max_sim
=
(
sim
,
bgc_1
,
bgc_2
)
if
(
bgc_2
>
bgc_1
)
else
(
sim
,
bgc_2
,
bgc_1
)
num_pairs
+=
1
return
((
sum_sim
/
num_pairs
),
min_sim
,
max_sim
)
# let it throw infinite division error by itself
\ No newline at end of file
return
((
sum_sim
/
num_pairs
),
min_sim
,
max_sim
)
# let it throw infinite division error by itself
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment