Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional fdata and pdata in MSnSet constructor #386

Closed
const-ae opened this issue Dec 7, 2018 · 0 comments
Closed

Optional fdata and pdata in MSnSet constructor #386

const-ae opened this issue Dec 7, 2018 · 0 comments

Comments

@const-ae
Copy link
Contributor

const-ae commented Dec 7, 2018

Sometimes I would like to quickly create a test MSnSet. From my understanding currently the standard MSnSet constructor requires the user to provide an fdata and pdata data.frame. I think it would be great if empty data.frame would created internally, if fdata or pdata is missing

suppressPackageStartupMessages(library(MSnbase))

mat <- matrix(rnorm(10 * 6), nrow=10, ncol=6)
rownames(mat) <- paste0("protein_", 1:10)
colnames(mat) <- paste0("sample_", 1:6)

MSnSet(mat)
#> Error in MSnSet(mat): argument "fData" is missing, with no default

SummarizedExperiment::SummarizedExperiment(mat)
#> class: SummarizedExperiment 
#> dim: 10 6 
#> metadata(0):
#> assays(1): ''
#> rownames(10): protein_1 protein_2 ... protein_9 protein_10
#> rowData names(0):
#> colnames(6): sample_1 sample_2 ... sample_5 sample_6
#> colData names(0):

Created on 2018-12-07 by the reprex package (v0.2.1)

If you think it wouldn't be too difficult, I could try to make a PR.

@lgatto lgatto closed this as completed in 8ec63fa Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant