Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Louis BECQUEY
/
RNANet
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Louis BECQUEY
2021-01-31 14:49:45 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
810f5fcfefc07ef7dbf9d7ce22779ba20beb25f4
810f5fcf
1 parent
a8cd46e8
prevent div by zero if no 3D structures in the folder
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
2 deletions
statistics.py
statistics.py
View file @
810f5fc
...
...
@@ -944,7 +944,6 @@ def par_distance_matrix(filelist, f, label, consider_all_atoms, s):
coordinates_with_gaps
.
append
(
coordinates
[
i
-
nb_gap
])
# Build the pairwise distances
print
(
"> Computing distances for"
,
s
.
id
)
d
=
np
.
zeros
((
len
(
s
.
seq
),
len
(
s
.
seq
)),
dtype
=
np
.
float16
)
for
i
in
range
(
len
(
s
.
seq
)):
for
j
in
range
(
len
(
s
.
seq
)):
...
...
@@ -953,7 +952,6 @@ def par_distance_matrix(filelist, f, label, consider_all_atoms, s):
else
:
d
[
i
,
j
]
=
get_euclidian_distance
(
coordinates_with_gaps
[
i
],
coordinates_with_gaps
[
j
])
print
(
"> finished."
)
np
.
savetxt
(
runDir
+
'/results/distance_matrices/'
+
f
+
'_'
+
label
+
'/'
+
s
.
id
.
strip
(
"
\'
"
)
+
'.csv'
,
d
,
delimiter
=
","
,
fmt
=
"
%.3
f"
)
return
1
-
np
.
isnan
(
d
)
.
astype
(
int
),
np
.
nan_to_num
(
d
),
np
.
nan_to_num
(
d
*
d
)
...
...
@@ -1026,6 +1024,7 @@ def get_avg_std_distance_matrix(f, consider_all_atoms, multithread=False):
exit
(
1
)
if
(
counts
>
1
)
.
all
():
# Calculation of the average matrix
avg
=
avg
/
counts
np
.
savetxt
(
runDir
+
'/results/distance_matrices/'
+
f
+
'_'
+
label
+
'/'
+
f
+
'_average.csv'
,
avg
,
delimiter
=
","
,
fmt
=
"
%.3
f"
)
...
...
Please
register
or
login
to post a comment