switchPlotTranscript {IsoformSwitchAnalyzeR} | R Documentation

## Plot Transcript Structure and Annoation

### Description

This function plots the transcript structure of all (or selected) isoforms from a gene along with all the annotation added to the `switchAnalyzeRlist` including transcript classification, ORF, Coding Potential, NMD sensitivity, annotated protein domains as well as annotated signal peptides.

### Usage

    switchPlotTranscript(
        switchAnalyzeRlist = NULL,
        gene = NULL,
        isoform_id = NULL,
        rescaleTranscripts = TRUE,
        plotXaxis = !rescaleTranscripts,
        reverseMinus = TRUE,
        ifMultipleIdenticalAnnotation = "summarize",
        rectHegith = 0.2,
        codingWidthFactor = 2,
        nrArrows = 20,
        arrowSize = 0.2,
        optimizeForCombinedPlot = FALSE,
        condition1 = NULL,
        condition2 = NULL,
        localTheme = theme_bw(),
        plot = TRUE
    )

### Arguments

`switchAnalyzeRlist` | A `switchAnalyzeRlist` object where the ORF is annotated (for example via analyzeORF).
`gene` | Either the gene_id or the gene name of the gene to plot, alternatively one can use the `isoform_id` argument to supply a vector of isoform_ids.
`isoform_id` | A vector of the id(s) of which isoform(s) (from the same gene) to plot, alternatively one can use the `gene_id` argument to plot all isoforms of a gene.
`rescaleTranscripts` | A Logical indicating whether all the isoforms should be rescaled to the squareroot of their original sizes. This feature is implemented because introns usually are much larger than exons making it difficult to see structural changes. This is very usefull for structural visualization but the scaling might distort actual intron and exon sizes. Default is TRUE.
`plotXaxis` | A logical indicating whether x-axis should be shown. Default is the opposite of the rescaleTranscripts (meaning FALSE when rescale is TRUE and vice versa).
`reverseMinus` | A logic indicating whether isoforms on minus strand should be inverted so they are visualized as going from left to right instead of right to left. (Only affects minus strand isoforms). Default is TRUE
`ifMultipleIdenticalAnnotation` | This argument determines how to visually handle if multiple instances of the same domain is found, the options are A) \'summarize\' which will assign one color to all the domains (and adding the number of domains in a bracket in the legend). B) \'number\' which will add a number to each domain and give each domain a seperate color. Default is \'summarize\'.
`rectHegith` | When drawing the transcripts what should be the size of the non-coding (and UTR) regions (if the total height of a transcript is larger than 1 they start to overlap).
`codingWidthFactor` | The number deciding the width of the coding regions compared to the non-coding (as a fraction of the non-coding). A number larger than 1 will result in coding regions being thicker than non-coding regions.
`nrArrows` | An integer controlling the number of arrows drawn in the intron of transcripts. Given as the number of arrows a hypothetical intron spanning the whole plot window should have (if you get no arrows increase this value). Default is 20.
`arrowSize` | The size of arrowhead drawn in the intron of transcripts. Default is 0.2
`optimizeForCombinedPlot` | A logic indicating whether to optimize for use with `switchPlot()`. Default is FALSE
`condition1` | First condition of the comparison to analyze must be the name used in the switchAnalyzeRlist. Only needed if `optimizeForCombinedPlot=TRUE` and more than one comparisons is analyzed.
`condition2` | Second condition of the comparison to analyze, must be the name used in the switchAnalyzeRlist. Only needed if `optimizeForCombinedPlot=TRUE` and more than one comparisons is analyzed.
`localTheme` | General ggplot2 theme with which the plot is made, see `?ggplot2::theme` for more info. Default is theme_bw().
`plot` | A Logical indicating whether the final plot should be plotted (TRUE) or returned (FALSE). Default is TRUE.

### Details

This function generates a plot visualizing all the annotation for the transcripts gathered. The plot supports visualization of:

- `ORF` : Making the ORF part of the transcript thicker. Requires that ORF have been annotated (fx. via `analyzeORF`).

- `Coding Potential / NMD` : The transcripts will be plotted in 3 categories: 'Coding', 'Non-coding' and 'NMD-sensitive'. The annotation of 'Coding' and 'Non-coding' requires the result of an external CPAT analysis have been added with `analyzeCPAT`. The NMD sensitivity is added by the `analyzeORF`.

- `Protein domains` : By coloring the part of the ORF containing the protein domains. Requires the result of an external Pfam analysis have been added with `analyzePFAM`).

- `Signal Peptide` : By coloring the part of the ORF containing the signal peptide. Requires the result of an external SignalIP analysis have been added with `analyzeSignalP).`

  `Transcript status` : Specificly from data imported from cufflinks/cuffdiff. The status (class code) of the transcript is added in brackets after the transcript name.

### Value

- If `plot=TRUE` : Plots the visualization described in the `details` section

- If `plot=FALSE` : Returns the gg object which can then be modified or plotted in a different setting.

### Author(s)

Kristoffer Vitting-Seerup

### References

Vitting-Seerup et al. The Landscape of Isoform Switches in Human Cancers. Mol. Cancer Res. (2017).

### See Also

`analyzeORF`
`analyzeCPAT`
`analyzePFAM`
`analyzeSignalP`

### Examples

    ### Prepare for plotting
    data("exampleSwitchListAnalyzed")

    mostSwitchingGene <- extractTopSwitches(
        exampleSwitchListAnalyzed,
        filterForConsequences = TRUE,
        n = 1
    )

    ### Plot transcript structure
    switchPlotTranscript(exampleSwitchListAnalyzed, gene = mostSwitchingGene$gene_id)

[Package IsoformSwitchAnalyzeR version 1.4.0 Index]