One emeScheme object can contain metadata for multiple dataFiles. For archiving, these should be split into single emeScheme objects, one for each DataFileNameMetaData$dataFileName. This function extracts the metadasta from one dataFile in an emeScheme object and returns an emeScheme object.

emeScheme_extract(dataFile, x)

Arguments

dataFile

name of dataFile whose metadata will be extracted from x. Has to be an exact match, no wildcards are expanded.

x

emeScheme object from which to extract the metadata

Value

An emeScheme object containing metadata for the data file dataFileName

Details

The filtering is done as followed:

DataFileMetaDFata

DataFileMetaData$dataFileName == dataFile

Treatment

Treatment$parameter %in% DataFileMetaData$mappingColumn and DataFileMetaData$columnData == "Treatment"

Measurement

Measurement$name %in% DataFileMetaData$mappingColumn and DataFileMetaData$columnData == "Measurement"

Examples

emeScheme_extract("smell.csv", dmdScheme_example())
#> smell.csv_emeScheme - dmdSchemeSet #> MdBibliometric - dmdSchemeData #> A Names : uploadType | doi | publicationDate | title | description | version | language | keywords | additionalNotes | accessRights | accessRightsInfo | license #> A Units : #> A Type : character | character | character | character | character | character | character | character | character | character | character | character #> #> uploadType doi publicationDate title #> D 1 Dataset 110.1234/ffoo.bar 2020-05-26 Microbes under Pressure #> description #> D 1 The dataset was generated by putting microbes under pressure through temperatue and oxygen changes and their changes ion abundance were observed. #> version language #> D 1 <NA> eng #> keywords #> D 1 microbes, temperatur change, oxygen changes, abundance #> additionalNotes accessRights accessRightsInfo #> D 1 <NA> Open <NA> #> license #> D 1 Creative Commons Attribution 4.0 International #> #> MdAuthors - dmdSchemeData #> A Names : authorID | familyName | givenName | affiliation | orcid | role #> A Units : NA | NA | NA | NA | NA | NA #> A Type : character | character | character | character | character | character #> #> authorID familyName givenName affiliation orcid #> D 1 1 Petchey Owen L. University of Zurich, Switzerland <NA> #> D 2 2 Krug Rainer M. University of Zurich, Switzerland <NA> #> role #> D 1 Conceptualization, Investigation #> D 2 Data curation #> #> Experiment - dmdSchemeData #> A Names : name | temperature | light | humidity | incubator | container | microcosmVolume | mediaType | mediaConcentration | cultureConditions | comunityType | mediaAdditions | duration | comment #> A Units : NA | NA | NA | NA | NA | NA | ml | NA | g/l | NA | NA | NA | days | NA #> A Type : character | character | character | character | character | character | numeric | character | numeric | character | character | character | integer | character #> #> name temperature light humidity incubator #> D 1 ASR-expt1 20 semi-ambient ambient not given here #> container microcosmVolume mediaType #> D 1 Duran type bottle, red lids, 250ml 100 PPM #> mediaConcentration cultureConditions comunityType #> D 1 0.55 dirty initially unknown #> mediaAdditions #> D 1 Wheat seeds added on specific dates, see file wheat_seed_additions.csv #> duration comment #> D 1 100 <NA> #> #> Species - dmdSchemeData #> A Names : speciesID | name | strain | source | density | functionalGroup | comment #> A Units : NA | NA | NA | NA | cells / ml | NA | NA #> A Type : character | character | character | character | character | character | character #> #> speciesID name strain source #> D 1 tt_1 Tetrahymena thermophila WH-6 (WHI) [ATCC 16539] ATCC #> D 2 unknown unknown unknown unknown #> density functionalGroup #> D 1 1 bacterivore #> D 2 <NA> unknown #> comment #> D 1 http://www.lgcstandards-atcc.org/products/all/30007.aspx #> D 2 <NA> #> #> Treatment - dmdSchemeData #> A Names : treatmentID | unit | treatmentLevel | comment #> A Units : NA | NA | NA | NA #> A Type : character | character | character | character #> #> treatmentID unit treatmentLevel comment #> D 1 Lid_treatment None Loose <NA> #> D 2 Lid_treatment <NA> Tight <NA> #> D 3 species_1 speciesID tt_1, unknown <NA> #> #> Measurement - dmdSchemeData #> A Names : measurementID | variable | method | unit | object | noOfSamplesInTimeSeries | samplingVolume | dataExtractionID | measuredFrom | comment #> A Units : NA | NA | NA | NA | NA | NA | ml | NA | NA | NA #> A Type : character | character | character | character | character | integer | numeric | character | character | character #> #> measurementID variable method unit object #> D 1 smell smell nose rotten eggs or not community #> noOfSamplesInTimeSeries samplingVolume dataExtractionID measuredFrom #> D 1 6 0 none raw #> comment #> D 1 <NA> #> #> DataExtraction - dmdSchemeData #> A Names : dataExtractionID | method | parameter | value | comment #> A Units : NA | NA | NA | NA | NA #> A Type : character | character | character | character | character #> #> D ###### No Data in dmdSchemeData ###### #> #> DataFileMetaData - dmdSchemeData #> A Names : dataFileName | columnName | columnData | mappingColumn | type | description | comment #> A Units : NA | NA | NA | NA | NA | NA | NA #> A Type : character | character | character | character | character | character | character #> #> dataFileName columnName columnData mappingColumn type #> D 1 smell.csv <NA> Species species_1 character #> D 2 smell.csv smell Measurement smell character #> D 3 smell.csv Date other <NA> datetime #> D 4 smell.csv Lid_treatment Treatment Lid_treatment character #> D 5 smell.csv Jar_type other <NA> character #> description comment #> D 1 <NA> <NA> #> D 2 <NA> <NA> #> D 3 ymdhms <NA> #> D 4 <NA> <NA> #> D 5 <NA> <NA> #>
## returns the emeScheme data for the data file 'smell.csv' emeScheme_extract("DoesNotExist", dmdScheme_example())
#> DoesNotExist_emeScheme - dmdSchemeSet #> MdBibliometric - dmdSchemeData #> A Names : uploadType | doi | publicationDate | title | description | version | language | keywords | additionalNotes | accessRights | accessRightsInfo | license #> A Units : #> A Type : character | character | character | character | character | character | character | character | character | character | character | character #> #> uploadType doi publicationDate title #> D 1 Dataset 110.1234/ffoo.bar 2020-05-26 Microbes under Pressure #> description #> D 1 The dataset was generated by putting microbes under pressure through temperatue and oxygen changes and their changes ion abundance were observed. #> version language #> D 1 <NA> eng #> keywords #> D 1 microbes, temperatur change, oxygen changes, abundance #> additionalNotes accessRights accessRightsInfo #> D 1 <NA> Open <NA> #> license #> D 1 Creative Commons Attribution 4.0 International #> #> MdAuthors - dmdSchemeData #> A Names : authorID | familyName | givenName | affiliation | orcid | role #> A Units : NA | NA | NA | NA | NA | NA #> A Type : character | character | character | character | character | character #> #> authorID familyName givenName affiliation orcid #> D 1 1 Petchey Owen L. University of Zurich, Switzerland <NA> #> D 2 2 Krug Rainer M. University of Zurich, Switzerland <NA> #> role #> D 1 Conceptualization, Investigation #> D 2 Data curation #> #> Experiment - dmdSchemeData #> A Names : name | temperature | light | humidity | incubator | container | microcosmVolume | mediaType | mediaConcentration | cultureConditions | comunityType | mediaAdditions | duration | comment #> A Units : NA | NA | NA | NA | NA | NA | ml | NA | g/l | NA | NA | NA | days | NA #> A Type : character | character | character | character | character | character | numeric | character | numeric | character | character | character | integer | character #> #> name temperature light humidity incubator #> D 1 ASR-expt1 20 semi-ambient ambient not given here #> container microcosmVolume mediaType #> D 1 Duran type bottle, red lids, 250ml 100 PPM #> mediaConcentration cultureConditions comunityType #> D 1 0.55 dirty initially unknown #> mediaAdditions #> D 1 Wheat seeds added on specific dates, see file wheat_seed_additions.csv #> duration comment #> D 1 100 <NA> #> #> Species - dmdSchemeData #> A Names : speciesID | name | strain | source | density | functionalGroup | comment #> A Units : NA | NA | NA | NA | cells / ml | NA | NA #> A Type : character | character | character | character | character | character | character #> #> D ###### No Data in dmdSchemeData ###### #> #> Treatment - dmdSchemeData #> A Names : treatmentID | unit | treatmentLevel | comment #> A Units : NA | NA | NA | NA #> A Type : character | character | character | character #> #> D ###### No Data in dmdSchemeData ###### #> #> Measurement - dmdSchemeData #> A Names : measurementID | variable | method | unit | object | noOfSamplesInTimeSeries | samplingVolume | dataExtractionID | measuredFrom | comment #> A Units : NA | NA | NA | NA | NA | NA | ml | NA | NA | NA #> A Type : character | character | character | character | character | integer | numeric | character | character | character #> #> D ###### No Data in dmdSchemeData ###### #> #> DataExtraction - dmdSchemeData #> A Names : dataExtractionID | method | parameter | value | comment #> A Units : NA | NA | NA | NA | NA #> A Type : character | character | character | character | character #> #> D ###### No Data in dmdSchemeData ###### #> #> DataFileMetaData - dmdSchemeData #> A Names : dataFileName | columnName | columnData | mappingColumn | type | description | comment #> A Units : NA | NA | NA | NA | NA | NA | NA #> A Type : character | character | character | character | character | character | character #> #> D ###### No Data in dmdSchemeData ###### #>
## returns an empty emeScheme