Title: | scanMiR shiny application |
---|---|
Description: | A shiny interface to the scanMiR package. The application enables the scanning of transcripts and custom sequences for miRNA binding sites, the visualization of KdModels and binding results, as well as browsing predicted repression data. In addition contains the IndexedFst class for fast indexed reading of large GenomicRanges or data.frames, and some utilities for facilitating scans and identifying enriched miRNA-target pairs. |
Authors: | Pierre-Luc Germain [cre, aut] , Michael Soutschek [aut], Fridolin Gross [ctb] |
Maintainer: | Pierre-Luc Germain <[email protected]> |
License: | GPL-3 |
Version: | 1.13.0 |
Built: | 2024-11-21 06:13:33 UTC |
Source: | https://github.com/bioc/scanMiRApp |
Identifies pairs of miRNA and target transcripts that have an unexpectedly high number of sites.
enrichedMirTxPairs(m, minSites = 5, max.binom.p = 0.001)
enrichedMirTxPairs(m, minSites = 5, max.binom.p = 0.001)
m |
A GRanges of matches, as produced by |
minSites |
The minimum number of sites for a given miRNA-target pair to be considered. |
max.binom.p |
The maximum binomial p-value of miRNA-target pairs. |
A data.frame of top combinations, including number of sites and the log-transformed binomial p-value.
# we create a dummy scan (see `runFullScan`) library(scanMiR) seqs <- getRandomSeq(n=10) mirs <- c("TTGTATAA","AGCATTAA") m <- findSeedMatches(seqs,mirs,verbose=FALSE) # we look for enriched pairs res <- enrichedMirTxPairs(m, minSites=1, max.binom.p=1) res
# we create a dummy scan (see `runFullScan`) library(scanMiR) seqs <- getRandomSeq(n=10) mirs <- c("TTGTATAA","AGCATTAA") m <- findSeedMatches(seqs,mirs,verbose=FALSE) # we look for enriched pairs res <- enrichedMirTxPairs(m, minSites=1, max.binom.p=1) res
A fake transcript database used for examples.
a named character vector of length 1.
Utility wrapper to extracts the sequence of a given transcript (UTR or CDS+UTR).
getTranscriptSequence( tx = NULL, annotation, annoFilter = NULL, extract = c("UTRonly", "withORF", "exons"), ... )
getTranscriptSequence( tx = NULL, annotation, annoFilter = NULL, extract = c("UTRonly", "withORF", "exons"), ... )
tx |
The ensembl ID of the transcript(s) |
annotation |
A |
annoFilter |
An optional 'AnnotationFilter' or 'AnnotationFilterList' to further filter the set of transcripts to be extracted |
extract |
Which parts of the transcripts to extract. For 'UTRonly' (default) only the 3' UTR regions are extracted, 'withORF' additionally extracts the coding regions, and 'exons' extracts all exons |
... |
Passed to |
A DNAStringSet
.
anno <- ScanMiRAnno("fake") seq <- getTranscriptSequence( tx="ENSTFAKE0000056456", annotation=anno )
anno <- ScanMiRAnno("fake") seq <- getTranscriptSequence( tx="ENSTFAKE0000056456", annotation=anno )
Objects of the IndexedFst class enable fast named random access to FST files. This is particularly appropriate for large data.frames which often need to be accessed according to the (e.g. factor) value of a particular column.
## S4 method for signature 'IndexedFst' show(object) ## S4 method for signature 'IndexedFst' summary(object) ## S4 method for signature 'IndexedFst' names(x) ## S4 method for signature 'IndexedFst' length(x) ## S4 method for signature 'IndexedFst' lengths(x) ## S4 method for signature 'IndexedFst' nrow(x) ## S4 method for signature 'IndexedFst' ncol(x) ## S4 method for signature 'IndexedFst' colnames(x) ## S4 method for signature 'IndexedFst,ANY,ANY' x[[i, j = NULL, ...]] ## S4 method for signature 'IndexedFst,ANY,ANY,ANY' x[i, j = NULL, ..., drop = TRUE] ## S4 method for signature 'IndexedFst' x$name ## S4 method for signature 'IndexedFst' head(x, n = 6L, ...) ## S4 method for signature 'IndexedFst' as.data.frame(x, name)
## S4 method for signature 'IndexedFst' show(object) ## S4 method for signature 'IndexedFst' summary(object) ## S4 method for signature 'IndexedFst' names(x) ## S4 method for signature 'IndexedFst' length(x) ## S4 method for signature 'IndexedFst' lengths(x) ## S4 method for signature 'IndexedFst' nrow(x) ## S4 method for signature 'IndexedFst' ncol(x) ## S4 method for signature 'IndexedFst' colnames(x) ## S4 method for signature 'IndexedFst,ANY,ANY' x[[i, j = NULL, ...]] ## S4 method for signature 'IndexedFst,ANY,ANY,ANY' x[i, j = NULL, ..., drop = TRUE] ## S4 method for signature 'IndexedFst' x$name ## S4 method for signature 'IndexedFst' head(x, n = 6L, ...) ## S4 method for signature 'IndexedFst' as.data.frame(x, name)
object |
an IndexedFst object |
x |
an IndexedFst object |
i |
the desired index (either numeric or name) |
j , drop
|
ignored |
... |
ignored |
name |
the indexed name to fetch |
n |
the desired number of rows |
Depends on the method
Pierre-Luc Germain, [email protected]
saveIndexedFst
, loadIndexedFst
# we first create and save an indexed FST file tmp <- tempdir() f <- system.file(tmp, "test") d <- data.frame( category=sample(LETTERS[1:4], 10000, replace=TRUE), var2=sample(LETTERS, 10000, replace=TRUE), var3=runif(10000) ) format(object.size(d),units="Kb") saveIndexedFst(d, "category", f) rm(d) # we then load the index, and can use category names for random access: d <- loadIndexedFst(f) format(object.size(d),units="Kb") nrow(d) names(d) head(d$A)
# we first create and save an indexed FST file tmp <- tempdir() f <- system.file(tmp, "test") d <- data.frame( category=sample(LETTERS[1:4], 10000, replace=TRUE), var2=sample(LETTERS, 10000, replace=TRUE), var3=runif(10000) ) format(object.size(d),units="Kb") saveIndexedFst(d, "category", f) rm(d) # we then load the index, and can use category names for random access: d <- loadIndexedFst(f) format(object.size(d),units="Kb") nrow(d) names(d) head(d$A)
Functions to save or load and indexed fst
file
Saves a data.frame (or GRanges object) into an indexed FST file.
loadIndexedFst(file, nthreads = 1) saveIndexedFst( d, index.by, file.prefix, nthreads = 1, index.properties = NULL, add.info = list(), ... )
loadIndexedFst(file, nthreads = 1) saveIndexedFst( d, index.by, file.prefix, nthreads = 1, index.properties = NULL, add.info = list(), ... )
file |
Path to the fst file, it's index (.idx), or their prefix. |
nthreads |
Number of threads to use for reading (default 1). This does not affect the loading of the index itself, but will affect all downstream reading operations performed on the object. If NULL, will use 'fst::threads_fst()'. |
d |
A data.frame or |
index.by |
A column of 'd' by which it should be indexed. |
file.prefix |
Path and prefix of the output files. |
index.properties |
An optional data.frame of properties, with the levels of 'index.by' as row names. |
add.info |
An optional list of additional information to save. |
... |
Passed to 'write.fst' |
'loadIndexedFst' returns an object of class
IndexedFst-class
, and 'saveIndexedFst' returns nothing.
# we first create and save an indexed FST file tmp <- tempdir() f <- system.file(tmp, "test") d <- data.frame( category=sample(LETTERS[1:4], 10000, replace=TRUE), var2=sample(LETTERS, 10000, replace=TRUE), var3=runif(10000) ) saveIndexedFst(d, "category", f) # we then load the index, and can use category names for random access: d <- loadIndexedFst(f)
# we first create and save an indexed FST file tmp <- tempdir() f <- system.file(tmp, "test") d <- data.frame( category=sample(LETTERS[1:4], 10000, replace=TRUE), var2=sample(LETTERS, 10000, replace=TRUE), var3=runif(10000) ) saveIndexedFst(d, "category", f) # we then load the index, and can use category names for random access: d <- loadIndexedFst(f)
Wrapper function with minimal arguments to plot scanMiR-Binding sites on 3'UTRs of specified transcripts. The red dashed line indicates the background threshhold is indicated, the lightblue dashed line shows the average 8mer dissociation rate of the given miRNA
plotSitesOnUTR( tx, annotation, miRNA = NULL, label_6mers = FALSE, label_notes = FALSE, verbose = TRUE, ... )
plotSitesOnUTR( tx, annotation, miRNA = NULL, label_6mers = FALSE, label_notes = FALSE, verbose = TRUE, ... )
tx |
An ensembl TranscriptID |
annotation |
A |
miRNA |
A miRNA name in the mirbase format (eg. "hsa-miR-485-5p"), a 'KdModel', or a miRNA sequence or target seed. |
label_6mers |
Logical whether to label 6mer sites in the plot |
label_notes |
Logical whether to label special sites in the plot (as TDMD or Slicing) |
verbose |
Logical; whether to print updates on the processing |
... |
Any further arguments passed to
|
Returns a ggplot.
anno <- ScanMiRAnno("fake") plotSitesOnUTR( tx="ENSTFAKE0000056456", annotation=anno, miRNA="hsa-miR-155-5p" )
anno <- ScanMiRAnno("fake") plotSitesOnUTR( tx="ENSTFAKE0000056456", annotation=anno, miRNA="hsa-miR-155-5p" )
Runs a full miRNA scan on all protein-coding transcripts (or UTRs) of an annotation.
runFullScan( annotation, mods = NULL, annoFilter = NULL, extract = c("UTRonly", "withORF", "exons"), onlyCanonical = TRUE, shadow = 15, cores = 1, maxLogKd = c(-1, -1.5), save.path = NULL, ... )
runFullScan( annotation, mods = NULL, annoFilter = NULL, extract = c("UTRonly", "withORF", "exons"), onlyCanonical = TRUE, shadow = 15, cores = 1, maxLogKd = c(-1, -1.5), save.path = NULL, ... )
annotation |
A |
mods |
An optional 'KdModelList' (defaults to the one in 'annotation') |
annoFilter |
An optional 'AnnotationFilter' or 'AnnotationFilterList' to filter the set of transcripts to be extracted |
extract |
Which parts of the transcripts to extract. For 'UTRonly' (default) only the 3' UTR regions are extracted, 'withORF' additionally extracts the coding regions, and 'exons' extracts all exons |
onlyCanonical |
passed to |
shadow |
The size of the ribosomal shadow at the UTR starts |
cores |
The number of threads to use. Alternatively accepts a
|
maxLogKd |
The maximum log_kd of sites to report |
save.path |
Optional, the path to which to save the results |
... |
Arguments passed to |
A 'GRanges' object
anno <- ScanMiRAnno("fake") m <- runFullScan( annotation=anno ) m
anno <- ScanMiRAnno("fake") m <- runFullScan( annotation=anno ) m
ScanMiRAnno
ScanMiRAnno( species = NULL, genome = NULL, ensdb = NULL, models = NULL, scan = NULL, aggregated = NULL, version = NULL, addDBs = list(), ... )
ScanMiRAnno( species = NULL, genome = NULL, ensdb = NULL, models = NULL, scan = NULL, aggregated = NULL, version = NULL, addDBs = list(), ... )
species |
The species/build acronym for automatic construction; if omitted, 'genome' and 'ensdb' should be given. Current possible values are: GRCh38, GRCm38, GRCm39, Rnor_6. |
genome |
A BSgenome-class, or a
|
ensdb |
An EnsDb-class (or a TxDb-class) object |
models |
An optional KdModelList |
scan |
An optional full scan (IndexedFst or GRanges) |
aggregated |
An optional per-transcript aggregation (IndexedFst or data.frame) |
version |
optional ensembl version |
addDBs |
A named list of additional tx-miRNA databases, each of which should be a data.frame with the columns 'transcript', 'miRNA', and 'score'. |
... |
Arguments passed to 'AnnotationHub' |
A 'ScanMiRAnno' object
anno <- ScanMiRAnno(species="fake") anno
anno <- ScanMiRAnno(species="fake") anno
ScanMiRAnno
classMethods for the ScanMiRAnno
class
## S4 method for signature 'ScanMiRAnno' summary(object) ## S4 method for signature 'ScanMiRAnno' show(object)
## S4 method for signature 'ScanMiRAnno' summary(object) ## S4 method for signature 'ScanMiRAnno' show(object)
object |
An object of class |
Depends on the method.
scanMiRApp A wrapper for launching the scanMiRApp shiny app
scanMiRApp(annotations = NULL, ...)
scanMiRApp(annotations = NULL, ...)
annotations |
A named list of |
... |
Passed to |
A shiny app
if(interactive()){ anno <- ScanMiRAnno("fake") scanMiRApp(list(fakeAnno=anno)) }
if(interactive()){ anno <- ScanMiRAnno("fake") scanMiRApp(list(fakeAnno=anno)) }
Server function for the scanMiR shiny app. Most users are expected to use
scanMiRApp
instead.
scanMiRserver( annotations = list(), modlists = NULL, maxCacheSize = 10 * 10^6, BP = SerialParam() )
scanMiRserver( annotations = list(), modlists = NULL, maxCacheSize = 10 * 10^6, BP = SerialParam() )
annotations |
A named list of |
modlists |
A named list of 'KdModelList' objects. If omitted, will fetch it from the annotation objects. |
maxCacheSize |
Maximum cache size in bytes. |
BP |
BPPARAM for multithreading |
A shiny server function
# we'd normally fetch a real annotation: # anno <- ScanMiRAnno("Rnor_6") # here we'll use a fake one: anno <- ScanMiRAnno("fake") srv <- scanMiRserver(list(fake=anno))
# we'd normally fetch a real annotation: # anno <- ScanMiRAnno("Rnor_6") # here we'll use a fake one: anno <- ScanMiRAnno("fake") srv <- scanMiRserver(list(fake=anno))
UI for the scanMiR app.
scanMiRui()
scanMiRui()
A shiny ui
ui <- scanMiRui()
ui <- scanMiRui()