data.frame2mti: Convert data.frames to MTI classes and _vice versa_

Description Usage Arguments Details Value Author(s) See Also Examples

Description

These function allow to create MTI (miRNA target gene interaction) objects from data.frames) or to export the contents of a MTI object (along with the stored Report object(s)) as a (single or multi-row) data.frame.

Usage

1
2
3
data.frame2mti( x, colname.id="mirtarbase_id", colname.mirna="mirna", colname.mirna.species="species_mirna", colname.target="target_gene", colname.target.entrezid="target_gene_entrez_gene_id", colname.target.species="species_target_gene", do.unique=TRUE )

mti2data.frame( x, colname.id="mirtarbase_id", colname.mirna="mirna", colname.mirna.species="species_mirna", colname.target="target_gene", colname.target.entrezid="target_gene_entrez_gene_id", colname.target.species="species_target_gene", collapse.reports=NULL, stringsAsFactors=FALSE, row.names=NULL )

Arguments

x
colname.id

the column name in the data.frame containing the miRTarBase identifiers.

colname.mirna

the column name in the data.frame containing the mature miRNA name.

colname.mirna.species

the column name in the data.frame containing the species name of the miRNA.

colname.target

the column name in the data.frame containing the target gene's official symbol.

colname.target.entrezid

the column name in the data.frame containing the target gene's NCBI Entrezgene identifier.

colname.target.species

the column name in the data.frame containing the species of the target gene.

do.unique

whether a unique list of MTI objects should be generated from the data.frame.

collapse.reports

if not NULL multiple reports providing evidence for the MTI are joined into a single row for the MTI, with the character provided by collapse.reports being used as a separator. In that case the resulting data.frame contains only unique MTIs (one row for each MTI).

stringsAsFactors

whether character strings should be automatically converted to factors.

row.names

would allow to set the row.names of the data.frame.

Details

This are helper functions that allow to transform data.frames into objects and vice versa.

Value

A data.frame or a list of MTI objects.

Author(s)

Johannes Rainer

See Also

data.frame2report, report2data.frame, MTI

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## get all miRNA target gene interactions (MTI) for BCL2L11 using a SQL
## query.
## Note, that we get the same MTI in multiple rows, if this MTI has been
## described in more than one publication:
con <- getMtiCon()
Res <- dbGetQuery( con, "select * from mirtarbase where target_gene='BCL2L11'" )

## the same MTI, but more than one publication.
Res[ Res$mirtarbase_id=="MIRT001206", c( "mirna", "target_gene", "references_pmid" ) ]

## create a list of MTI objects.
## Note that the reports are NOT added to the report slot of the MTI objects.
MTIs <- data.frame2mti( Res )
nrow( Res )
length( MTIs )
## MTIs contains only unique list of MTIs

## convert it again to a data.frame
DF <- do.call( "rbind", lapply( MTIs, mti2data.frame ) )
nrow( DF )

jotsetung/mirtarbase-db documentation built on May 19, 2019, 9:42 p.m.