The generic function query()
is the interface for querying gene annotations from
a data base connection.
query(genes, connection)
# S4 method for character,ConnectionBiomart
query(genes, connection)
(character
)
gene IDs.
(connection class)
data base connection object.
A S4Vectors::DataFrame
with the gene annotations. It is required that:
The rownames
are identical to the input genes
.
The colnames
are equal to the annotation columns .row_data_annotation_cols
.
Therefore, missing information needs to be properly included in the DataFrame
with NA
entries.
A method is provided for the ConnectionBiomart
class. However, the framework
is extensible: It is simple to add new connections and corresponding query methods
for other data bases, e.g. company internal data bases. Please make sure to
follow the required format of the returned value.
The BioMart queries might not return information for all the genes. This can be due to different versions being used in the gene IDs and the queried Ensembl data base.
if (interactive()) {
object <- hermes_data
connection <- connect_biomart(prefix(object))
result <- query(genes(object), connection)
head(result)
head(annotation(object))
}