Contents

1 Data preparation

miRmine dataset contains rich metadata around 304 selected publicly available, miRNA-Seq experiments. Authors’ processed the data with miRdeep2 using annotation files from miRBase v21. Mentioned metadata is used as colData and miRBase annotations as GRanges are used as rowRanges while preparing this dataset as RangedSummarizedExperiment. Data used for preprocessing and constructing the miRmine RangedSummarizedExperiment are available in extdata folder. Details of this proccess could be followed in data help file: ?miRmine.

#library(GenomicRanges)
#library(rtracklayer)
#library(SummarizedExperiment)
#library(Biostrings)
#library(Rsamtools)

ext.data <- system.file("extdata", package = "miRmine")
list.files(ext.data)
## [1] "hsa.gff3"               "mature.fa"              "mature.fa.fai"         
## [4] "miRmine-cell-lines.csv" "miRmine-info.txt"       "miRmine-tissues.csv"

Number of ranges from miRBase GFF and number of features output by miRdeep2 are not the same (2813 vs. 2822). After closer look it turns out that 2 rows from either tissues or cell.lines data are duplicated (with same mature miRNA and same precursor miRNA) and 7 rows don’t correspond to mirna/precursor combination existing in miRBase v21. These rows were removed for all samples, as seen in ?miRmine.

2 Usage

To load this dataset use:

library("miRmine")
## Loading required package: SummarizedExperiment
## Loading required package: MatrixGenerics
## Loading required package: matrixStats
## 
## Attaching package: 'MatrixGenerics'
## The following objects are masked from 'package:matrixStats':
## 
##     colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
##     colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
##     colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
##     colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
##     colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
##     colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
##     colWeightedMeans, colWeightedMedians, colWeightedSds,
##     colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
##     rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
##     rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
##     rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
##     rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
##     rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
##     rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
##     rowWeightedSds, rowWeightedVars
## Loading required package: GenomicRanges
## Loading required package: stats4
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
## 
##     Filter, Find, Map, Position, Reduce, anyDuplicated, append,
##     as.data.frame, basename, cbind, colnames, dirname, do.call,
##     duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
##     lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
##     pmin.int, rank, rbind, rownames, sapply, setdiff, sort, table,
##     tapply, union, unique, unsplit, which.max, which.min
## Loading required package: S4Vectors
## 
## Attaching package: 'S4Vectors'
## The following objects are masked from 'package:base':
## 
##     I, expand.grid, unname
## Loading required package: IRanges
## Loading required package: GenomeInfoDb
## Loading required package: Biobase
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## 
## Attaching package: 'Biobase'
## The following object is masked from 'package:MatrixGenerics':
## 
##     rowMedians
## The following objects are masked from 'package:matrixStats':
## 
##     anyMissing, rowMedians
data(miRmine)
miRmine
## class: RangedSummarizedExperiment 
## dim: 2813 304 
## metadata(0):
## assays(1): counts
## rownames(2813): hsa-let-7a-2-3p.hsa-let-7a-2 hsa-let-7a-3p.hsa-let-7a-1
##   ... hsa-miR-99b-3p.hsa-mir-99b hsa-miR-99b-5p.hsa-mir-99b
## rowData names(10): source type ... UniqueName mirna_seq
## colnames(304): DRX003170..Lung. DRX003171..Lung. ... SRX666573..C8166.
##   SRX666574..C8166.
## colData names(17): Experiment.Accession Tissue ... Total.RUNs
##   Total.Bases

You may want to further subset data on some of many colData features (Tissue, Cell Line, Disease, Sex, Instrument) or output some specifics of particular experiment(s) (Accession #, Description, Publication):

adenocarcinoma = miRmine[ , miRmine$Disease %in% c("Adenocarcinoma")]
adenocarcinoma
## class: RangedSummarizedExperiment 
## dim: 2813 30 
## metadata(0):
## assays(1): counts
## rownames(2813): hsa-let-7a-2-3p.hsa-let-7a-2 hsa-let-7a-3p.hsa-let-7a-1
##   ... hsa-miR-99b-3p.hsa-mir-99b hsa-miR-99b-5p.hsa-mir-99b
## rowData names(10): source type ... UniqueName mirna_seq
## colnames(30): ERX358444..Hair.follicle. ERX358445..Hair.follicle. ...
##   SRX290601..Pancreas. SRX290617..Pancreas.
## colData names(17): Experiment.Accession Tissue ... Total.RUNs
##   Total.Bases
as.character(adenocarcinoma$Sample.Accession)
##  [1] "DRS016321" "DRS016322" "DRS016297" "DRS016298" "DRS016299" "DRS016300"
##  [7] "DRS016301" "DRS016302" "DRS016303" "DRS016304" "DRS016305" "DRS016306"
## [13] "DRS016307" "DRS016308" "DRS016309" "DRS016310" "DRS016311" "DRS016312"
## [19] "DRS016313" "DRS016314" "DRS016315" "DRS016316" "DRS016317" "DRS016318"
## [25] "DRS016319" "DRS016320" "DRS016289" "DRS016289" "DRS016293" "DRS016293"

rowRanges data is also rich in metadata, containing all the features from miRBase hsa.gff3, with addition of actual miRNA sequence as DNAString instance. For example to read the sequence of top expressed miRNA over a subset of samples:

top.mirna = names(sort(rowSums(assays(adenocarcinoma)$counts))[1])
rowRanges(adenocarcinoma)$mirna_seq[[top.mirna]]
## Loading required package: Biostrings
## Loading required package: XVector
## 
## Attaching package: 'Biostrings'
## The following object is masked from 'package:base':
## 
##     strsplit
## 16-letter DNAString object
## seq: CAAGCCCGACAAGCGC

miRmine could be directly used in DESeq2 (note that expression values are RPM not raw reads):

library("DESeq2")

mirmine.subset = miRmine[, miRmine$Tissue %in% c("Lung", "Saliva")]
mirmine.subset = SummarizedExperiment(
    assays = SimpleList(counts=ceiling(assays(mirmine.subset)$counts)), 
    colData=colData(mirmine.subset), 
    rowRanges=rowRanges(mirmine.subset),
    rowData=NULL
)

ddsSE <- DESeqDataSet(mirmine.subset, design = ~ Tissue)
## converting counts to integer mode
## factor levels were dropped which had no samples
ddsSE <- ddsSE[ rowSums(counts(ddsSE)) > 1, ]

dds <- DESeq(ddsSE)
## estimating size factors
## estimating dispersions
## gene-wise dispersion estimates
## mean-dispersion relationship
## final dispersion estimates
## fitting model and testing
res <- results(dds)
res
## log2 fold change (MLE): Tissue Saliva vs Lung 
## Wald test p-value: Tissue Saliva vs Lung 
## DataFrame with 1110 rows and 6 columns
##                               baseMean log2FoldChange     lfcSE      stat
##                              <numeric>      <numeric> <numeric> <numeric>
## hsa-let-7a-3p.hsa-let-7a-1     1.36878       -5.06122  4.407717  -1.14826
## hsa-let-7a-3p.hsa-let-7a-3     1.36878       -5.06122  4.407717  -1.14826
## hsa-let-7a-5p.hsa-let-7a-1 70832.41524       -6.66070  0.905381  -7.35679
## hsa-let-7a-5p.hsa-let-7a-2 70816.38028       -6.68916  0.910762  -7.34458
## hsa-let-7a-5p.hsa-let-7a-3 70796.45382       -6.69707  0.907304  -7.38128
## ...                                ...            ...       ...       ...
## hsa-miR-98-3p.hsa-mir-98       2.74944      -6.067066  4.104334 -1.478210
## hsa-miR-98-5p.hsa-mir-98     147.19291      -2.999533  1.451895 -2.065944
## hsa-miR-99a-5p.hsa-mir-99a    44.51050       3.346607  2.165446  1.545459
## hsa-miR-99b-3p.hsa-mir-99b    11.66482      -0.850215  3.003986 -0.283029
## hsa-miR-99b-5p.hsa-mir-99b   213.01781       1.560347  0.923541  1.689526
##                                 pvalue        padj
##                              <numeric>   <numeric>
## hsa-let-7a-3p.hsa-let-7a-1 2.50860e-01          NA
## hsa-let-7a-3p.hsa-let-7a-3 2.50860e-01          NA
## hsa-let-7a-5p.hsa-let-7a-1 1.88380e-13 5.44588e-12
## hsa-let-7a-5p.hsa-let-7a-2 2.06413e-13 5.70776e-12
## hsa-let-7a-5p.hsa-let-7a-3 1.56776e-13 4.74806e-12
## ...                                ...         ...
## hsa-miR-98-3p.hsa-mir-98     0.1393517    0.227835
## hsa-miR-98-5p.hsa-mir-98     0.0388338    0.088643
## hsa-miR-99a-5p.hsa-mir-99a   0.1222354    0.211830
## hsa-miR-99b-3p.hsa-mir-99b   0.7771547    0.836329
## hsa-miR-99b-5p.hsa-mir-99b   0.0911187    0.168955

Session info

## R Under development (unstable) (2021-11-10 r81171)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.3 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.15-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.15-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB              LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] DESeq2_1.35.0               Biostrings_2.63.0          
##  [3] XVector_0.35.0              miRmine_1.17.1             
##  [5] SummarizedExperiment_1.25.2 Biobase_2.55.0             
##  [7] GenomicRanges_1.47.5        GenomeInfoDb_1.31.1        
##  [9] IRanges_2.29.1              S4Vectors_0.33.4           
## [11] BiocGenerics_0.41.2         MatrixGenerics_1.7.0       
## [13] matrixStats_0.61.0          BiocStyle_2.23.0           
## 
## loaded via a namespace (and not attached):
##  [1] httr_1.4.2             sass_0.4.0             bit64_4.0.5           
##  [4] jsonlite_1.7.2         splines_4.2.0          bslib_0.3.1           
##  [7] assertthat_0.2.1       BiocManager_1.30.16    blob_1.2.2            
## [10] GenomeInfoDbData_1.2.7 yaml_2.2.1             pillar_1.6.4          
## [13] RSQLite_2.2.8          lattice_0.20-45        glue_1.5.0            
## [16] digest_0.6.28          RColorBrewer_1.1-2     colorspace_2.0-2      
## [19] htmltools_0.5.2        Matrix_1.3-4           pkgconfig_2.0.3       
## [22] XML_3.99-0.8           genefilter_1.77.0      bookdown_0.24         
## [25] zlibbioc_1.41.0        purrr_0.3.4            xtable_1.8-4          
## [28] scales_1.1.1           BiocParallel_1.29.2    tibble_3.1.6          
## [31] annotate_1.73.0        KEGGREST_1.35.0        generics_0.1.1        
## [34] ggplot2_3.3.5          ellipsis_0.3.2         cachem_1.0.6          
## [37] survival_3.2-13        magrittr_2.0.1         crayon_1.4.2          
## [40] memoise_2.0.0          evaluate_0.14          fansi_0.5.0           
## [43] tools_4.2.0            lifecycle_1.0.1        stringr_1.4.0         
## [46] locfit_1.5-9.4         munsell_0.5.0          DelayedArray_0.21.2   
## [49] AnnotationDbi_1.57.1   compiler_4.2.0         jquerylib_0.1.4       
## [52] rlang_0.4.12           grid_4.2.0             RCurl_1.98-1.5        
## [55] bitops_1.0-7           rmarkdown_2.11         gtable_0.3.0          
## [58] DBI_1.1.1              R6_2.5.1               dplyr_1.0.7           
## [61] knitr_1.36             utf8_1.2.2             fastmap_1.1.0         
## [64] bit_4.0.4              stringi_1.7.5          parallel_4.2.0        
## [67] Rcpp_1.0.7             vctrs_0.3.8            geneplotter_1.73.0    
## [70] png_0.1-7              tidyselect_1.1.1       xfun_0.28