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

Conflicting feature variable names when using combineFeatures twice with CV #303

Closed
lgatto opened this issue Jan 26, 2018 · 3 comments
Closed

Comments

@lgatto
Copy link
Owner

lgatto commented Jan 26, 2018

See this question for details:

  1. calling combineFeatures (with CV = TRUE) to combine spectra to peptides generates fvarLabels CV.TMT6.126 ...
  2. calling combineFeatures (with CV = TRUE) to combine peptides to proteins tries to generate fvarLabels CV.TMT6.126 ... and fails with error
Error in value[[3L]](cond) : duplicate 'row.names' are not allowed
  AnnotatedDataFrame 'initialize' could not update varMetadata:
  perhaps pData and varMetadata are inconsistent?
In addition: Warning message:
non-unique values when setting 'row.names': ‘CV.TMT6.126’, ‘CV.TMT6.127’, ‘CV.TMT6.128’, ‘CV.TMT6.129’, ‘CV.TMT6.130’, ‘CV.TMT6.131’

TODO

  1. better error message
  2. if CV fvarLabels are already present, add a suffix.
@PDiracDelta
Copy link

PDiracDelta commented Jan 29, 2018

For me, putting CV = FALSE does not resolve the issue. However, solution 2 mentioned in your answer to the mentioned question does work.

@lgatto
Copy link
Owner Author

lgatto commented Jan 29, 2018

As noted on the support site, it should be cv in lower case:

> 
> library("MSnbase")
> library("rpx")
> px1 <- PXDataset("PXD000001")
> mztab <- pxget(px1, "PXD000001_mztab.txt")
Downloading 1 file
/home/lg390/tmp/PXD000001_mztab.txt already present.
> spec <- readMzTabData(mztab, what = "PEP", version = "0.9")
Warning message:
Version 0.9 is deprecated. Please see '?readMzTabData' and '?MzTab' for details. 
> pep <- combineFeatures(spec, groupBy = fData(spec)$sequence, fun = sum)
> ## expecting error
> prot <- combineFeatures(pep, groupBy = fData(pep)$accession, fun = sum)
Error in value[[3L]](cond) : duplicate 'row.names' are not allowed
  AnnotatedDataFrame 'initialize' could not update varMetadata:
  perhaps pData and varMetadata are inconsistent?
In addition: Warning message:
non-unique values when setting 'row.names':CV.sub[1]’, ‘CV.sub[2]’, ‘CV.sub[3]’, ‘CV.sub[4]’, ‘CV.sub[5]’, ‘CV.sub[6]’ 
> ## now works
> prot <- combineFeatures(pep, groupBy = fData(pep)$accession, fun = sum, cv = FALSE)

I'll still see to make some changes in the package to avoid this, or at least make it explicit why the error happens.

lgatto pushed a commit that referenced this issue Apr 4, 2018
@lgatto lgatto closed this as completed Apr 4, 2018
@lgatto
Copy link
Owner Author

lgatto commented Apr 4, 2018

This is now properly addressed. If there is already a set of CV feature variables, the new set will be suffixed with a .1 (or .2, ... if the previous index already exists).

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

2 participants