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
4cd2f2d5
Commit
4cd2f2d5
authored
Mar 04, 2015
by
bow
Browse files
Add templates for plotting scripts and their wrappers
parent
b660ab1c
Changes
4
Hide whitespace changes
Inline
Side-by-side
public/gentrap/src/main/resources/nl/lumc/sasc/biopet/pipelines/gentrap/scripts/plot_heatmap.R
0 → 100755
View file @
4cd2f2d5
#!/usr/bin/env Rscript
#
# Script for plotting heatmap for the Gentrap pipeline
# General function to install package if it does not exist
# Otherwise, it only loads the package
usePackage
<-
function
(
p
)
{
r
<-
getOption
(
"repos"
)
r
[
"CRAN"
]
<-
"http://cran.us.r-project.org"
options
(
repos
=
r
)
rm
(
r
)
if
(
!
is.element
(
p
,
installed.packages
()[,
1
]))
install.packages
(
p
,
dep
=
TRUE
)
require
(
p
,
character.only
=
TRUE
)
}
usePackage
(
"getopt"
)
usePackage
(
"edgeR"
)
usePackage
(
"ggplot2"
)
usePackage
(
"gplots"
)
usePackage
(
"grid"
)
usePackage
(
"jsonlite"
)
usePackage
(
"reshape2"
)
usePackage
(
"MASS"
)
usePackage
(
"RColorBrewer"
)
# create spec for arg parsing
spec
<-
matrix
(
c
(
# input table (merge of all samples)
'input-table'
,
'I'
,
1
,
'character'
,
# output plot file
'output-plot'
,
'O'
,
1
,
'character'
,
# perform TMM-normalization (only if we are dealing with count data)
'tmm-normalize'
,
'T'
,
0
,
'logical'
# help
'help'
,
'H'
,
0
,
'logical'
),
byrow
=
TRUE
,
ncol
=
4
)
opt
<-
getopt
(
spec
)
# print help if requested
if
(
!
is.null
(
opt
[[
'help'
]]))
{
cat
(
getopt
(
spec
,
usage
=
TRUE
))
q
(
status
=
1
)
}
public/gentrap/src/main/resources/nl/lumc/sasc/biopet/pipelines/gentrap/scripts/plot_pca.R
0 → 100755
View file @
4cd2f2d5
#!/usr/bin/env Rscript
#
# Script for plotting PCA plots for the Gentrap pipeline
# General function to install package if it does not exist
# Otherwise, it only loads the package
usePackage
<-
function
(
p
)
{
r
<-
getOption
(
"repos"
)
r
[
"CRAN"
]
<-
"http://cran.us.r-project.org"
options
(
repos
=
r
)
rm
(
r
)
if
(
!
is.element
(
p
,
installed.packages
()[,
1
]))
install.packages
(
p
,
dep
=
TRUE
)
require
(
p
,
character.only
=
TRUE
)
}
usePackage
(
"getopt"
)
usePackage
(
"edgeR"
)
usePackage
(
"ggplot2"
)
usePackage
(
"gplots"
)
usePackage
(
"grid"
)
usePackage
(
"jsonlite"
)
usePackage
(
"reshape2"
)
usePackage
(
"MASS"
)
usePackage
(
"RColorBrewer"
)
# create spec for arg parsing
spec
<-
matrix
(
c
(
# input table (merge of all samples)
'input-table'
,
'I'
,
1
,
'character'
,
# output plot file
'output-plot'
,
'O'
,
1
,
'character'
,
# perform TMM-normalization (only if we are dealing with count data)
'tmm-normalize'
,
'T'
,
0
,
'logical'
# help
'help'
,
'H'
,
0
,
'logical'
),
byrow
=
TRUE
,
ncol
=
4
)
opt
<-
getopt
(
spec
)
# print help if requested
if
(
!
is.null
(
opt
[[
'help'
]]))
{
cat
(
getopt
(
spec
,
usage
=
TRUE
))
q
(
status
=
1
)
}
public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/scripts/PlotHeatmap.scala
0 → 100644
View file @
4cd2f2d5
/**
* Copyright (c) 2014 Leiden University Medical Center
*
* @author Wibowo Arindrarto
*/
package
nl.lumc.sasc.biopet.pipelines.gentrap.scripts
import
java.io.File
import
nl.lumc.sasc.biopet.core.config.Configurable
import
nl.lumc.sasc.biopet.extensions.RScriptCommandLineFunction
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
/**
* Wrapper for the plot_heatmap.R script, used internally in Gentrap
*/
class
PlotHeatmap
(
val
root
:
Configurable
)
extends
RScriptCommandLineFunction
{
setRScript
(
"plot_heatmap.R"
,
"/nl/lumc/sasc/biopet/pipelines/gentrap/scripts/"
)
@Input
(
doc
=
"Input table"
,
required
=
true
)
var
input
:
File
=
null
@Output
(
doc
=
"Output plot"
,
required
=
false
)
var
output
:
File
=
null
var
tmmNormalize
:
Boolean
=
config
(
"tmm_normalize"
,
default
=
false
)
def
cmdLine
=
{
RScriptCommand
+
conditional
(
tmmNormalize
,
"-T"
)
+
required
(
"-I"
,
input
)
+
required
(
"-O"
,
output
)
}
}
public/gentrap/src/main/scala/nl/lumc/sasc/biopet/pipelines/gentrap/scripts/PlotPca.scala
0 → 100644
View file @
4cd2f2d5
/**
* Copyright (c) 2014 Leiden University Medical Center
*
* @author Wibowo Arindrarto
*/
package
nl.lumc.sasc.biopet.pipelines.gentrap.scripts
import
java.io.File
import
nl.lumc.sasc.biopet.core.config.Configurable
import
nl.lumc.sasc.biopet.extensions.RScriptCommandLineFunction
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
/**
* Wrapper for the plot_pca.R script, used internally in Gentrap
*/
class
PlotPca
(
val
root
:
Configurable
)
extends
RScriptCommandLineFunction
{
setRScript
(
"plot_pca.R"
,
"/nl/lumc/sasc/biopet/pipelines/gentrap/scripts/"
)
@Input
(
doc
=
"Input table"
,
required
=
true
)
var
input
:
File
=
null
@Output
(
doc
=
"Output plot"
,
required
=
false
)
var
output
:
File
=
null
var
tmmNormalize
:
Boolean
=
config
(
"tmm_normalize"
,
default
=
false
)
def
cmdLine
=
{
RScriptCommand
+
conditional
(
tmmNormalize
,
"-T"
)
+
required
(
"-I"
,
input
)
+
required
(
"-O"
,
output
)
}
}
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