# Mapping protein features to splicing events

Diogo Veiga

#### 2019-11-11

#### Package

maser 1.5.0

# 1 Overview of protein annotation

In this vignette, we describe a maser workflow for annotation and visualization of protein features affected by splicing.

Integration of protein features to splicing events may reveal the impact of alternative splicing on protein function. We developed maser to enable systematic mapping of protein annotation from UniprotKB to splicing events.

Protein features can be annotated and visualized along with transcripts affected by the splice event. In this manner, maser can identify whether the splicing is affecting regions of interest containing known domains or motifs, mutations, post-translational modification and other described protein structural features.

# 2 Annotation of protein features

## 2.1 Creating the maser object

We illustrate the workflow using the hypoxia dataset from the previous vignette.

    library(maser)
    library(rtracklayer)

    # Creating maser object using hypoxia dataset
    path <- system.file("extdata", file.path("MATS_output"),
                        package = "maser")
    hypoxia <- maser(path, c("Hypoxia 0h", "Hypoxia 24h"))

    # Remove low coverage events
    hypoxia_filt <- filterByCoverage(hypoxia, avg_reads = 5)

## 2.2 Query available protein features at Uniprot

Available UniprotKB protein annotation can be queried using `availableFeaturesUniprotKB()`. Currently there are 30 distinct features grouped into broader categories, including Domain and Sites, PTM (Post-translational modifications), Molecule Processing, Topology, Mutagenesis and Structural Features.

Name | Description | Category
--- | --- | ---
act-site | UniProtKB active site sequence annotations | Domain_and_Sites
binding | UniProtKB binding site sequence annotations | Domain_and_Sites
Ca-binding | UniProtKB Calcium binding site sequence annotations | Domain_and_Sites
coiled | UniProtKB coiled coil sequence annotations | Domain_and_Sites
DNA-bind | UniProtKB DNA binding site sequence annotations | Domain_and_Sites
domain | UniProtKB domain sequence annotations | Domain_and_Sites
metal | UniProtKB metal ion binding site sequence annotations | Domain_and_Sites
motif | UniProtKB motif of interest sequence annotations | Domain_and_Sites
NP bind | UniProtKB Nucleotide Phosphate binding sequence annotations | Domain_and_Sites
region | UniProtKB region of interest sequence annotations | Domain_and_Sites

## 2.3 Steps for annotation

Protein feature annotation of splicing events is performed in two steps.

1. Use `mapTranscriptsToEvents()` to add both transcript and protein IDs to all events in the maser object.
2. Use `mapProteinFeaturesToEvents()` for annotation specifying UniprotKB features or categories.

`mapTranscriptsToEvents()` identifies transcripts compatible with the splicing event by overlapping exons involved in splicing to the gene models provided in the Ensembl GTF. Each type of splice event applies a specific overlapping rule (described in the Introduction vignette). The function also maps transcripts to their corresponding protein identifiers in Uniprot when available.

`mapTranscriptsToEvents()` requires an Ensembl or Gencode GTF using the hg38 build of the human genome. Ensembl GTFs can be retrieved using AnnotationHub or imported using `import.gff()` from the rtracklayer package. Several GTF releases are available, and maser is compatible with any version using the hg38 build.

We are using reduced GTF extracted from Ensembl Release 85 for running examples.

    ## Ensembl GTF annotation
    gtf_path <- system.file("extdata", file.path("GTF","Ensembl85_examples.gtf.gz"),
                            package = "maser")
    ens_gtf <- rtracklayer::import.gff(gtf_path)

In the second step, `mapProteinFeaturesToEvents()` retrieves data from UniprotKB and overlaps splicing events to genomic coordinates of protein features.

## 2.4 SRSF6 example

The splicing factor SRSF6 undergoes splicing during hypoxia by expressing an alternative exon. We will annotate the exon skipping event with domain, sites and topology information. The first step is to obtain a maser object containing SRSF6 splicing information, and then map transcripts to splicing events.

    # Retrieve gene specific splicing events
    srsf6_events <- geneEvents(hypoxia_filt, "SRSF6")
    srsf6_events
    #> A Maser object with 1 splicing events.
    #>
    #> Samples description:
    #> Label=Hypoxia 0h     n=3 replicates
    #> Label=Hypoxia 24h     n=3 replicates
    #>
    #> Splicing events:
    #> A3SS.......... 0 events
    #> A5SS.......... 0 events
    #> SE.......... 1 events
    #> RI.......... 0 events
    #> MXE.......... 0 events

    # Map transcripts to splicing events
    srsf6_mapped <- mapTranscriptsToEvents(srsf6_events, ens_gtf)

If transcript mapping worked correctly, Ensembl and Uniprot identifiers will be added to splicing events. Possible `NA` values indicates non-protein coding transcripts. In this case, the splicing involves two Ensembl transcripts coding for the Q13247 isoform of SRSF6.

    head(annotation(srsf6_mapped, "SE"))

ID | GeneID | geneSymbol | txn_3exons | txn_2exons | list_ptn_a | list_ptn_b
--- | --- | --- | --- | --- | --- | ---
33209 | ENSG00000124193.14 | SRSF6 | ENST00000483871 | ENST00000244020 | Q13247 | Q13247

Now we are ready to call `mapProteinFeaturesToEvents()` for annotation. Feature annotation can be interactively displayed in a web browser using `display()` or retrieved as a `data.frame` using `annotation()`.

`mapProteinFeaturesToEvents()` will add extra columns describing the feature name, feature description and protein identifiers for which the annotation has been assigned. Possible `NA` values indicate the particular feature is not annotated for the splice event.

    # Annotate splicing events with protein features
    srsf6_annot <- mapProteinFeaturesToEvents(srsf6_mapped, c("Domain_and_Sites", "Topology"), by="category")

    head(annotation(srsf6_annot, "SE"))

ID | GeneID | geneSymbol | txn_3exons | txn_2exons | list_ptn_a | list_ptn_b | act-site | binding | Ca-binding | coiled | DNA-bind | domain | metal | motif | NP bind | region | repeat | site | Zn-fing | intramem | topo-dom | transmem
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
33209 | ENSG00000124193.14 | SRSF6 | ENST00000483871 | ENST00000244020 | Q13247 | Q13247 | NA | NA | NA | NA | NA | Q13247:M1-G72;RRM1,Q13247:Y110-P183;RRM2 | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA

By inspecting the results, we see that the SRSF6 exon skipping event is annotated with the Uniprot features domain, chain and mod-res (modidifed residue). Visualization of the splice event, transcripts and protein features is performed with `plotUniprotKBFeatures()`. In this example, exons in the splice event overlap the Serine/arginine-rich splicing factor 6 region of the protein, while the upstream exon and downstream exons are overlapping the RRM1 and RRM2 domains of SRSF6, respectively.

    # Plot splice event, transcripts and protein features
    plotUniprotKBFeatures(srsf6_mapped, "SE", event_id = 33209, gtf = ens_gtf,
       features = c("domain", "chain"), show_transcripts = TRUE)

## 2.5 RIPK2 example

RIPK2 has an exon skipping event in the hypoxia dataset. Following the example above, we map transcripts to splicing events and annotate protein features overlapping the splice event. We find out that the alternative exon overlaps the kinase domain of the protein, thus possibly changing the configuration of this domain during hypoxia. The ATP and proton acceptor binding sites are overlapping exons flanking the alternative exon.

    ripk2_events <- geneEvents(hypoxia_filt, "RIPK2")
    ripk2_mapped <- mapTranscriptsToEvents(ripk2_events, ens_gtf)
    ripk2_annot <- mapProteinFeaturesToEvents(ripk2_mapped,
                                              tracks = c("Domain_and_Sites"),
                                              by = "category")

    plotUniprotKBFeatures(ripk2_annot, type = "SE", event_id = 14319,
                          features = c("domain", "binding", "act-site"), gtf = ens_gtf,
                          zoom = FALSE, show_transcripts = TRUE)

# 3 Session info

Here is the output of `sessionInfo()` on the system on which this document was compiled:

    #> R Under development (unstable) (2019-11-04 r77367)
    #> Platform: x86_64-w64-mingw32/x64 (64-bit)
    #> Running under: Windows Server 2012 R2 x64 (build 9600)
    #>
    #> Matrix products: default
    #>
    #> locale:
    #> [1] LC_COLLATE=C
    #> [2] LC_CTYPE=English_United States.1252
    #> [3] LC_MONETARY=English_United States.1252
    #> [4] LC_NUMERIC=C
    #> [5] LC_TIME=English_United States.1252
    #>
    #> attached base packages:
    #> [1] parallel  stats4    stats     graphics  grDevices utils     datasets
    #> [8] methods   base
    #>
    #> other attached packages:
    #> [1] rtracklayer_1.47.0   maser_1.5.0          GenomicRanges_1.39.1
    #> [4] GenomeInfoDb_1.23.0  IRanges_2.21.1       S4Vectors_0.25.0
    #> [7] BiocGenerics_0.33.0  ggplot2_3.2.1        BiocStyle_2.15.0
    #>
    #> loaded via a namespace (and not attached):
    #>   [1] colorspace_1.4-1            biovizBase_1.35.0
    #>   [3] htmlTable_1.13.2            XVector_0.27.0
    #>   [5] base64enc_0.1-3             dichromat_2.0-0
    #>   [7] rstudioapi_0.10             DT_0.9
    #>   [9] bit64_0.9-7                 AnnotationDbi_1.49.0
    #>  [11] splines_4.0.0               knitr_1.25
    #>  [13] zeallot_0.1.0               Formula_1.2-3
    #>  [15] jsonlite_1.6                Rsamtools_2.3.2
    #>  [17] cluster_2.1.0               dbplyr_1.4.2
    #>  [19] shiny_1.4.0                 BiocManager_1.30.9
    #>  [21] compiler_4.0.0              httr_1.4.1
    #>  [23] backports_1.1.5             assertthat_0.2.1
    #>  [25] Matrix_1.2-17               fastmap_1.0.1
    #>  [27] lazyeval_0.2.2              later_1.0.0
    #>  [29] acepack_1.4.1               htmltools_0.4.0
    #>  [31] prettyunits_1.0.2           tools_4.0.0
    #>  [33] gtable_0.3.0                glue_1.3.1
    #>  [35] GenomeInfoDbData_1.2.2      reshape2_1.4.3
    #>  [37] dplyr_0.8.3                 rappdirs_0.3.1
    #>  [39] Rcpp_1.0.3                  Biobase_2.47.0
    #>  [41] vctrs_0.2.0                 Biostrings_2.55.0
    #>  [43] crosstalk_1.0.0             xfun_0.10
    #>  [45] stringr_1.4.0               mime_0.7
    #>  [47] ensembldb_2.11.0            XML_3.98-1.20
    #>  [49] zlibbioc_1.33.0             scales_1.0.0
    #>  [51] BSgenome_1.55.1             VariantAnnotation_1.33.0
    #>  [53] hms_0.5.2                   promises_1.1.0
    #>  [55] ProtGenerics_1.19.0         SummarizedExperiment_1.17.0
    #>  [57] AnnotationFilter_1.11.0     RColorBrewer_1.1-2
    #>  [59] yaml_2.2.0                  curl_4.2
    #>  [61] memoise_1.1.0               gridExtra_2.3
    #>  [63] biomaRt_2.43.0              rpart_4.1-15
    #>  [65] latticeExtra_0.6-28         stringi_1.4.3
    #>  [67] RSQLite_2.1.2               highr_0.8
    #>  [69] checkmate_1.9.4             GenomicFeatures_1.39.0
    #>  [71] BiocParallel_1.21.0         rlang_0.4.1
    #>  [73] pkgconfig_2.0.3             matrixStats_0.55.0
    #>  [75] bitops_1.0-6                evaluate_0.14
    #>  [77] lattice_0.20-38             purrr_0.3.3
    #>  [79] labeling_0.3                GenomicAlignments_1.23.0
    #>  [81] htmlwidgets_1.5.1           bit_1.1-14
    #>  [83] tidyselect_0.2.5            plyr_1.8.4
    #>  [85] magrittr_1.5                bookdown_0.14
    #>  [87] R6_2.4.0                    Hmisc_4.3-0
    #>  [89] DelayedArray_0.13.0         DBI_1.0.0
    #>  [91] pillar_1.4.2                foreign_0.8-72
    #>  [93] withr_2.1.2                 survival_3.1-7
    #>  [95] RCurl_1.95-4.12             nnet_7.3-12
    #>  [97] tibble_2.1.3                crayon_1.3.4
    #>  [99] BiocFileCache_1.11.2        rmarkdown_1.16
    #> [101] progress_1.2.2              grid_4.0.0
    #> [103] data.table_1.12.6           blob_1.2.0
    #> [105] digest_0.6.22               xtable_1.8-4
    #> [107] httpuv_1.5.2                openssl_1.4.1
    #> [109] munsell_0.5.0               Gviz_1.31.0
    #> [111] askpass_1.1