split_emeta: Splits an e_meta column into separate columns

Description Usage Arguments Value Author(s) Examples

Description

This function can take one large string (like a taxonomy) and split it into a desired number of different columns. For instance, split a large string containing a taxonomy into columns for Kingdom, Phylum, etc.

Usage

1
2
split_emeta(omicsData, cname = NULL, split1 = ";", numcol = NULL,
  split2 = "__", num = 2, newnames = NULL)

Arguments

omicsData

an object of one of the class "seqData"

cname

the column in e_meta to split. If NULL, will use attr(omicsData,"cnames")$emeta_cname

split1

variable used to split string into columns. Default is ";".

numcol

number of columns to split given column into. If NULL, will calculate from data. Default is NULL.

split2

variable used to split string again, if needed. For example, can split "k__Bacteria" into "Bacteria" and will remove the "k__" part. Default is "__".

num

which part to keep after splitting for the second time. Default is 2.

newnames

new column names after splitting is done. If NULL, will use c("Kingdom","Phylum","Class","Order","Family","Genus","Species"). Default is NULL.

Value

seqData object with a split e_meta

Author(s)

Allison Thompson

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
library(mintJansson)
load(rRNA_data)

omicsData <- rRNA_data
head(omicsData$e_meta)

omicsData_split <- split_emeta(omicsData, emeta_cname="Taxonomy", split1=";", numcol=7, split2="__", num=2, newnames=NULL)
head(omicsData_split$e_meta)

## End(Not run)

pmartR/pmartRseq documentation built on May 25, 2019, 9:20 a.m.