Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
aa405ebc
Commit
aa405ebc
authored
Mar 24, 2015
by
Wai Yi Leung
Browse files
Merge branch 'patch-versioning' into 'develop'
Patch versioning For issue #143 See merge request !140
parents
9133b3b4
86604ddd
Changes
5
Hide whitespace changes
Inline
Side-by-side
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/BiopetExecutable.scala
View file @
aa405ebc
...
...
@@ -16,11 +16,13 @@
package
nl.lumc.sasc.biopet.core
import
java.io.
{
PrintWriter
,
StringWriter
}
import
java.util.Properties
import
nl.lumc.sasc.biopet.core.BiopetExecutable._
import
org.apache.log4j.Logger
import
scala.io.Source
import
org.apache.log4j.Logger
import
nl.lumc.sasc.biopet.
{
FullVersion
,
LastCommitHash
}
import
nl.lumc.sasc.biopet.core.BiopetExecutable._
trait
BiopetExecutable
extends
Logging
{
def
pipelines
:
List
[
MainCommand
]
...
...
@@ -49,7 +51,7 @@ trait BiopetExecutable extends Logging {
u
.
mkString
(
"\n\n"
)
}
"""
|Usage : java -jar
BiopetFramework
.jar {%s} <name> [args]
|Usage : java -jar
<path/to/biopet
.jar
>
{%s} <name> [args]
|Version : %s
|
|%s
...
...
@@ -59,7 +61,7 @@ trait BiopetExecutable extends Logging {
| - license
|
|Questions or comments? Email sasc@lumc.nl or check out the project page at https://git.lumc.nl/biopet/biopet.git
"""
.
stripMargin
.
format
(
modules
.
keys
.
mkString
(
","
),
get
Version
,
usage
)
"""
.
stripMargin
.
format
(
modules
.
keys
.
mkString
(
","
),
Full
Version
,
usage
)
}
def
checkModule
(
module
:
String
)
{
...
...
@@ -81,7 +83,7 @@ trait BiopetExecutable extends Logging {
args
match
{
case
Array
(
"version"
)
=>
{
println
(
"version: "
+
get
Version
)
println
(
"version: "
+
Full
Version
)
}
case
Array
(
"license"
)
=>
{
println
(
getLicense
)
...
...
@@ -118,30 +120,16 @@ trait BiopetExecutable extends Logging {
}
}
def
checkDirtyBuild
(
logger
:
Logger
)
{
val
prop
=
new
Properties
()
prop
.
load
(
getClass
.
getClassLoader
.
getResourceAsStream
(
"git.properties"
))
val
describeShort
=
prop
.
getProperty
(
"git.commit.id.describe-short"
)
if
(
describeShort
.
endsWith
(
"-dirty"
))
{
logger
.
warn
(
"**********************************************************"
)
logger
.
warn
(
"* This JAR was built while there are uncommited changes. *"
)
logger
.
warn
(
"* Reproducible results are *not* guaranteed. *"
)
logger
.
warn
(
"**********************************************************"
)
def
checkDirtyBuild
(
logger
:
Logger
)
:
Unit
=
if
(
LastCommitHash
.
endsWith
(
"-dirty"
))
{
logger
.
warn
(
"***********************************************************"
)
logger
.
warn
(
"* This JAR was built while there were uncommited changes. *"
)
logger
.
warn
(
"* Reproducible results are *not* guaranteed. *"
)
logger
.
warn
(
"***********************************************************"
)
}
}
}
object
BiopetExecutable
{
def
getVersion
=
{
getClass
.
getPackage
.
getImplementationVersion
+
" ("
+
getCommitHash
+
")"
}
def
getCommitHash
=
{
val
prop
=
new
Properties
()
prop
.
load
(
getClass
.
getClassLoader
.
getResourceAsStream
(
"git.properties"
))
prop
.
getProperty
(
"git.commit.id.abbrev"
)
}
def
getLicense
:
String
=
{
val
stream
=
getClass
.
getClassLoader
.
getResourceAsStream
(
"nl/lumc/sasc/biopet/License.txt"
)
Source
.
fromInputStream
(
stream
).
getLines
().
mkString
(
"\n"
,
"\n"
,
"\n"
)
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/ToolCommand.scala
View file @
aa405ebc
...
...
@@ -15,6 +15,8 @@
*/
package
nl.lumc.sasc.biopet.core
import
nl.lumc.sasc.biopet.FullVersion
/**
* Trait for biopet tools, sets some default args
*/
...
...
@@ -45,7 +47,7 @@ trait ToolCommand extends MainCommand with Logging {
sys
.
exit
(
1
)
}
text
(
"Print usage"
)
opt
[
Unit
](
'v'
,
"version"
)
foreach
{
_
=>
System
.
err
.
println
(
"Version: "
+
BiopetExecutable
.
get
Version
)
System
.
err
.
println
(
"Version: "
+
Full
Version
)
sys
.
exit
(
1
)
}
text
(
"Print version"
)
}
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/core/workaround/BiopetQCommandLine.scala
View file @
aa405ebc
...
...
@@ -45,23 +45,24 @@
package
nl.lumc.sasc.biopet.core.workaround
import
java.io.File
import
collection.JavaConversions._
import
java.io.
{
File
,
FileOutputStream
}
import
java.net.URL
import
java.util.
{
ResourceBundle
,
Arrays
}
import
org.apache.commons.io.FilenameUtils
import
org.broadinstitute.gatk.utils.commandline._
import
org.broadinstitute.gatk.queue.util._
import
org.broadinstitute.gatk.queue.
{
QCommandPlugin
,
QScript
,
QScriptManager
}
import
org.broadinstitute.gatk.queue.util.
{
Logging
=>
GatkLogging
}
import
org.broadinstitute.gatk.queue.engine.
{
QStatusMessenger
,
QGraphSettings
,
QGraph
}
import
collection.JavaConversions._
import
org.broadinstitute.gatk.utils.classloader.PluginManager
import
org.broadinstitute.gatk.utils.exceptions.UserException
import
org.broadinstitute.gatk.utils.io.IOUtils
import
org.broadinstitute.gatk.utils.help.ApplicationDetails
import
java.io.FileOutputStream
import
java.net.URL
import
java.util.
{
ResourceBundle
,
Arrays
}
import
org.broadinstitute.gatk.utils.text.TextFormattingUtils
import
org.apache.commons.io.FilenameUtils
import
nl.lumc.sasc.biopet.
core.BiopetExecutable
import
nl.lumc.sasc.biopet.
FullVersion
/**
* Entry point of Queue. Compiles and runs QScripts passed in to the command line.
...
...
@@ -291,7 +292,7 @@ class BiopetQCommandLine extends CommandLineProgram with Logging {
}
private
def
createQueueHeader
()
:
Seq
[
String
]
=
{
Seq
(
"Biopet version: "
+
BiopetExecutable
.
get
Version
,
""
,
Seq
(
"Biopet version: "
+
Full
Version
,
""
,
"Based on GATK Queue"
,
// String.format("Queue v%s, Compiled %s", getQueueVersion, getBuildTimestamp),
"Copyright (c) 2012 The Broad Institute"
,
...
...
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/package.scala
0 → 100644
View file @
aa405ebc
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project that are
* not part of GATK Queue is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license.
*/
package
nl.lumc.sasc
import
java.util.Properties
/**
* Common values and functions for the biopet package
*
* @author Wibowo Arindrarto <w.arindrarto@lumc.nl>
*/
package
object
biopet
{
/** Latest git commit hash, with '-dirty' appended if any uncommited changes were present */
val
LastCommitHash
:
String
=
{
val
prop
=
new
Properties
()
prop
.
load
(
getClass
.
getClassLoader
.
getResourceAsStream
(
"git.properties"
))
val
hash
=
prop
.
getProperty
(
"git.commit.id.abbrev"
)
if
(
prop
.
getProperty
(
"git.commit.id.describe-short"
).
endsWith
(
"-dirty"
))
s
"$hash-dirty"
else
hash
}
/** Package version */
// needs the Option here since the value is `null` when we run from an unpackaged JAR
val
Version
:
String
=
Option
(
getClass
.
getPackage
.
getImplementationVersion
).
getOrElse
(
"unpackaged"
)
/** Full version (raw version and latest commit hash) */
val
FullVersion
:
String
=
s
"$Version ($LastCommitHash)"
}
public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/Gentrap.scala
View file @
aa405ebc
...
...
@@ -16,7 +16,6 @@
package
nl.lumc.sasc.biopet.pipelines.gentrap
import
java.io.File
import
java.util.Properties
import
scala.language.reflectiveCalls
import
org.broadinstitute.gatk.queue.QScript
...
...
@@ -24,6 +23,7 @@ import org.broadinstitute.gatk.queue.function.QFunction
import
picard.analysis.directed.RnaSeqMetricsCollector.StrandSpecificity
import
scalaz._
,
Scalaz
.
_
import
nl.lumc.sasc.biopet.FullVersion
import
nl.lumc.sasc.biopet.core._
import
nl.lumc.sasc.biopet.core.config._
import
nl.lumc.sasc.biopet.core.summary._
...
...
@@ -234,16 +234,6 @@ class Gentrap(val root: Configurable) extends QScript with MultiSampleQScript wi
"isoform_fpkm_cufflinks_blind_heatmap"
->
isoFpkmCufflinksBlindHeatmapJob
)
private
def
version
:
String
=
{
val
baseVersion
=
getClass
.
getPackage
.
getImplementationVersion
val
commitHash
=
{
val
prop
=
new
Properties
()
prop
.
load
(
getClass
.
getClassLoader
.
getResourceAsStream
(
"git.properties"
))
prop
.
getProperty
(
"git.commit.id.abbrev"
)
}
s
"$baseVersion ($commitHash)"
}
/** Output summary file */
def
summaryFile
:
File
=
new
File
(
outputDir
,
"gentrap.summary.json"
)
...
...
@@ -268,7 +258,7 @@ class Gentrap(val root: Configurable) extends QScript with MultiSampleQScript wi
"strand_protocol"
->
strandProtocol
.
toString
,
"call_variants"
->
callVariants
,
"remove_ribosomal_reads"
->
removeRibosomalReads
,
"version"
->
v
ersion
"version"
->
FullV
ersion
)
/** Job for writing PDF report template */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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