Learn R Programming

PerseusR

Convenience functions for interop between Perseus and R.

Designed to work with the PluginInterop plugin for the Perseus framework.

Citation

If you use PerseusR in your projects, please cite

Rudolph, J D and Cox, J 2018, A network module for the Perseus software for computational proteomics facilitates proteome interaction graph analysis doi:10.1101/447268

Installation

Make sure to have R >= 3.5.0 installed. Paste the following lines into an running R session. You can skip the comment lines starting with #.

# installing BioConductor dependencies first
install.packages('BiocManager')
BiocManager::install('Biobase')

# installing PerseusR
install.packages('PerseusR')

Usage

PerseusR provides two functions for reading and writing files from/to Perseus. You can use them to write simple scripts which can be used as MatrixProcessing activities in Perseus. Additionally you can parse Perseus parameters and extract their values.

an example R script that could be called though the Perseus plugin:

# if applicable: read command-line arguments
args = commandArgs(trailingOnly=TRUE)
if (length(args) != 3) {
	stop("Should provide three arguments: parameters inFile outFile", call.=FALSE)
}
paramFile <- args[1]
inFile <- args[2]
outFile <- args[3]

library(PerseusR)
# extract parameters
parameters <- parseParameters(paramFile)
networkType <- singleChoiceParamValue(parameters, "Network type")
corFnc <- singleChoiceParamValue(parameters, "Correlation function")
power <- intParamValue(parameters, "Power")
# read data
mdata <- read.perseus(inFile)

# if additional matrices are included, the additional information like imputation can be extracted.
imputeMatrix <- imputeData(mdata)
qualityMatrix <- qualityData(mdata)

# run any kind of analysis
library(WGCNA)
net <- blockwiseModules(t(main(mdata)), power = power, corFnc = corFnc, networkType = networkType)
c1 <- net$dendrograms[[1]]
df <- as.data.frame(cbind(c1$merge, c1$height))
colnames(df) <- c('left', 'right', 'distance')

# save results to matrixData and write to file
outMdata <- matrixData(main=df)
write.perseus(outMdata, outFile)

# save results to matrixData and write to file with additional matrices

outdata <- matrixData(main = combine, imputeData = imputeMatrix, qualityData = qualityMatrix)
write.perseus(outMdata, outFile)

Licensing and contributions

PerseusR is licensed under the MIT license. Contributions are welcome.

Copy Link

Version

Install

install.packages('PerseusR')

Monthly Downloads

136

Version

0.3.4

License

MIT + file LICENSE

Maintainer

Jan Rudolph

Last Published

November 5th, 2018

Functions in PerseusR (0.3.4)

annotRows<-

Set annotation rows
imputeData

Get imputation of main data frame
infer_perseus_annotation_types

Infer Perseus type annotation row from DataFrame column classes
imputeData<-

Set imputation of main data frame
matrixData

matrixData constructor
names.matrixData

Column names of main and annotation columns
description

Get column description
initialize,matrixData-method

matrixData initializer
intParamValue

Int parameter value
parseParameters

Parse parameters
qualityData<-

Set quality values of main data frame
main<-

Set main columns
main

Get main columns
write.perseus

write.perseus: function to generate a perseus-readable text document
qualityData

Get quality values of main data frame
matrixData-class

MatrixData
names,matrixData-method

Get names
read.perseus.default

Read Perseus matrix files
singleChoiceParamInd

Single choice index
singleChoiceParamValue

Single choice value
as.ExpressionSet.matrixData

Coerces a MatrixData into an ExpressionSet
annotRows

Get annotation rows
create_annotRows

Create annotation rows
description<-

Set column description
as.matrixData.ExpressionSet

Coerces an ExpressionSet into a MatrixData
boolParamValue

Bool parameter value
MatrixDataCheck

MatrixDataCheck: a function to check the validity of an object as a perseus data frame
annotCols<-

Set annotation columns
annotCols

Get annotation columns