knitr::opts_chunk$set(echo = TRUE)

library(rats)
library(data.table)

Let's set up an example, using RAT's data emulator (used for code testing, not suitable for data simulations).

# Simulate some data.
simdat <- sim_boot_data(clean=TRUE) 
# For convenience let's assign the contents of the list to separate variables
mycond_A <- simdat[[2]]   # Simulated bootstrapped data for one condition.
mycond_B <- simdat[[3]]   # Simulated bootstrapped data for other condition.
myannot <- simdat[[1]]    # Transcript and gene IDs for the above data.

# Call DTU
mydtu <- call_DTU(annot= myannot, verbose= FALSE,
                  boot_data_A= mycond_A, boot_data_B= mycond_B,
                  dprop_thresh=0.1, qboot=TRUE, rboot=FALSE)

Output structure

The output of RATs is a list containing 4 elements:

print( names(mydtu) )

Parameters

Parameters is a list that contains information about the data and the settings for a particular run.

# Parameter list's elements.
print( names(mydtu$Parameters) )

Note: If bootstraps are disabled, the bootstrap-related fields may be NA, regardless of supplied values, to reflect the fact that they were not used.

Genes

Genes is a data.table listing results at the gene level. For your convenience, the respective aggregated transcript-level DTU calls are also included here (defined as at least one isoform being called DTU individually).

# Genes table's fields.
print( names(mydtu$Genes) )

The first few columns show the result of each decision step in a boolean manner, allowing easy filtering of the table. The remaining columns list the values based on which these decisions were made. Pseudo-code formulas are shown here to help understand how the different fields interact when making decisions.

Note: The fields reporting on the bootstraps will not be shown when bootstrapping is disabled.

Transcripts

Transcripts is a data.table listing results at the transcript level. For your convenience, the respective gene-level DTU calls are also included here.

# Transcripts table's fields.
print( names(mydtu$Transcripts) )

The first few columns show the result of each decision step in a boolean manner, allowing easy filtering of the table. The remaining columns list the values based on which these decisions were made. Pseudo-code formulas are shown here to help understand how the different fields interact when making decisions.

Note: The fields reporting on the bootstraps will not be shown when bootstrapping is disabled.

Abundances

Abundances is a list of two data.tables, one for each condition. Each transcript is represented by a single abundance value per replicate, so if bootstrapped data was used, these values are the means across iterations. If plain abundances were provided as input, then Abundances essentially contains the input data. These abundances are included in the output because they are required for some of RATs' plotting options.

# Elements of Abundances.
print( names(mydtu$Abundances) )
  1. condA - (num) The transcript abundances in the first condition.
  2. condB - (num) The transcript abundances in the second condition.
# Abundance table for first condition.
print( head(mydtu$Abundances[[1]]) )

Quick results

For your convenience, RATs provides a few functions to give you a quick summary of the run. They all follow the same style.

These reports should not be seen as a substitute for the detailed RATs output.

Summary of DTU

The dtu_summary() function lists the total number of genes and transcripts for each of 3 categories:

# A tally of the outcome.
print( dtu_summary(mydtu) )

The get_dtu_ids() function lists the coresponding identifiers per category. The ID lists obtained are ordered by effect size (Dprop).

# Gene and transcript IDs corresponding to the tally above.
ids <- get_dtu_ids(mydtu)
print( names(ids) )
print( ids )

Summary of isoform switching

Isoform switching is a subset of DTU. Primary isoform switching is often considered the most likely type of DTU to have an effect. The following two functions summarise the extent of isoform switching in the results:

# A tally of genes switching isoform ranks.
print( dtu_switch_summary(mydtu) )

# The gene IDs displaying isoform switching.
ids <- get_switch_ids(mydtu)
print( names(ids) )

Summary of DTU plurality

In case you want to know how many isoforms are affected per gene.

# A tally of genes switching isoform ranks.
print( dtu_plurality_summary(mydtu) )

# The gene IDs displaying isoform switching.
ids <- get_plurality_ids(mydtu)

These give you the number and IDs of genes in which 2, 3, etc... isoforms show DTU.


Contact information

The rats R package was developed within The Barton Group at The University of Dundee by Dr. Kimon Froussios, Dr. Kira Mourão and Dr. Nick Schurch.

To report problems or ask for assistance, please raise a new issue on the project's support forum. Providing a reproducible working example that demonstrates your issue is strongly encouraged to help us understand the problem. Also, be sure to read the vignette(s), and browse/search the support forum before posting a new issue, in case your question is already answered there.

Enjoy!



bartongroup/RATS documentation built on June 8, 2022, 12:40 a.m.