Entering edit mode
Guest User
★
13k
@guest-user-4897
Last seen 9.6 years ago
Hi there,
I am new to Galaxy, and would like to create some tools that use some
of my existing R scripts. I have played around with the example code,
and have found this to be OK, however I am now having problems
creating my own tools to use on Galaxy. My interest is in a user being
able to upload a gene expression dataset, and then be able to carry
out some functions using Galaxy for gene regulatory network inference
and analysis.
The first simple tool that I would like to create is a correlation
matrix from a gene expression dataset that the user uploads to Galaxy.
I have created the .Rd file, called corMat.Rd,which is as follows:
\name{corMat}
\alias{corMat}
\title{a corMat function}
\usage{
corMat(inputfile = GalaxyInputFile(),
outputfile = GalaxyOutput("mydata"," csv"))
}
\arguments{
\item{input}{An input dataset}
\item{output}{the output}
}
\description{
A correlation matrix function
}
\details{
nothing
}
I then defined the corMat function in R, which is as follows:
corMat <- function (inputfile = GalaxyInputFile(),
outputfile = GalaxyOutput("mydata", "csv"))
{
data1 <- tryCatch({
as.matrix(read.delim(inputfile1, row.names = 1))
}, error = function(err) {
stop("failed to read first data file: ",
conditionMessage(err))
})
data2 <- cor(data1)
write.csv(data2, file = outputfile)
}
To carry this out, I wish to use the cor function in the package
WGCNA, so I then have put the following code into R:
galaxy(
corMat,
manpage="/home/adminuser/galaxy-dist/tools/Network/corMat.Rd",
package="WGCNA",
is.exported="TRUE",
version="0.1",
name="Correlation Matrix",
galaxyConfig=GalaxyConfig(
galaxyHome=path.expand("~/galaxy-dist"),
toolDir="tools/Network",
sectionName="Network",
sectionId="NetworkId")
)
However, this does not compile, and gives me the error message:
Error in newXMLTextNode(title) :
CHAR() can only be applied to a 'CHARSXP', not a 'NULL'
This error seems to occur when I change the name of the package from
RGalaxy to anything else, however I need to change this to WGCNA to
specify where to find the function cor that I use in the corMat
function I have written for Galaxy. I am obviously making a mistake
somewhere, however I cannot see where this error is. Would you be able
to help me with this? I can see the power of having a web based user
interface that can carry out powerful and intensive biomedical
applications in an easy to use format, so am keen to get this to work.
Kind regards,
Alex
-- output of sessionInfo():
R version 2.14.1 (2011-12-22)
Platform: i686-pc-linux-gnu (32-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] parallel splines tools stats graphics grDevices
[7] utils datasets methods base
other attached packages:
[1] WGCNA_1.25-2 doParallel_1.0.1 iterators_1.0.6
[4] foreach_1.4.0 MASS_7.3-16 reshape_0.8.4
[7] plyr_1.8 cluster_1.14.1 Hmisc_3.10-1
[10] survival_2.36-10 flashClust_1.01-2 dynamicTreeCut_1.21
[13] impute_1.28.0 RGalaxy_1.0.0 digest_0.6.3
[16] optparse_1.0.1 XML_3.95-0.1
loaded via a namespace (and not attached):
[1] Biobase_2.14.0 BiocGenerics_0.4.0 brew_1.0-6
[4] codetools_0.2-8 getopt_1.19.0 grid_2.14.1
[7] lattice_0.20-0 roxygen2_2.2.2 stringr_0.6.2
--
Sent via the guest posting facility at bioconductor.org.