-
Notifications
You must be signed in to change notification settings - Fork 46
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
Valid row/colnames after reading mzTab #501
Comments
The naming in mzTab is looking for issues - that The reason why the names in the metadata are the way they are (illegal) is because they don't stem from a dataframe, are casted to a list and reshaped, thus preserving their illegality. How would you go about to use illegal column names? |
As shown above, the |
You would need to use backticks for the irregular names: > xx@Metadata$`assay[1]`
[1] "3injections_inj1_POS" The reason the colnames are "fixed" for the > make.names("assay[1]")
[1] "assay.1." If would be possible to unset this by setting > xx <- MzTab(fl) ## updated code
> xx
Object of class "MzTab".
Description:
Mode:
Type:
Available data: SmallMolecules
> names(xx@SmallMolecules)
[1] "SML_ID"
[2] "SMF_ID_REFS"
[3] "database_identifier"
[4] "chemical_formula"
[5] "smiles"
[6] "inchi"
[7] "chemical_name"
[8] "uri"
[9] "theoretical_neutral_mass"
[10] "adduct_ions"
[11] "reliability"
[12] "best_id_confidence_measure"
[13] "best_id_confidence_value"
[14] "abundance_assay[1]"
[15] "abundance_assay[2]"
[16] "abundance_assay[3]"
[17] "abundance_assay[4]"
[18] "abundance_assay[5]"
[19] "abundance_assay[6]"
[20] "abundance_study_variable[1]"
[21] "abundance_variation_study_variable[1]"
[22] "abundance_study_variable[2]"
[23] "abundance_variation_study_variable[2]"
[24] "opt_global_Progenesis_identifier" As above, the Is that what you are looking for to make it easier to write back MzTab data? |
Unusual bug report: when reading mzTab as in https://github.com/lgatto/MSnbase/blob/master/tests/testthat/test_MzTab.R#L9, I am getting valid names in e.g.
Which means I can't use 'em as-is when writing mzTab back out to file.
I'd have to do some string-foo and search&replace numbers enclosed in '.',
and even that could go wrong under some conditions.
OTOH the metadata names are fine (actually: illegal in R):
=> I'd like to propose to accept and use the illegal row/col names when it comes to mzTab,
and deal with it in the downstream code where that happens.
Objections ?
Yours, Steffen
The text was updated successfully, but these errors were encountered: