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
metexplore
met4j
Commits
d7a2c87b
Commit
d7a2c87b
authored
May 25, 2022
by
cfrainay
Browse files
[toolbox] fix error for tiny networks
handle case expected top centrality nodes greater than network order
parent
d326310a
Changes
1
Hide whitespace changes
Inline
Side-by-side
met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/NetworkSummary.java
View file @
d7a2c87b
...
...
@@ -51,7 +51,7 @@ public class NetworkSummary extends AbstractMet4jApplication {
@Option
(
name
=
"-s"
,
aliases
=
{
"--side"
},
usage
=
"an optional file containing list of side compounds to ignore (recommended)"
)
public
String
sideCompoundFile
=
null
;
@Option
(
name
=
"-sd"
,
aliases
=
{
"--skipdist"
},
usage
=
"skip full distance matrix computation (quick summary)"
,
forbids
=
{
"-w"
}
)
@Option
(
name
=
"-sd"
,
aliases
=
{
"--skipdist"
},
usage
=
"skip full distance matrix computation (quick summary)"
)
public
Boolean
skipdist
=
false
;
@Option
(
name
=
"-d"
,
aliases
=
{
"--directed"
},
usage
=
"use reaction direction for distances"
)
...
...
@@ -194,10 +194,11 @@ public class NetworkSummary extends AbstractMet4jApplication {
Iterator
<
Map
.
Entry
<
BioMetabolite
,
Integer
>>
it
=
closeness
.
entrySet
().
iterator
();
fw
.
write
(
"Top Closeness:\n"
);
for
(
int
i
=
0
;
i
<
20
;
i
++)
{
int
top
=
20
;
if
(
closeness
.
size
()
<
top
)
top
=
closeness
.
size
();
for
(
int
i
=
0
;
i
<
top
;
i
++)
{
Map
.
Entry
<
BioMetabolite
,
Integer
>
e
=
it
.
next
();
fw
.
write
(
"\t"
+
(
e
.
getValue
()
+
1
)
+
"\t"
+
e
.
getKey
().
getName
()
+
"\t"
+
(
closenessRaw
.
get
(
e
.
getKey
())
*
graph
.
vertexSet
().
size
())
+
"\n"
);
}
// it = betweenness.entrySet().iterator();
...
...
Write
Preview
Markdown
is supported
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