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
90a25607
Commit
90a25607
authored
May 24, 2022
by
cfrainay
Browse files
fix missing optional files exceptions in metaborank, precursor and scope network
parent
2abf493a
Changes
4
Hide whitespace changes
Inline
Side-by-side
met4j-io/src/main/resources/log4j2.properties
deleted
100644 → 0
View file @
2abf493a
#
# Copyright INRAE (2022)
#
# contact-metexplore@inrae.fr
#
# This software is a computer program whose purpose is to [describe
# functionalities and technical features of your software].
#
# This software is governed by the CeCILL license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/ or redistribute the software under the terms of the CeCILL
# license as circulated by CEA, CNRS and INRIA at the following URL
# "https://cecill.info/licences/Licence_CeCILL_V2.1-en.html".
#
# As a counterpart to the access to the source code and rights to copy,
# modify and redistribute granted by the license, users are provided only
# with a limited warranty and the software's author, the holder of the
# economic rights, and the successive licensors have only limited
# liability.
#
# In this respect, the user's attention is drawn to the risks associated
# with loading, using, modifying and/or developing or reproducing the
# software by the user in light of its specific status of free software,
# that may mean that it is complicated to manipulate, and that also
# therefore means that it is reserved for developers and experienced
# professionals having in-depth computer knowledge. Users are therefore
# encouraged to load and test the software's suitability as regards their
# requirements in conditions enabling the security of their systems and/or
# data to be ensured and, more generally, to use and operate it in the
# same conditions as regards security.
#
# The fact that you are presently reading this means that you have had
# knowledge of the CeCILL license and that you accept its terms.
#
#
# Extra logging related to initialization of Log4j
# Set to debug or trace if log4j initialization is failing
status
=
error
# Name of the configuration
name
=
ConsoleLogConfigDemo
# Console appender configuration
appender.console.type
=
Console
appender.console.name
=
consoleLogger
appender.console.layout.type
=
PatternLayout
appender.console.layout.pattern
=
%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
# Root logger level
rootLogger.level
=
error
# Root logger referring to console appender
rootLogger.appenderRef.stdout.ref
=
consoleLogger
\ No newline at end of file
met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/MetaboRank.java
View file @
90a25607
...
@@ -39,18 +39,17 @@ import fr.inrae.toulouse.metexplore.met4j_chemUtils.chemicalSimilarity.Fingerpri
...
@@ -39,18 +39,17 @@ import fr.inrae.toulouse.metexplore.met4j_chemUtils.chemicalSimilarity.Fingerpri
import
fr.inrae.toulouse.metexplore.met4j_core.biodata.BioMetabolite
;
import
fr.inrae.toulouse.metexplore.met4j_core.biodata.BioMetabolite
;
import
fr.inrae.toulouse.metexplore.met4j_core.biodata.BioNetwork
;
import
fr.inrae.toulouse.metexplore.met4j_core.biodata.BioNetwork
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.analyze.centrality.EigenVectorCentrality
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.analyze.centrality.EigenVectorCentrality
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.connect.weighting.ReactionProbabilityWeight
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.connect.weighting.*
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.connect.weighting.SimilarityWeightPolicy
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.connect.weighting.WeightUtils
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.connect.weighting.WeightsFromFile
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.transform.GraphFilter
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.transform.GraphFilter
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.utils.RankUtils
;
import
fr.inrae.toulouse.metexplore.met4j_graph.computation.utils.RankUtils
;
import
fr.inrae.toulouse.metexplore.met4j_graph.core.GraphFactory
;
import
fr.inrae.toulouse.metexplore.met4j_graph.core.GraphFactory
;
import
fr.inrae.toulouse.metexplore.met4j_graph.core.WeightingPolicy
;
import
fr.inrae.toulouse.metexplore.met4j_graph.core.compound.CompoundGraph
;
import
fr.inrae.toulouse.metexplore.met4j_graph.core.compound.CompoundGraph
;
import
fr.inrae.toulouse.metexplore.met4j_graph.core.compound.ReactionEdge
;
import
fr.inrae.toulouse.metexplore.met4j_graph.core.compound.ReactionEdge
;
import
fr.inrae.toulouse.metexplore.met4j_graph.io.Bionetwork2BioGraph
;
import
fr.inrae.toulouse.metexplore.met4j_graph.io.Bionetwork2BioGraph
;
import
fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.JsbmlReader
;
import
fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.JsbmlReader
;
import
fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderException
;
import
fr.inrae.toulouse.metexplore.met4j_io.jsbml.reader.Met4jSbmlReaderException
;
import
fr.inrae.toulouse.metexplore.met4j_io.utils.StringUtils
;
import
fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication
;
import
fr.inrae.toulouse.metexplore.met4j_toolbox.generic.AbstractMet4jApplication
;
import
fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats
;
import
fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.EnumFormats
;
import
fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format
;
import
fr.inrae.toulouse.metexplore.met4j_toolbox.generic.annotations.Format
;
...
@@ -228,15 +227,18 @@ public class MetaboRank extends AbstractMet4jApplication {
...
@@ -228,15 +227,18 @@ public class MetaboRank extends AbstractMet4jApplication {
}
}
public
void
setEdgeWeights
(
CompoundGraph
graph
,
String
localFilePath
)
{
public
void
setEdgeWeights
(
CompoundGraph
graph
,
String
localFilePath
)
{
Boolean
defaultWeight
=
(
localFilePath
==
null
||
localFilePath
.
isEmpty
()
||
localFilePath
.
isBlank
());
//import weights from file
//import weights from file
Weight
sFromFile
<
BioMetabolite
,
ReactionEdge
,
CompoundGraph
>
wp
=
new
WeightsFromFile
<>(
localFilePath
,
true
);
Weight
ingPolicy
wp
=
(
defaultWeight
)
?
new
DefaultWeightPolicy
()
:
new
WeightsFromFile
<>(
localFilePath
,
true
);
//set weights to edges
//set weights to edges
wp
.
setWeight
(
graph
);
wp
.
setWeight
(
graph
);
//remove weights below 0.0
if
(!
defaultWeight
)
{
int
nb
=
GraphFilter
.
weightFilter
(
graph
,
0.0
,
"<="
);
//remove weights below 0.0
System
.
err
.
println
(
nb
+
" edges removed"
);
int
nb
=
GraphFilter
.
weightFilter
(
graph
,
0.0
,
"<="
);
//remove edges without NaN weight
System
.
err
.
println
(
nb
+
" edges removed"
);
WeightUtils
.
removeEdgeWithNaNWeight
(
graph
);
//remove edges without NaN weight
WeightUtils
.
removeEdgeWithNaNWeight
(
graph
);
}
//remove disconnected nodes
//remove disconnected nodes
graph
.
removeIsolatedNodes
();
graph
.
removeIsolatedNodes
();
System
.
err
.
println
(
"weights computed."
);
System
.
err
.
println
(
"weights computed."
);
...
...
met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/PrecursorNetwork.java
View file @
90a25607
...
@@ -41,12 +41,12 @@ public class PrecursorNetwork extends AbstractMet4jApplication {
...
@@ -41,12 +41,12 @@ public class PrecursorNetwork extends AbstractMet4jApplication {
@Option
(
name
=
"-o"
,
usage
=
"output file: path to the .gml file where the results precursor network will be exported"
,
required
=
true
)
@Option
(
name
=
"-o"
,
usage
=
"output file: path to the .gml file where the results precursor network will be exported"
,
required
=
true
)
public
String
output
;
public
String
output
;
//op
r
tions
//options
@ParameterType
(
name
=
InputFile
)
@ParameterType
(
name
=
InputFile
)
@Option
(
name
=
"-sc"
,
aliases
=
{
"--sides"
},
usage
=
"an optional file containing list of ubiquitous compounds to be considered already available"
)
@Option
(
name
=
"-sc"
,
aliases
=
{
"--sides"
},
usage
=
"an optional file containing list of ubiquitous compounds to be considered already available"
)
public
String
sideCompoundFile
=
null
;
public
String
sideCompoundFile
=
null
;
@ParameterType
(
name
=
InputFile
)
@ParameterType
(
name
=
InputFile
)
@Option
(
name
=
"-ir"
,
aliases
=
{
"--ignore"
},
usage
=
"an optional file containing list of reaction to ignore (forbid inclusion in scope"
)
@Option
(
name
=
"-ir"
,
aliases
=
{
"--ignore"
},
usage
=
"an optional file containing list of reaction to ignore (forbid inclusion in scope
)
"
)
public
String
reactionToIgnoreFile
=
null
;
public
String
reactionToIgnoreFile
=
null
;
public
static
void
main
(
String
[]
args
)
throws
IOException
,
Met4jSbmlReaderException
{
public
static
void
main
(
String
[]
args
)
throws
IOException
,
Met4jSbmlReaderException
{
...
@@ -64,10 +64,10 @@ public class PrecursorNetwork extends AbstractMet4jApplication {
...
@@ -64,10 +64,10 @@ public class PrecursorNetwork extends AbstractMet4jApplication {
BioCollection
<
BioMetabolite
>
targets
=
mapper
.
map
(
targetsFilePath
).
stream
()
BioCollection
<
BioMetabolite
>
targets
=
mapper
.
map
(
targetsFilePath
).
stream
()
.
map
(
BioMetabolite
.
class
::
cast
)
.
map
(
BioMetabolite
.
class
::
cast
)
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
BioCollection
<
BioMetabolite
>
bootstraps
=
mapper
.
map
(
sideCompoundFile
).
stream
()
BioCollection
<
BioMetabolite
>
bootstraps
=
(
sideCompoundFile
==
null
)
?
new
BioCollection
<>()
:
mapper
.
map
(
sideCompoundFile
).
stream
()
.
map
(
BioMetabolite
.
class
::
cast
)
.
map
(
BioMetabolite
.
class
::
cast
)
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
BioCollection
<
BioReaction
>
forbidden
=
mapper
.
map
(
reactionToIgnoreFile
).
stream
()
BioCollection
<
BioReaction
>
forbidden
=
(
reactionToIgnoreFile
==
null
)
?
new
BioCollection
<>()
:
mapper
.
map
(
reactionToIgnoreFile
).
stream
()
.
map
(
BioReaction
.
class
::
cast
)
.
map
(
BioReaction
.
class
::
cast
)
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
...
...
met4j-toolbox/src/main/java/fr/inrae/toulouse/metexplore/met4j_toolbox/networkAnalysis/ScopeNetwork.java
View file @
90a25607
...
@@ -72,17 +72,12 @@ public class ScopeNetwork extends AbstractMet4jApplication {
...
@@ -72,17 +72,12 @@ public class ScopeNetwork extends AbstractMet4jApplication {
BioCollection
<
BioMetabolite
>
seeds
=
mapper
.
map
(
seedsFilePath
).
stream
()
BioCollection
<
BioMetabolite
>
seeds
=
mapper
.
map
(
seedsFilePath
).
stream
()
.
map
(
BioMetabolite
.
class
::
cast
)
.
map
(
BioMetabolite
.
class
::
cast
)
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
BioCollection
<
BioMetabolite
>
bootstraps
=
mapper
.
map
(
sideCompoundFile
).
stream
()
BioCollection
<
BioMetabolite
>
bootstraps
=
(
sideCompoundFile
==
null
)
?
new
BioCollection
<>()
:
mapper
.
map
(
sideCompoundFile
).
stream
()
.
map
(
BioMetabolite
.
class
::
cast
)
.
map
(
BioMetabolite
.
class
::
cast
)
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
BioCollection
<
BioReaction
>
forbidden
=
(
reactionToIgnoreFile
==
null
)
?
new
BioCollection
<>()
:
mapper
.
map
(
reactionToIgnoreFile
).
stream
()
BioCollection
<
BioReaction
>
forbidden
=
new
BioCollection
<>();
if
(
reactionToIgnoreFile
!=
null
)
{
forbidden
=
mapper
.
map
(
reactionToIgnoreFile
).
stream
()
.
map
(
BioReaction
.
class
::
cast
)
.
map
(
BioReaction
.
class
::
cast
)
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
.
collect
(
BioCollection:
:
new
,
BioCollection:
:
add
,
BioCollection:
:
addAll
);
}
ScopeCompounds
scopeComp
=
new
ScopeCompounds
(
graph
,
seeds
,
bootstraps
,
forbidden
);
ScopeCompounds
scopeComp
=
new
ScopeCompounds
(
graph
,
seeds
,
bootstraps
,
forbidden
);
if
(
includeSides
)
scopeComp
.
includeBootstrapsInScope
();
if
(
includeSides
)
scopeComp
.
includeBootstrapsInScope
();
...
...
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