This function inserts the PEP (Project-class
)
into the metadata slot of objects that
extend the Annotated-class
.insertPEP(object, pep)
object | an object of |
---|---|
pep | an object of class |
an object of the same class as the object argument but enriched with the metadata from the pep argument
Additionally, if the object extends the
Annotated-class
(or is a list that will be
automatically converted to a List
) the show method
for its class is redefined to display the Project-class
as the metadata.
# If the object is of class Annotated object = S4Vectors::List(result='test') result = .insertPEP(object, pepr::Project()) metadata(result)#> $PEP #> PEP project object. Class: Project #> file: #> samples: 0 #># If the object is not of class Annotated object1 = 'test' result1 = .insertPEP(object1, pepr::Project())#> Warning: BiocProject expects data loading functions to return an #> 'Annotated' object, but your function returned a 'character' object. Therefore, this returned object hasbeen placed in the first slot of a S4Vectors::Listmetadata(result1)#> $PEP #> PEP project object. Class: Project #> file: #> samples: 0 #>