plotAligned {girafe} | R Documentation

## Visualise reads aligned to genome intervals

### Description

Visualise reads aligned to genome intervals

### Usage

    plotAligned(x, y, chr, start, end, plus.col = "#00441b",
       minus.col = "#283d78", gff, featureLegend = FALSE,
       gffChrColumn = "seq_name", gffTypeColumn="type",
       gffNameColumn="ID",
       featureExclude = c("chromosome", "nucleotide_match", "insertion"),
       showStrands="both", extraColors=NULL, ylim, highlight, main, ...)

### Arguments

`x` | Object of class `AlignedGenomeIntervals`
`y` | This argument is only specified for compatibility with plot.default and not used in the function.
`chr` | string; on which chromosome is the region to plot
`start` | integer; start coordinate of the chromosome region to plot
`end` | integer; end coordinate of the chromosome region to plot
`plus.col` | which colour to use for the reads on the Plus strand
`minus.col` | which colour to use for the reads on the Plus strand
`gff` | Data frame containing annotation for genomic feature to be used to further annotate the plot. Note that it must include a column called “type” that indicates the type of each genomic feature (e.g. miRNA, gene etc.).
`featureLegend` | logical; should a legend that describes the colour code for the annotated genome features be appended at the bottom of the plot?
`gffChrColumn` | string; which column of the `gff` data.frame holds the chromosome identifier of each feature.
`gffTypeColumn` | string; which column of the `gff` data.frame holds the type/class identifier of each feature. Used for the colouring of features.
`gffNameColumn` | what is the column of the gff data.frame called that holds the identifier of the element that should be displayed in the plot; default: “name”
`featureExclude` | character; which kinds of annotated genome features specified in the `gff` are to be ignored for the plot
`showStrands` | string; which strands to show in the plot; defaults to “both”, but users can specify to show only the reads on “plus” or “minus” strand
`extraColors` | named character vector which allows the user to specify custom colours for feature types; colours must be specified in RGB format as hexadecimal strings starting with “#”, e.g. “#addfff” for light-blue
`ylim` | range of read numbers to plot (y-axis limits); if not specified they are computed from the data in the specified region
`highlight` | currently unused
`main` | string; main title to use for the plot
`...` | further arguments passed on to the more primitive plotting functions used

### Details

This function implements the `plot` method for objects of class `AlignedGenomeIntervals`.

### Value

Returns `NULL`; this function is called for the side-effect of creating the plot.

### Note

This function was inspired by and borrows source code from the function `plotAlongChrom` in package `tilingArray`

### Author(s)

Joern Toedling, Wolfgang Huber

### See Also

`AlignedGenomeIntervals-class`

### Examples

      A <- AlignedGenomeIntervals(
            start=c(1,8,10,20), end=c(5,15,16,25),
            chromosome=rep("chr1", each=4),
            strand=c("+","+","+","+"),
            sequence=c("ACATT","TATCGGAC","TCGGACT","GTAACG"),
            reads=c(5L, 2L, 4L, 7L) )
      M2 <- new("Genome_intervals_stranded",
                rbind(c(2,6), c(1,15), c(20,30)),
                closed = matrix(TRUE, ncol=2, nrow=3),
                annotation = data.frame(
                  seq_name= factor(rep("chr1", 3)),
                  inter_base= logical(3),
                  strand=factor(rep("+", 3), levels=c("+","-")),
                  alias=c("miRNA1","gene1","tRNA1"),
                  type=c("miRNA","gene","tRNA")) )
      if (interactive())
        plot(A, M2, chr="chr1", start=0, end=35,
             nameColum="alias", showStrands="plus")

      if (interactive())
      ## use 'extraColors' to replace default colours (or to add new ones):
        plot(A, M2, chr="chr1", start=0, end=35, nameColum="alias",
             showStrands="plus", extraColors=c("tRNA"="#6666DD"))

      ## See also the examples in the vignette and on the manual page
      ##  of the class 'AlignedGenomeIntervals'

[Package girafe version 1.38.0 Index]