format_table: Format input event data

View source: R/format_table.R

format_tableR Documentation

Format input event data

Description

Convert low/bad quality PSI values and convert event metadata as a first ID column. Prepares input event/GE data for plotting. Calls convert_psi.

Usage

format_table(x, qual = c("VLOW", "N", "LOW", "OK", "SOK"),
  expr = FALSE, counts = FALSE, trim_colnames = NULL,
  short_ids = FALSE)

Arguments

x

A data frame of event data as outputted by vast-tools combine. e.g. each row is an event containing exon metadata, PSI and quality scores values. If expr = TRUE, then each row is a gene containing two columns of metadata, one column of cRPKM per sample, and, optionally, a second column per sample with read counts.

qual

String indicating the minimun vast-tools quality score for the PSI to be accepted. Defaults to 'VLOW'. See the vast-tools documentation for details.

expr

Set to TRUE if formatting a cRPKM table. Otherwise, FALSE.

counts

Set to TRUE if the cRPKM table has read counts. Otherwise, FALSE.

trim_colnames

String that must be searched for and trimmed at the end of every sample column in x. Useful to trim the "-cRPKM" suffix from expression tables. If no string must be trimmed, leave as FALSE.

short_ids

Set to TRUE to make the metadata column shorter in the output, by including only the event ID (for events) or the gene ID (if run with expr==TRUE).

Value

A data frame. If run with expr=FALSE (default), each row is an event, the first column (ID) contains a concatenation of the event metadata delimited by |, and there are two more columns per sample, with PSI and quality scores values. If run with (expr=TRUE), each row is a gene, the ID column contains the gene metadata, and there is one more column per sample with the cRPKM value.

See Also

convert_psi

Examples

# For example input, see:
psi
format_table(psi)
# For cRPKM
crpkm
format_table(crpkm, expr = TRUE)

# For cRPKM with read counts and the "-cRPKM" suffix in sample columns:
crpkm_counts
format_table(crpkm_counts, expr = TRUE, counts = TRUE, trim_colnames = "-cRPKM")

# To keep only event IDs/gene IDs as metadata:
psi
format_table(psi,short_ids = TRUE)


kcha/psiplot documentation built on March 27, 2022, 4:20 a.m.