Coder Social home page Coder Social logo

perseusr's Introduction

PerseusR

Travis-CI Build Status CRAN_Status_Badge

This repository contains the source code of the PerseusR software package. PerseusR contains convenience functions which allow for faster and easier development of plugins for Perseus in the R programming language. This page contains developer information on PerseusR, for high-level information please refer to the manuscript listed below.

PerseusR was designed to work in conjunction with the PluginInterop plugin, but can also be used stand-alone.

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 #.

install.packages(“BiocManager”)
BiocManager::install(“Biobase”)

# installing devtools first
install.packages("devtools")

# install PerseusR via devtools
library(devtools)
install_github("cox-labs/PerseusR")

Developing plugins

Perseus provides activities to call R scripts from within the workflow via PluginInterop, e.g. Matrix => R. Developing a plugin therefore translates to writing an R script that follows a small set of conventions. By adhering to these conventions, Perseus will be able to successfully communicate with R and transfer inputs and results between the programs. PerseusR provides the neccessary functions to make plugin development in R easy and straight forward.

This example R script adds 1 to all main columns in the matrix. While its functionality is very simple. It can serve as a starting point for more extensive scripts.

# All plugins can be split into 3 parts
# 1. Reading the command line arguments provided by Perseus and parsing the data.
# 2. Perform the desired functionality on the data.
# 3. Write the results to the expected locations in the Perseus formats.

# 1. Parse command line arguments passed in from Perseus,
# including input file and output file paths.
args = commandArgs(trailingOnly=TRUE)
if (length(args) != 2) {
	stop("Do not provide additional arguments!", call.=FALSE)
}
inFile <- args[1]
outFile <- args[2]


# Use PerseusR to read and write the data in Perseus text format.
library(PerseusR)
mdata <- read.perseus(inFile)

# The mdata object can be easily deconstructed into a number of different
# data frames. Check reference manual or help() for full list.
mainMatrix <- main(mdata)

# 2. Run any kind of analysis on the extracted data.
df <- mainMatrix + 1

# 3. Create a matrixData object which can be conveniently written to file
# in the Perseus txt format.
outMdata <- matrixData(main=df)
write.perseus(outMdata, outFile)

Licensing and contributions

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

perseusr's People

Contributors

danielaferretti1992 avatar jdrudolph avatar jspaezp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

perseusr's Issues

Issues with installation

Many of the dependencies are perhaps not supported in the latest R version and its failing to install. I am trying on versions >4.
The error I am getting: ERROR: dependency 'XML' is not available for package 'PerseusR'

Version compatibility

Dear Perseus Developer -

I am currently using Perseus 2.1.2.0. I tried to open an old session that was created with Perseus 1.6.13.0 but the current version failed to open it. Could you please advise of how to open the session that was created with a previous Perseus version?
Thanks for your assistance.
CT.

MaxQuant - second peptide search vs DEP (Persus)

Hi All.
This issue is regarding few questions related to MaxQuant (v2.1.0.0).
I am trying MaxQuant for trial data. Our data consists of 35 samples (15 controls and 20 diseased samples). Each file size is ~4.8Gbs.
I changed the parameters in mqpar.xml (file attached) according to the experimental setup.
Maxquant ran for around 2 days and the disk space ran out (~7 Tbs). When we checked log, the last step it was undergoing is 'Second peptide Search'. Does second peptide search create huge intermediate files and takes this much time? And is 'second peptide search' really necessary for MS data processing? Will disabling it effects DEP analysis in Persus?

mqpar - Copy.txt

Column descriptions interfere / get out-of-sync when adding/removing columns in matrixData

Keeping track of column descriptions is not really possible at the moment. The following code will fail.

df <- matrixData(main=data.frame(a=1:3, b=6:8), description=c('a', 'b'))
main(df)['c'] <- 9:11

The only workaround currently is deleting all descriptions

description(df) <- character(0)

Maybe converting description to a list would make it easier to keep track of the column name -> description mapping. This is low priority for now. A test with warning was added in ae49bbe to keep track of this issue.

Perseus Does not want to save file after running an R script.

I ran the 'Remove batch effect' function via R, and it works fine, although after generating a batch-corrected matrix, I get an error when I want to save the perseus file.

Steps:
Create random matrix --> 'matrix 1' --> remove batch effect --> 'matrix 2' --> save --> error.

Error: 'Failed to write session.' and then "Type 'PluginInterop.Utils+<>c__DisplayClass2_0'in Assembly 'PluginInterop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable"

What can I do to fix this?

Thanks a lot in advance!

Screenshot:
error

Installation not working

Running install_github('jdrudolph/PerseusR') in order to install in R 3.5.1 results in the following error:
Error in read.dcf(path) :
Found continuation line starting ' R (>= 3.3.0) ...' at begin of record.

Not sure how to rectify.

StartUp error

Unable to run a basic example, possibly due to some kind of config problem?

Perseus 1.6.5.0, R 3.6.1. The data matrix was from a "proteinGroups.txt" table.

"Example1.R"

args = commandArgs(trailingOnly = TRUE)
if (length(args) != 3) {
stop("Do not provide additional arguments!", call.=FALSE)
}
num <- as.integer(args[1])
inFile <- args[2]
outFile <- args[3]
library(PerseusR)
mdata <- read.perseus(inFile)
counts <- main(mdata)
mdata2 <- head(counts, n=num)
aCols <- head(annotCols(mdata), n=num)
mdata2 <- matrixData(main=mdata2, annotCols=aCols, annotRows=annotRows(mdata))
print(paste('writing to', outFile))
write.perseus(mdata2, outFile)

Screen Shot 2019-07-26 at 3 01 02 PM

How to operate non-numeric column?

I can convert Majority.Protein.IDs into one reviewed ID for each row in R. In perseus, Expression columns and one Majority.protien.IDs column were input as main column. However, the Majority.Protein.IDs were not considered as numeric when using Rscipt.

So, how can I convert Majority.protein.IDs into one reviewed ID for each row in Perseus?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.