diff --git a/.circleci/config.yml b/.circleci/config.yml
index 24b27f8..bd11df0 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -26,11 +26,10 @@ workflows:
- DOCKER_CONTEXT
executors:
-
openjdk:
working_directory: ~/repo
docker:
- - image: circleci/openjdk:8-jdk
+ - image: cimg/openjdk:19.0.2
auth:
username: ${DOCKER_USER}
password: ${DOCKER_PASS}
@@ -44,11 +43,25 @@ jobs:
steps:
- checkout
- setup_remote_docker
+ - node/install:
+ node-version: '19.6'
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.sbt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
- name: Compile - JVM
- command: cat /dev/null | sbt positionalCarbonSourcesJVM/test
+ name: Compile/Tests
+ command: |
+ export NODE_OPTIONS=--openssl-legacy-provider
+ cat /dev/null | sbt test
+# - run:
+# name: Coverage
+# command: |
+# export NODE_OPTIONS=--openssl-legacy-provider
+# cat /dev/null | sbt clean coverage test
+# sbt coverageReport
+# bash <(curl -s https://codecov.io/bash)
+# bash <(curl -Ls https://coverage.codacy.com/get.sh) report
+# - store_artifacts:
+# path: positional-carbon13-enrichment/jvm/target/test-reports
\ No newline at end of file
diff --git a/README.md b/README.md
index d1642d9..518ab1b 100644
--- a/README.md
+++ b/README.md
@@ -1,46 +1,65 @@
-# positional-carbon13-enrichment
-[![CircleCI](https://dl.circleci.com/status-badge/img/gh/p2m2/positional-carbon13-enrichment/tree/develop.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/p2m2/positional-carbon13-enrichment/tree/develop)
+# Calculations of 13C-Positional Enrichments
-https://p2m2.github.io/positional-carbon13-enrichment/
+[![p2m2](https://circleci.com/gh/p2m2/positional-carbon13-enrichment.svg?style=shield)](https://app.circleci.com/pipelines/github/p2m2)
+[![web](https://img.shields.io/badge/Web-Online-blue.svg)](https://p2m2.github.io/positional-carbon13-enrichment/)
+[![doi](https://img.shields.io/badge/doi-10.3390/metabo13040466-blue.svg)](https://doi.org/10.3390/metabo13040466)
-## install
+13C-positional enrichments were calculated by combining mean 13C enrichments
+of several mass fragments that shared part of the carbon backbone from the same TMS
+derivative. A workflow has been created to calculate these 13C-positional enrichments
+directly from the outputs of our 13C-processing method
-### Node.js with JSDOM
+To use the software without prior installation and obtain a visual rendering, please visit the site https://p2m2.github.io/positional-carbon13-enrichment/
-check [scala.js installation page](https://www.scala-js.org/doc/project/js-environments.html)
+For a precise description of the method, refer to the publication [*"Evaluation of GC/MS-Based 13C-Positional Approaches for TMS Derivatives of Organic and Amino Acids and Application to Plant 13C-Labeled Experiments"*](https://doi.org/10.3390/metabo13040466)
-```bash
-runMain fr.inrae.p2m2.tools.PositionalCarbon13EnrichmentMain src/test/resources/galaxy430_res.tsv
-```
+## Software programming environment
-### test app
+- [SBT](https://www.scala-sbt.org/)
+- [Scala](https://www.scala-lang.org/)
+- [ScalaJS - Node.js with JSDOM](https://www.scala-js.org/doc/project/js-environments.html)
+- [Node.js](https://nodejs.org/en)
-```bash
-sbt positionalCarbonSourcesJVM/test
-sbt positionalCarbonSourcesJS/test
-```
+### Dependencies for HTML generation
+
+- [Chart.js](https://www.chartjs.org/)
+- [ScalaTags](https://com-lihaoyi.github.io/scalatags/)
### command line
+#### run tests
+
```shell
-sbt positionalCarbonSourcesJVM/run jvm/src/test/resources/galaxy430_res.tsv
+sbt test
```
-### jar
+### Html
+
+#### Development version
-```
-sbt positionalCarbonSourcesJVM/assembly
+```shell
+sbt fastOptJS::webpack
+# open html/index.html
```
-### Html
+#### Release
```shell
-sbt fastLinkJS
+sbt fullOptJS::webpack
+cp target/scala-2.13/scalajs-bundler/main/positional-carbon13-enrichment-opt-bundle.js docs/
+# open docs/index.html
```
-```main
-fullOptJS
-# --> js/target/scala-2.13/positionalcarbonsources-opt
-```
+## Information about the authors and the software
+
+*Y. Dellero, O. Filangi, A . Bouchereau*
+
+- [Institute for Genetics, Environment and Plant Protection (IGEPP), National Research Institute for Agriculture, Food and Environment (INRAE), Institut Agro, Université Rennes, 35650 Le Rheu, France](https://www6.rennes.inrae.fr/igepp)
+- [Metabolic Profiling and Metabolomic Platform (P2M2), Biopolymers Interactions Assemblies, Institute for Genetics, Environment and Plant Protection, 35650 Le Rheu, France](https://www6.inrae.fr/p2m2/)
+- [MetaboHUB, National Infrastructure of Metabolomics and Fluxomics, 35650 Le Rheu, France](https://www.metabohub.fr/)
+
+
+This code is released under the MIT License.
+
+
-open [index](./html/index.html)
\ No newline at end of file
diff --git a/build.sbt b/build.sbt
index 86db47c..4a4b580 100644
--- a/build.sbt
+++ b/build.sbt
@@ -15,11 +15,18 @@ ThisBuild / developers := List(
Developer("ofilangi", "Olivier Filangi", "olivier.filangi@inrae.fr",url("https://github.com/ofilangi"))
)
-lazy val root = (project in file("."))
- .aggregate(positionalCarbonSources.js, positionalCarbonSources.jvm)
+lazy val root = (project in file(".")).
+ enablePlugins(ScalaJSPlugin).
+ enablePlugins(ScalaJSBundlerPlugin).
+ // add the `it` configuration
+ configs(IntegrationTest).
+ // add `it` tasks
+ settings(Defaults.itSettings: _*).
+ // add Scala.js-specific settings and tasks to the `it` configuration
+ settings(inConfig(IntegrationTest)(ScalaJSPlugin.testConfigSettings): _*)
.settings(
name := "positional-carbon13-enrichment",
- version := "0.1.0-SNAPSHOT",
+ version := "1.0.0",
credentials += {
val realm = scala.util.Properties.envOrElse("REALM_CREDENTIAL", "")
@@ -45,63 +52,34 @@ lazy val root = (project in file("."))
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true),
pomIncludeRepository := { _ => false },
publishMavenStyle := true,
- coverageMinimumStmtTotal := 70,
- coverageMinimumBranchTotal := 30,
- coverageMinimumStmtPerPackage := 70,
- coverageMinimumBranchPerPackage := 30,
- coverageMinimumStmtPerFile := 70,
- coverageMinimumBranchPerFile := 30,
- coverageFailOnMinimum := true,
- coverageHighlighting := true
- )
-
-// Project containing source code shared between the JS and JVM projects.
-// This project should never be compiled or packages but is simply an IntelliJ IDEA
-// friendly alternative to a shared code directory. Projects depending on this
-// projects source code should declare a dependency as 'Provided' AND append
-// this projects source directory manually to 'unmanagedSourceDirectories'.
-lazy val PositionalCarbon13EnrichmentShared = project.in(file("shared"))
-
-lazy val PositionalCarbon13EnrichmentSharedSettings = Seq(
- name := "foo",
- version := "0.1-SNAPSHOT",
- // NOTE: The following line will generate a warning in IntelliJ IDEA, which can be ignored:
- // "The following source roots are outside the corresponding base directories"
- Compile / unmanagedSourceDirectories += ( (PositionalCarbon13EnrichmentShared / Compile) / scalaSource).value
-)
-
-
-lazy val positionalCarbonSources = crossProject(JSPlatform, JVMPlatform).in(file(".")).
- settings(
- libraryDependencies ++= Seq(
- "com.lihaoyi" %%% "utest" % "0.8.1" % Test
- ),
- testFrameworks += new TestFramework("utest.runner.Framework")
- ).
- jvmSettings(
- buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
+ coverageMinimumStmtTotal := 20,
+ coverageFailOnMinimum := false,
+ coverageHighlighting := true,
libraryDependencies ++= Seq(
- "com.lihaoyi" %% "utest" % "0.8.1" % Test,
- "com.github.scopt" %% "scopt" % "4.1.0"
+ "com.lihaoyi" %%% "utest" % "0.8.1" % Test,
+ "com.lihaoyi" %%% "scalatags" % "0.12.0",
),
-
- // Compile / unmanagedSourceDirectories += baseDirectory.value.getParentFile.getParentFile / "shared"/"src"/"main"/"scala",
- // Test / unmanagedSourceDirectories += baseDirectory.value.getParentFile.getParentFile / "shared"/"src"/"test"/"scala",
-
- Compile / mainClass := Some("fr.inrae.p2m2.app.PositionalCarbon13EnrichmentMain") ,
+ testFrameworks += new TestFramework("utest.runner.Framework"),
assembly / target := file("assembly"),
- assembly / assemblyJarName := s"${name.value}-${version.value}.jar"
- )
- .enablePlugins(BuildInfoPlugin)
- .jsSettings(
- // Add JS-specific settings here
- scalaJSUseMainModuleInitializer := true,
- jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv(),
- libraryDependencies ++= Seq(
- "com.lihaoyi" %%% "utest" % "0.8.1" % Test,
- "org.scala-js" %%% "scalajs-dom" % "2.1.0",
- "com.lihaoyi" %%% "scalatags" % "0.12.0"
- )
+ assembly / assemblyJarName := s"${name.value}-${version.value}.jar",
+ Compile / fastOptJS / scalaJSLinkerConfig ~= {
+ _.withOptimizer(false)
+ .withPrettyPrint(true)
+ .withSourceMap(true)
+ },
+ Compile / fullOptJS / scalaJSLinkerConfig ~= {
+ _.withSourceMap(false)
+ .withModuleKind(ModuleKind.CommonJSModule)
+ },
+ webpackBundlingMode := BundlingMode.LibraryAndApplication(),
+ Compile / npmDependencies ++= Seq(
+ "chart" -> "0.1.2",
+ ),
+ Test / npmDevDependencies ++= Seq(
+ "jsdom" -> "21.1.1"
+ ),
+ Compile / scalaJSUseMainModuleInitializer := true,
+ Test / requireJsDomEnv := true
)
Global / onChangedBuildSource := ReloadOnSourceChanges
diff --git a/docs/index.html b/docs/index.html
index 5598b81..76ad309 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -8,24 +8,90 @@
body {
background: #F5F5F5;
}
+ h1,h2 {
+ text-align: center;
+ }
.canvasChart {
text-align: center;
- width: 350px;
+ width: 450px;
}
.gridCanvas {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-gap: 10px;
}
+ .centered-element{
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ }
+ footer {
+ text-align: center;
+ padding: 3px;
+ //background-color: Grey;
+ color: grey;
+ }
+ textarea {
+ white-space: pre;
+ }
+
+
The name of the metabolite must follow the format MetaboliteNameC<x>C<y><fragment> + or MetaboliteNameC<x><fragment>
++ sample metabolite derivative isotopologue isotopic_inchi area corrected_area isotopologue_fraction residuum mean_enrichment + Prot13C_1_16 GlycineC2m174 2TMS 0 /a(C1+0) 410680.0 518131.0969722705 0.5205891530191978 0.0 0.47941084698080205 ++
+ The rules must follow the following form (The isotope A is built from the Metabolite B,C,D ...).
+ Metabolite refers to the label in the IsoCor file
+
+ [Metabolite] -> A -> B, C, D,...
+
+ If the rules are not defined for a compound, all combinations of calculations are proposed.
+