Skip to content

Commit

Permalink
Merge pull request #2 from p2m2/develop
Browse files Browse the repository at this point in the history
v1
  • Loading branch information
ofilangi authored Sep 23, 2022
2 parents 06a0b15 + 913ed2e commit 9c0fceb
Show file tree
Hide file tree
Showing 24 changed files with 198,618 additions and 224 deletions.
142 changes: 142 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#
# - Compile JVM/Js
# - Tests JVM
# - publish JVM Sonatype Snapshot for branches : main/master/develop
# - publish JVM Sonatype Stagge/Release (wait approval) for tags release
#
# DOCKER_CONTEXT is a context global env variable for all application github p2m2 organization
# - DOCKER_USER -> login
# - DOCKER_PASS -> password
# - ORGANIZATION_NAME -> organization register on dockerhub
#
# CREDENTIAL_CONTEXT used by build.sbt
# - REALM_CREDENTIAL,HOST_CREDENTIAL,LOGIN_CREDENTIAL,PASSWORD_CREDENTIAL
#
# NPM_CONTEXT
# - NPM_TOKEN : token (from ~/.npmrc) to publish nodejs lib
#
version: 2.1
orbs:
node: circleci/[email protected]
workflows:
compile-workflow:
jobs:
- compile:
context:
- DOCKER_CONTEXT
- test_and_coverage_jvm:
requires:
- compile
context:
- DOCKER_CONTEXT
- publish_snapshot:
requires:
- test_and_coverage_jvm
context:
- DOCKER_CONTEXT
- CREDENTIAL_CONTEXT
- GPG_CONTEXT
filters:
tags:
ignore: /.*/
branches:
only:
- develop
- main
- master

- publish_tag_to_sonatype_stagge_for_release:
context:
- DOCKER_CONTEXT
- CREDENTIAL_CONTEXT
- GPG_CONTEXT
filters:
tags:
only: /.*/
branches:
ignore: /.*/
executors:

openjdk:
working_directory: ~/repo
docker:
- image: circleci/openjdk:8-jdk
auth:
username: ${DOCKER_USER}
password: ${DOCKER_PASS}

jobs:
compile:
executor: openjdk
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
steps:
- checkout
- setup_remote_docker
- 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 test:compile

test_and_coverage_jvm:
executor: openjdk
environment:
JVM_OPTS: -Xmx3200m
TERM: dumb
steps:
- checkout
- setup_remote_docker
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.sbt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Test JVM env and Coverage
command: |
cat /dev/null | sbt clean coverage Test/test coverageReport
bash <(curl -s https://codecov.io/bash)
- store_artifacts:
path: target/test-reports

publish_snapshot:
executor: openjdk
steps:
- checkout
- setup_remote_docker
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.sbt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Snapshot publication
command: |
export PROG_VERSION="${CIRCLE_BRANCH}-SNAPSHOT"
echo "Importing key"
echo -e "$GPG_KEY" | gpg --import
sbt publish
publish_tag_to_sonatype_stagge_for_release:
executor: openjdk
steps:
- checkout
- setup_remote_docker
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.sbt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Snapshot publication
command: |
export PROG_VERSION="${CIRCLE_TAG}"
echo "Importing key"
echo -e "$GPG_KEY" | gpg --import
sbt publish
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Glucosinolates and Phenolics Brassica napus

[![p2m2](https://circleci.com/gh/p2m2/mzxml-glucosinolate-analyser.svg?style=shield)](https://app.circleci.com/pipelines/github/p2m2)
[![codecov](https://codecov.io/gh/p2m2/mzxml-glucosinolate-analyser/branch/develop/graph/badge.svg)](https://codecov.io/gh/p2m2/mzxml-glucosinolate-analyser)

## assembly

```bash
Expand All @@ -12,4 +15,18 @@ sbt assembly
java -jar ./assembly/pack.jar ./src/test/resources/test.mzXML
```

- https://www.ebi.ac.uk/chebi/advancedSearchFT.do

[Identification and Quantification of Glucosinolates and Phenolics in a Large Panel of Brassica napus Highlight Valuable Genetic Resources for Chemical Ecology and Breeding](https://pubs.acs.org/doi/10.1021/acs.jafc.1c08118)


```
java -jar ./assembly/pack.jar -i 10000 ./src/test/resources/20181018-038.mzXML
java -jar ./assembly/pack.jar -i 10000 -s 3.0 -e 3.5 ./src/test/resources/20181018-038.mzXML
```

## Chebi Glucosinolate

1) https://www.ebi.ac.uk/chebi/advancedSearchFT.do?searchString=glucosinolate
2) "Download your results"
=>ChEBI_Results.tsv
58 changes: 57 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,68 @@
scalaVersion := "2.13.8"
name := "mzxml-analyser-test"
name := "mzxml-glucosinolates-phenolics-analyser"
organization := "com.github.p2m2"
organizationName := "p2m2"
organizationHomepage := Some(url("https://www6.inrae.fr/p2m2"))
licenses := Seq("MIT License" -> url("http://www.opensource.org/licenses/mit-license.php"))
version := "1.0"

scmInfo := Some(
ScmInfo(
url("https://github.com/p2m2/mzxml-glucosinolate-analyser"),
"scm:[email protected]:p2m2/mzxml-glucosinolate-analyser.git"
)
)

developers := List(
Developer("ofilangi", "Olivier Filangi", "[email protected]",url("https://github.com/ofilangi"))
)

libraryDependencies ++= Seq(
"com.github.scopt" %% "scopt" % "4.1.0",
"com.github.chhh" % "msftbx" % "1.8.8",
"com.lihaoyi" %% "ujson" % "2.0.0",
"org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.1",
"com.lihaoyi" %% "utest" % "0.8.1" % Test,
)

credentials += {
val realm = scala.util.Properties.envOrElse("REALM_CREDENTIAL", "" )
val host = scala.util.Properties.envOrElse("HOST_CREDENTIAL", "" )
val login = scala.util.Properties.envOrElse("LOGIN_CREDENTIAL", "" )
val pass = scala.util.Properties.envOrElse("PASSWORD_CREDENTIAL", "" )

val file_credential = Path.userHome / ".sbt" / ".credentials"

if (reflect.io.File(file_credential).exists) {
Credentials(file_credential)
} else {
Credentials(realm,host,login,pass)
}
}

publishTo := {
if (isSnapshot.value)
Some("Sonatype Snapshots Nexus" at "https://oss.sonatype.org/content/repositories/snapshots")
else
Some("Sonatype Snapshots Nexus" at "https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
publishConfiguration := publishConfiguration.value.withOverwrite(true)
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)
pomIncludeRepository := { _ => false }
publishMavenStyle := true

// Coverage

coverageMinimumStmtTotal := 0
coverageMinimumBranchTotal := 0
coverageMinimumStmtPerPackage := 0
coverageMinimumBranchPerPackage := 0
coverageMinimumStmtPerFile := 0
coverageMinimumBranchPerFile := 0
coverageFailOnMinimum := true
coverageHighlighting := true


testFrameworks += new TestFramework("utest.runner.Framework")
assembly / target := file("assembly")
assembly / assemblyJarName := "pack.jar"
Expand All @@ -18,4 +73,5 @@ assembly / assemblyMergeStrategy := {
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}

Global / onChangedBuildSource := ReloadOnSourceChanges
5 changes: 4 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.0")
addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.1")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
60 changes: 60 additions & 0 deletions src/main/resources/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"Glucosinolate" : {
"deltaMp0Mp2" : 1.996,
"numberSulfurMin" : 2,
"neutralLoss" :
{
"gluconolactone" : 178.0,
"sulfureTrioxide" : 80.0,
"anhydroglucose" : 162.0,
"thioglucose_s03" : 242.0,
"thioglucose" : 196.0,
"glucosinolate_223" : 223.0
},
"daughterIons" : {
"C6H11O9S_259" : 259.0,
"C6H11O8S2_275" : 275.0,
"C6H9NO8S_241" : 241.0,
"C6H11O7S_227" : 227.0
},
"databaseReference" : {
"G01" : 406.029,
"G02" : 422.025,
"G03" : 358.027,
"G04" : 420.043,
"G05" : 436.039,
"G06" : 372.041,
"G07" : 388.035,
"G08" : 388.036,
"G09" : 434.06,
"G10" : 450.054,
"G11" : 386.056,
"G12" : 402.051,
"G13" : 448.077,
"G14" : 422.056,
"G15" : 438.052,
"G16" : 438.052,
"G17" : 438.052,
"G18" : 438.051,
"G19" : 447.051,
"G20" : 477.062,
"G21" : 477.061,
"G22" : 463.047,
"G23" : 463.046,
"G24" : 360.042,
"G25" : 360.042,
"G26" : 374.057,
"G27" : 374.057,
"G28" : 390.052,
"G29" : 390.052,
"G30" : 388.073,
"G31" : 402.088,
"G32" : 402.088,
"G33" : 402.088,
"G34" : 416.104,
"G35" : 416.104,
"G36" : 416.104
}
}
}

Loading

0 comments on commit 9c0fceb

Please sign in to comment.