Case study: command-line interface (CLI) tutorial

Nuno Saraiva-Agostinho

2020-10-27

psichomics is an interactive R package for integrative analyses of alternative splicing and gene expression based on The Cancer Genome Atlas (TCGA) (containing molecular data associated with 34 tumour types), the Genotype-Tissue Expression (GTEx) project (containing data for multiple normal human tissues), Sequence Read Archive (SRA) and user-provided data. The data from GTEx, TCGA and select SRA projects include subject/sample-associated information and transcriptomic data, such as the quantification of RNA-Seq reads aligning to splice junctions (henceforth called junction quantification) and exons.

Installing and starting the program

Install psichomics by typing the following in an R console (the R environment is required):

install.packages("BiocManager")
BiocManager::install("psichomics")

After the installation, load psichomics by typing:

library(psichomics)

Quick reference of psichomics functions

Please read the following function reference.

Exploration of clinically-relevant, differentially spliced events in breast cancer

The following case study was adapted from psichomics’ original article:

Nuno Saraiva-Agostinho and Nuno L. Barbosa-Morais (2019). psichomics: graphical application for alternative splicing quantification and analysis. Nucleic Acids Research.

Breast cancer is the cancer type with the highest incidence and mortality in women (Torre et al., 2015) and multiple studies have suggested that transcriptome-wide analyses of alternative splicing changes in breast tumours are able to uncover tumour-specific biomarkers (Tsai et al., 2015; Danan-Gotthold et al., 2015; Anczuków et al., 2015). Given the relevance of early detection of breast cancer to patient survival, we can use psichomics to identify novel tumour stage-I-specific molecular signatures based on differentially spliced events.

Downloading and loading TCGA data

The quantification of each alternative splicing event is based on the proportion of junction reads that support the inclusion isoform, known as percent spliced-in or PSI (Wang et al., 2008).

To estimate this value for each splicing event, both alternative splicing annotation and junction quantification are required. While alternative splicing annotation is provided by the package, junction quantification may be retrieved from TCGA, GTEx, SRA or user-provided files.

Data is downloaded from Firebrowse, a service that hosts processed data from TCGA, as required to run the downstream analyses. Before downloading data, check the following options:

Note there is also the option for Gene expression (normalised by RSEM). However, we recommend to load the raw gene expression data instead, followed by filtering and normalisation as demonstrated afterwards.

After deciding on the options to use, download and load breast cancer data as follows:

Data is only downloaded if the files are not present in the given folder. In other words, if the files were already downloaded, the function will just load the files, so it is possible to reuse the code above just to load the requested files.

Windows limitations: If you are using Windows, note that the downloaded files have huge names that may be over Windows Maximum Path Length. A workaround would be to manually rename the downloaded files to have shorter names, move all downloaded files to a single folder and load such folder.

Filtering and normalising gene expression

As this package does not focuses on gene expression analysis, we suggest to read the RNA-seq section of limma’s user guide. Nevertheless, we present the following commands to quickly filter and normalise gene expression:

Quantifying alternative splicing

After loading the clinical and alternative splicing junction quantification data from TCGA, quantify alternative splicing by clicking the green panel Alternative splicing quantification.

As previously mentioned, alternative splicing is quantified from the previously loaded junction quantification and an alternative splicing annotation file. To check current annotation files available:

##                        Human hg19/GRCh37 (2017-10-20) 
## "annotationHub_alternativeSplicingEvents.hg19_V2.rda" 
##                        Human hg19/GRCh37 (2016-10-11) 
##    "annotationHub_alternativeSplicingEvents.hg19.rda" 
##                               Human hg38 (2018-04-30) 
## "annotationHub_alternativeSplicingEvents.hg38_V2.rda"

Custom splicing annotation: Additional alternative splicing annotations can be prepared for psichomics by parsing the annotation from programs like VAST-TOOLS, MISO, SUPPA and rMATS. Note that SUPPA and rMATS are able to create their splicing annotation based on transcript annotation. Please read Preparing alternative splicing annotations.

To quantify alternative splicing, first select the junction quantification, alternative splicing annotation and alternative splicing event type(s) of interest:

##                                          Skipped exon 
##                                                  "SE" 
##                               Mutually exclusive exon 
##                                                 "MXE" 
##                            Alternative 5' splice site 
##                                                "A5SS" 
##                            Alternative 3' splice site 
##                                                "A3SS" 
##                                Alternative first exon 
##                                                 "AFE" 
##                                 Alternative last exon 
##                                                 "ALE" 
## Alternative first exon (exon-centred - less reliable) 
##                                            "AFE_exon" 
##  Alternative last exon (exon-centred - less reliable) 
##                                            "ALE_exon"

Afterwards, quantify alternative splicing using the previously defined parameters:

## [1] "SE_3_+_13661331_13663275_13663415_13667945_FBLN2"   
## [2] "SE_3_+_57908750_57911572_57911661_57913023_SLMAP"   
## [3] "ALE_3_+_57908750_57911572_57913023_SLMAP"           
## [4] "SE_3_-_37136283_37133029_37132958_37125297_LRRFIP2" 
## [5] "SE_12_-_56558432_56558152_56558087_56557549_SMARCC2"
## [6] "AFE_4_+_56755098_56750094_56756389_EXOC1"

Note that the event identifier (for instance, SE_1_-_2125078_2124414_2124284_2121220_C1orf86) is composed of:

Warning: all examples shown in this case study are performed using a small, yet representative subset of the available data. Therefore, values shown here may correspond to those when performing the whole analysis.

Data grouping

Let us create groups based on available samples types (i.e. Metastatic, Primary solid Tumor and Solid Tissue Normal) and tumour stages. As tumour stages are divided by sub-stages, we will merge sub-stages so as to have only tumour samples from stages I, II, III and IV (stage X samples are discarded as they are uncharacterised tumour samples).

Principal component analysis (PCA)

PCA is a technique to reduce data dimensionality by identifying variable combinations (called principal components) that explain the variance in the data (Ringnér, 2008). Use the following commands to perform PCA:

As PCA cannot be performed on data with missing values, missing values need to be either removed (thus discarding data from whole splicing events or genes) or impute them (i.e. attributing to missing values the median of the non-missing ones). Use the argument missingValues of performPCA() to select the number of missing values that are tolerable per event (i.e. if a splicing event or gene has less than N missing values, those missing values will be imputed; otherwise, the event is discarded from PCA).

For performance reasons, the loading plot is able to limit the number of top variables that most contribute to the select principal components, as controlled by the argument nLoadings of plotPCA().

Hint: As most plots in psichomics, PCA plots can be zoomed-in by clicking-and-dragging within the plot (click Reset zoom to zoom-out). To toggle the visibility of the data series represented in the plot, click its respective name in the plot legend.

Rank Event type Chromosome Strand Gene Event position PC1 loading PC2 loading Contribution to PC1 (%) Contribution to PC2 (%) Contribution to PC1 and PC2 (%)
SE_3_+_13661331_13663275_13663415_13667945_FBLN2 1 Skipped exon (SE) 3 + FBLN2 13661331, 13667945 0.1339504 -0.1403020 1.794271 1.9684643 1.814085
AFE_15_+_74466994_74466360_74467192_ISLR 2 Alternative first exon (AFE) 15 + ISLR 74466360, 74467192 0.1190302 -0.2101108 1.416820 4.4146553 1.757812
SE_3_+_57908750_57911572_57911661_57913023_SLMAP 3 Skipped exon (SE) 3 + SLMAP 57908750, 57913023 0.1365527 -0.0591862 1.864663 0.3503006 1.692410
ALE_3_+_57908750_57911572_57913023_SLMAP 4 Alternative last exon (ALE) 3 + SLMAP 57908750, 57913023 0.1358264 -0.0608691 1.844880 0.3705053 1.677176
SE_3_-_37136283_37133029_37132958_37125297_LRRFIP2 5 Skipped exon (SE) 3 - LRRFIP2 37125297, 37136283 0.1320250 -0.0141660 1.743061 0.0200676 1.547077

To perform PCA using alternative splicing quantification and gene expression data (both using all samples and only Tumour Stage I and Normal samples):

NUMB exon 12 inclusion and correlation with QKI gene expression

One of the splicing events that most contribute the separation between tumour stage I and normal samples is NUMB exon 12 inclusion, whose protein is crucial for cell differentiation as a key regulator of the Notch pathway. The RNA-binding protein QKI has been shown to repress NUMB exon 12 inclusion in lung cancer cells by competing with core splicing factor SF1 for binding to the branch-point sequence, thereby repressing the Notch signalling pathway, which results in decreased cancer cell proliferation (Zong et al., 2014).

Differential inclusion of NUMB exon 12

Let’s check whether a significant difference in NUMB exon 12 inclusion between tumour and normal TCGA breast samples. To do so:

## [1] "SE_14_-_73749067_73746132_73745989_73744001_NUMB"

Consistent with the cited article, NUMB exon 12 inclusion is significantly increased in cancer.

Also of interest:

  • Hover each group in the plot to compare the respective number of samples, median and variance.
  • To zoom in a specific region, click-and-drag in the region of interest.
  • To hide or show groups, click on their name in the legend.

Correlation between NUMB exon 12 inclusion and QKI expression

To verify if NUMB exon 12 inclusion is correlated with QKI expression:

## [1] "QKI|9444"
## $`SE_14_-_73749067_73746132_73745989_73744001_NUMB`
## $`SE_14_-_73749067_73746132_73745989_73744001_NUMB`$`QKI|9444`

According to the obtained results and also consistent with the previous article, the inclusion of the exon is negatively correlated with QKI expression.

Differential splicing analysis

To analyse alternative splicing between normal and tumour stage I samples:

Event type Chromosome Strand Gene Survival by PSI cutoff Optimal PSI cutoff Log-rank p-value Samples (Normal) Samples (Tumour Stage I) T-test statistic T-test parameter T-test p-value T-test p-value (BH adjusted) T-test conf int1 T-test conf int2 T-test estimate1 T-test estimate2 T-test null value T-test stderr T-test alternative T-test method T-test data name Wilcoxon statistic Wilcoxon p-value Wilcoxon p-value (BH adjusted) Wilcoxon null value Wilcoxon alternative Wilcoxon method Wilcoxon data name Kruskal statistic Kruskal parameter Kruskal p-value Kruskal p-value (BH adjusted) Kruskal method Kruskal data name Levene statistic Levene p-value Levene p-value (BH adjusted) Levene data name Levene method Fligner-Killeen statistic Fligner-Killeen parameter Fligner-Killeen p-value Fligner-Killeen p-value (BH adjusted) Fligner-Killeen method Fligner-Killeen data name Variance (Normal) Variance (Tumour Stage I) Median (Normal) Median (Tumour Stage I) ∆ Variance ∆ Median
SE_3_+_13661331_13663275_13663415_13667945_FBLN2 Skipped exon (SE) 3 + FBLN2 NA NA NA 112 178 35.25121 256.8713 0 0 0.4913165 0.5494573 0.6951339 0.1747470 0 0.0147622 two.sided Welch Two Sample t-test vector[typeOne] and vector[!typeOne] 19781.5 0 0 0 two.sided Wilcoxon rank sum test with continuity correction vector[typeOne] and vector[!typeOne] 199.2100 1 0 0 Kruskal-Wallis rank sum test vector and group 0.0030809 0.9557741 0.9557741 vector and group Levene’s test (using the median) 0.5378107 1 0.4633415 0.5022233 Fligner-Killeen test of homogeneity of variances vector and group 0.0135423 0.0172679 0.7189603 0.1416915 -0.0037256 0.5772688
SE_3_+_57908750_57911572_57911661_57913023_SLMAP Skipped exon (SE) 3 + SLMAP NA NA NA 112 181 22.08735 290.9932 0 0 0.3970111 0.4746859 0.7505524 0.3147039 0 0.0197329 two.sided Welch Two Sample t-test vector[typeOne] and vector[!typeOne] 18879.0 0 0 0 two.sided Wilcoxon rank sum test with continuity correction vector[typeOne] and vector[!typeOne] 153.9075 1 0 0 Kruskal-Wallis rank sum test vector and group 10.4441525 0.0013716 0.0024722 vector and group Levene’s test (using the median) 7.0960805 1 0.0077253 0.0122185 Fligner-Killeen test of homogeneity of variances vector and group 0.0167379 0.0434298 0.7547746 0.2470588 -0.0266920 0.5077157
ALE_3_+_57908750_57911572_57913023_SLMAP Alternative last exon (ALE) 3 + SLMAP NA NA NA 112 181 21.76346 289.9965 0 0 0.3947718 0.4732735 0.7172262 0.2832036 0 0.0199427 two.sided Welch Two Sample t-test vector[typeOne] and vector[!typeOne] 18942.5 0 0 0 two.sided Wilcoxon rank sum test with continuity correction vector[typeOne] and vector[!typeOne] 156.1536 1 0 0 Kruskal-Wallis rank sum test vector and group 7.8066040 0.0055511 0.0090571 vector and group Levene’s test (using the median) 5.3586469 1 0.0206198 0.0285363 Fligner-Killeen test of homogeneity of variances vector and group 0.0182637 0.0424705 0.7195130 0.2206573 -0.0242068 0.4988557
SE_3_-_37136283_37133029_37132958_37125297_LRRFIP2 Skipped exon (SE) 3 - LRRFIP2 NA NA NA 112 180 20.17074 251.8459 0 0 0.3578812 0.4353285 0.7089629 0.3123581 0 0.0196624 two.sided Welch Two Sample t-test vector[typeOne] and vector[!typeOne] 19065.0 0 0 0 two.sided Wilcoxon rank sum test with continuity correction vector[typeOne] and vector[!typeOne] 164.0062 1 0 0 Kruskal-Wallis rank sum test vector and group 1.5743988 0.2105796 0.2417766 vector and group Levene’s test (using the median) 1.6230249 1 0.2026705 0.2344323 Fligner-Killeen test of homogeneity of variances vector and group 0.0247654 0.0297881 0.6925958 0.2860301 -0.0050227 0.4065657
SE_12_-_56558432_56558152_56558087_56557549_SMARCC2 Skipped exon (SE) 12 - SMARCC2 NA NA NA 112 181 -20.73860 177.9125 0 0 -0.4497058 -0.3715582 0.3877788 0.7984108 0 0.0198004 two.sided Welch Two Sample t-test vector[typeOne] and vector[!typeOne] 694.0 0 0 0 two.sided Wilcoxon rank sum test with continuity correction vector[typeOne] and vector[!typeOne] 179.5060 1 0 0 Kruskal-Wallis rank sum test vector and group 27.5729041 0.0000003 0.0000008 vector and group Levene’s test (using the median) 23.2937373 1 0.0000014 0.0000037 Fligner-Killeen test of homogeneity of variances vector and group 0.0337541 0.0164129 0.3897698 0.8210526 0.0173413 -0.4312828
AFE_4_+_56755098_56750094_56756389_EXOC1 Alternative first exon (AFE) 4 + EXOC1 NA NA NA 112 175 14.23168 208.5711 0 0 0.2866482 0.3788319 0.6677512 0.3350112 0 0.0233802 two.sided Welch Two Sample t-test vector[typeOne] and vector[!typeOne] 17428.0 0 0 0 two.sided Wilcoxon rank sum test with continuity correction vector[typeOne] and vector[!typeOne] 123.7057 1 0 0 Kruskal-Wallis rank sum test vector and group 3.3371823 0.0687764 0.0881019 vector and group Levene’s test (using the median) 3.2181098 1 0.0728277 0.0932917 Fligner-Killeen test of homogeneity of variances vector and group 0.0419169 0.0301660 0.6466063 0.3134328 0.0117509 0.3331735

Performing multiple survival analysis

To study the impact of alternative splicing events on prognosis, Kaplan-Meier curves may be plotted for groups of patients separated by the optimal PSI cutoff for a given alternative splicing event that that maximises the significance of group differences in survival analysis (i.e. minimises the p-value of the log-rank tests of difference in survival between individuals whose samples have their PSI below and above that threshold).

Given the slow process of calculating the optimal splicing quantification cutoff for multiple events, it is recommended to perform this for a subset of differentially spliced events.

Differential gene expression

Detected alterations in alternative splicing may simply be a reflection of changes in gene expression levels. Therefore, to disentangle these two effects, differential expression analysis between tumour stage I and normal samples should also be performed. In order to do so:

UHRF2 exon 10 inclusion

One splicing event with prognostic value is the alternative splicing of UHRF2 exon 10. Cell-cycle regulator UHRF2 promotes cell proliferation and inhibits the expression of tumour suppressors in breast cancer (Wu et al., 2012).

Differential splicing analysis

Let’s check whether a significant difference in UHRF2 exon 10 inclusion between tumour stage I and normal samples. To do so:

Higher inclusion of UHRF2 exon 10 is associated with normal samples.

Survival analysis

To study the impact of alternative splicing events on prognosis, Kaplan-Meier curves may be plotted for groups of patients separated by a given PSI cutoff for a given alternative splicing event. The optimal PSI cutoff maximises the significance of group differences in survival analysis (i.e. minimises the p-value of the log-rank tests of difference in survival between individuals whose samples have a PSI below and above that threshold).

## [1] 0.1436954
## [1] 0.0358

As per the results, higher inclusion of UHRF2 exon 10 is associated with better prognosis.

Differential expression

To check whether alternative splicing changes are related with gene expression alterations, let us perform differential expression analysis on UHRF2:

It seems UHRF2 is differentially expressed between Tumour Stage I and Solid Tissue Normal. However, going back to exploratory differential gene expression, UHRF2 has a log2(fold-change) ≤ 1, low enough not to be biologically relevant. Following this criterium, the gene can thus be considered not to be differentially expressed between these conditions.

Survival analysis

To confirm if gene expression has an overall prognostic value, perform the following:

## [1] 10.42619
## [1] 0.176

There seems to be no significant difference in survival between patient groups stratified by UHRF2’s optimal gene expression cutoff in tumour samples (log-rank p-value > 0.05).

Literature support and external database information

If an event is differentially spliced and has an impact on patient survival, its association with the studied disease might be already described in the literature. To check so, go to Analyses > Gene, transcript and protein information where information regarding the associated gene (such as description and genomic position), transcripts and protein domain annotation are available.

  • The protein plot shows the UniProt matches for the selected transcript. Hover the protein’s rendered domains to obtain more information on them. More information about each protein can be retrieved by clicking the respective UniProt link.
  • Links to related research articles are also available. Click Show more articles to be directed to PubMed.
  • Multiple links to related external databases are available too:
    • Human Protein Atlas (Cancer Atlas) allows to check the evidence of a gene at protein level for multiple cancer tissues.
    • VastDB shows multi-species alternative splicing profiles for diverse tissues and cell types.
    • UCSC Genome Browser may reveal protein domain disruptions caused by the alternative splicing event. To check so, activate the Pfam in UCSC Gene and UniProt tracks (in Genes and Gene Predictions) and check if any domains are annotated in the alternative and/or constitutive exons of the splicing event.

Interpretation

Higher inclusion of UHRF2 exon 10 is associated with normal samples and better prognosis, and potentially disrupts UHRF2’s SRA-YDG protein domain, related to the binding affinity to epigenetic marks. Hence, exon 10 inclusion may suppress UHRF2’s oncogenic role in breast cancer by impairing its activity through the induction of a truncated protein or a non-coding isoform. Moreover, this hypothesis is independent from gene expression changes, as UHRF2 is not differentially expressed between tumour stage I and normal samples (|log2(fold-change)| < 1) and there is no significant difference in survival between patient groups stratified by its expression in tumour samples (log-rank p-value > 0.05).

Loading data from other sources

Load GTEx data

GTEx data (subject phenotype, sample attributes, gene expression and junction quantification) for specific tissues can be automatically retrieved and loaded by following these commands:

To load data for all GTEx tissues, please type:

Load SRA project data using recount

recount is a resource of pre-processed data for thousands of SRA projects (including gene read counts, splice junction quantification and sample metadata). psichomics supports automatic downloading and loading of SRA data from recount, as exemplified below:

Please refer to our methods article for more information (the code for performing the analysis can be found at GitHub):

Nuno Saraiva-Agostinho and Nuno L. Barbosa-Morais (2020). Interactive Alternative Splicing Analysis of Human Stem Cells Using psichomics. In: Kidder B. (eds) Stem Cell Transcriptional Networks. Methods in Molecular Biology, vol 2117. Humana, New York, NY

Load other SRA, VAST-TOOLS and user-provided data

Any FASTQ files can be manually aligned using a splice-aware aligner and loaded by following the instructions in Loading SRA, VAST-TOOLS and user-provided RNA-seq data.

Local files can be loaded by indicating their containing folder. Any files located in this folder and sub-folders will be loaded.

For instance, to load GTEx data via local files, create a directory called GTEx, put all GTEx files within that folder and type these commands:

Feedback

All feedback on the program, documentation and associated material (including this tutorial) is welcome. Please send any suggestions and comments to:

Nuno Saraiva-Agostinho (nunoagostinho@medicina.ulisboa.pt)

Disease Transcriptomics Lab, Instituto de Medicina Molecular (Portugal)

References

Anczuków,O. et al. (2015) SRSF1-Regulated Alternative Splicing in Breast Cancer. Molecular Cell, 60, 105–117.

Danan-Gotthold,M. et al. (2015) Identification of recurrent regulated alternative splicing events across human solid tumors. Nucleic Acids Research, 43, 5130–5144.

Ringnér,M. (2008) What is principal component analysis? Nature biotechnology, 26, 303–304.

Torre,L.A. et al. (2015) Global cancer statistics, 2012. CA: a cancer journal for clinicians, 65, 87–108.

Tsai,Y.S. et al. (2015) Transcriptome-wide identification and study of cancer-specific splicing events across multiple tumors. Oncotarget, 6, 6825–6839.

Wang,E.T. et al. (2008) Alternative isoform regulation in human tissue transcriptomes. Nature, 456, 470–476.

Wu,J. et al. (2012) Identification and functional analysis of 9p24 amplified genes in human breast cancer. Oncogene, 31, 333–341.

Zong,F.-Y. et al. (2014) The RNA-binding protein QKI suppresses cancer-associated aberrant splicing. PLoS genetics, 10, e1004289.