Skip to contents

This article collects notes on Bioconductor packages, made available here to faciliate their use and extensions.

pkgs <- c("AnnotationDbi", "ComplexHeatmap", "DESeq2", "EnsDb.Hsapiens.v86",
          "FlowSorted.DLPFC.450k", "GeneNet", "GenomicFeatures", "RColorBrewer",
          "RMariaDB", "Rgraphviz", "S4Vectors", "SummarizedExperiment",
          "TxDb.Hsapiens.UCSC.hg38.knownGene", "bladderbatch", "clusterProfiler",
          "corpcor", "ensembldb", "fdrtool", "graph", "graphite", "heatmaply",
          "minfi", "org.Hs.eg.db", "plyr", "quantro", "recount3", "sva")
for (p in pkgs) if (length(grep(paste("^package:", p, "$", sep=""), search())) == 0) {
    if (!requireNamespace(p)) warning(paste0("This vignette needs package `", p, "'; please install"))
}
invisible(suppressMessages(lapply(pkgs, require, character.only = TRUE)))

Normalisation

ComBat

This is the documentation example, based on Bioconductor 3.14.

data(bladderdata)
dat <- bladderEset[1:50,]

pheno = pData(dat)
edata = exprs(dat)
batch = pheno$batch
mod = model.matrix(~as.factor(cancer), data=pheno)

# 1. parametric adjustment
combat_edata1 = ComBat(dat=edata, batch=batch, mod=NULL, par.prior=TRUE, prior.plots=TRUE)
#> Found5batches
#> Adjusting for0covariate(s) or covariate level(s)
#> Standardizing Data across genes
#> Fitting L/S model and finding priors
#> Finding parametric adjustments
#> Adjusting the Data


# 2. non-parametric adjustment, mean-only version
combat_edata2 = ComBat(dat=edata, batch=batch, mod=NULL, par.prior=FALSE, mean.only=TRUE)
#> Using the 'mean only' version of ComBat
#> Found5batches
#> Adjusting for0covariate(s) or covariate level(s)
#> Standardizing Data across genes
#> Fitting L/S model and finding priors
#> Finding nonparametric adjustments
#> Adjusting the Data

# 3. reference-batch version, with covariates
combat_edata3 = ComBat(dat=edata, batch=batch, mod=mod, par.prior=TRUE, ref.batch=3, prior.plots=TRUE)
#> Using batch =3as a reference batch (this batch won't change)
#> Found5batches
#> Adjusting for2covariate(s) or covariate level(s)
#> Standardizing Data across genes
#> Fitting L/S model and finding priors
#> Finding parametric adjustments
#> Adjusting the Data

quantro

Again, this is adapted from the package vignette. noting that FlowSorted.DLPFC.450k instead of FlowSorted is used.

p <- getBeta(FlowSorted.DLPFC.450k,offset=100)
#> Loading required package: IlluminaHumanMethylation450kmanifest
pd <- pData(FlowSorted.DLPFC.450k)
matdensity(p, groupFactor = pd$CellType, xlab = " ", ylab = "density",
           main = "Beta Values", brewer.n = 8, brewer.name = "Dark2")
legend('top', c("NeuN_neg", "NeuN_pos"), col = c(1, 2), lty = 1, lwd = 3)

matboxplot(p, groupFactor = pd$CellType, xaxt = "n", main = "Beta Values")

qtest <- quantro(object = p, groupFactor = pd$CellType)
#> [quantro] Average medians of the distributions are 
#>                         not equal across groups.
#> [quantro] Calculating the quantro test statistic.
#> [quantro] No permutation testing performed. 
#>                          Use B > 0 for permutation testing.
# commented since `R CMD check` returns error with multithreads
# registerDoParallel(cores=10)
# qtestPerm <- quantro(p, groupFactor = pd$CellType, B = 1000)
# qtestPerm
# quantroPlot(qtestPerm)

Differential expression

ex <- makeExampleDESeqDataSet(m=4)
dds <- DESeq(ex)
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing
res <- results(dds, contrast=c("condition","B","A"))
rld <- rlogTransformation(ex, blind=TRUE)
dat <- plotPCA(rld, intgroup=c("condition"),returnData=TRUE)
percentVar <- round(100 * attr(dat,"percentVar"))
ggplot(dat, aes(PC1, PC2, color=condition, shape=condition)) +
geom_point(size=3) +
xlab(paste0("PC1:",percentVar[1],"% variance")) +
ylab(paste0("PC2:",percentVar[2],"% variance"))

ex$condition <- relevel(ex$condition, ref="B")
dds2 <- DESeq(dds)
#> using pre-existing size factors
#> estimating dispersions
#> found already estimated dispersions, replacing these
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> final dispersion estimates
#> fitting model and testing
res <- results(dds2)
knitr::kable(head(as.data.frame(res)))
baseMean log2FoldChange lfcSE stat pvalue padj
gene1 28.167561 0.2630617 0.8025234 0.3277932 0.7430680 0.9997886
gene2 15.098426 -0.7958701 1.0446538 -0.7618506 0.4461491 0.9997886
gene3 5.379758 0.7466660 1.6849269 0.4431445 0.6576612 0.9997886
gene4 4.441821 -1.0354906 1.8684477 -0.5541983 0.5794431 0.9997886
gene5 125.710652 0.3613221 0.5068459 0.7128836 0.4759178 0.9997886
gene6 53.701231 0.7946552 0.6907505 1.1504228 0.2499698 0.9997886

See the package in action from a snakemake workflow.1

Gene co-expression and network analysis

A simple network is furnished with the GeneNet documentation example,

## A random network with 40 nodes 
# it contains 780=40*39/2 edges of which 5 percent (=39) are non-zero
true.pcor <- ggm.simulate.pcor(40)
  
# A data set with 40 observations
m.sim <- ggm.simulate.data(40, true.pcor)

# A simple estimate of partial correlations
estimated.pcor <- cor2pcor( cor(m.sim) )

# A comparison of estimated and true values
sum((true.pcor-estimated.pcor)^2)
#> [1] 231.7124

# A slightly better estimate ...
estimated.pcor.2 <- ggm.estimate.pcor(m.sim)
#> Estimating optimal shrinkage intensity lambda (correlation matrix): 0.3767
sum((true.pcor-estimated.pcor.2)^2)
#> [1] 9.613666

## ecoli data 
data(ecoli)

# partial correlation matrix 
inferred.pcor <- ggm.estimate.pcor(ecoli)
#> Estimating optimal shrinkage intensity lambda (correlation matrix): 0.1804

# p-values, q-values and posterior probabilities for each potential edge 
test.results <- network.test.edges(inferred.pcor)
#> Estimate (local) false discovery rates (partial correlations):
#> Step 1... determine cutoff point
#> Step 2... estimate parameters of null distribution and eta0
#> Step 3... compute p-values and estimate empirical PDF/CDF
#> Step 4... compute q-values and local fdr
#> Step 5... prepare for plotting

# best 20 edges (strongest correlation)
test.results[1:20,]
#>           pcor node1 node2         pval         qval      prob
#> 1   0.23185664    51    53 2.220446e-16 3.612205e-13 1.0000000
#> 2   0.22405545    52    53 2.220446e-16 3.612205e-13 1.0000000
#> 3   0.21507824    51    52 2.220446e-16 3.612205e-13 1.0000000
#> 4   0.17328863     7    93 3.108624e-15 3.792816e-12 0.9999945
#> 5  -0.13418892    29    86 1.120813e-09 1.093998e-06 0.9999516
#> 6   0.12594697    21    72 1.103837e-08 8.978569e-06 0.9998400
#> 7   0.11956105    28    86 5.890927e-08 3.853592e-05 0.9998400
#> 8  -0.11723897    26    80 1.060526e-07 5.816175e-05 0.9998400
#> 9  -0.11711625    72    89 1.093655e-07 5.930502e-05 0.9972804
#> 10  0.10658013    20    21 1.366611e-06 5.925278e-04 0.9972804
#> 11  0.10589778    21    73 1.596860e-06 6.678431e-04 0.9972804
#> 12  0.10478689    20    91 2.053404e-06 8.024428e-04 0.9972804
#> 13  0.10420836     7    52 2.338383e-06 8.778608e-04 0.9944557
#> 14  0.10236077    87    95 3.525188e-06 1.224964e-03 0.9944557
#> 15  0.10113550    27    95 4.610445e-06 1.500048e-03 0.9920084
#> 16  0.09928954    21    51 6.868360e-06 2.046550e-03 0.9920084
#> 17  0.09791914    21    88 9.192376e-06 2.520617e-03 0.9920084
#> 18  0.09719685    18    95 1.070233e-05 2.790103e-03 0.9920084
#> 19  0.09621791    28    90 1.313008e-05 3.171818e-03 0.9920084
#> 20  0.09619099    12    80 1.320374e-05 3.182527e-03 0.9920084

# network containing edges with prob > 0.9 (i.e. local fdr < 0.1)
net <- extract.network(test.results, cutoff.ggm=0.9)
#> 
#> Significant edges:  65 
#>     Corresponding to  1.26 %  of possible edges
net
#>           pcor node1 node2         pval         qval      prob
#> 1   0.23185664    51    53 2.220446e-16 3.612205e-13 1.0000000
#> 2   0.22405545    52    53 2.220446e-16 3.612205e-13 1.0000000
#> 3   0.21507824    51    52 2.220446e-16 3.612205e-13 1.0000000
#> 4   0.17328863     7    93 3.108624e-15 3.792816e-12 0.9999945
#> 5  -0.13418892    29    86 1.120813e-09 1.093998e-06 0.9999516
#> 6   0.12594697    21    72 1.103837e-08 8.978569e-06 0.9998400
#> 7   0.11956105    28    86 5.890927e-08 3.853592e-05 0.9998400
#> 8  -0.11723897    26    80 1.060526e-07 5.816175e-05 0.9998400
#> 9  -0.11711625    72    89 1.093655e-07 5.930502e-05 0.9972804
#> 10  0.10658013    20    21 1.366611e-06 5.925278e-04 0.9972804
#> 11  0.10589778    21    73 1.596860e-06 6.678431e-04 0.9972804
#> 12  0.10478689    20    91 2.053404e-06 8.024428e-04 0.9972804
#> 13  0.10420836     7    52 2.338383e-06 8.778608e-04 0.9944557
#> 14  0.10236077    87    95 3.525188e-06 1.224964e-03 0.9944557
#> 15  0.10113550    27    95 4.610445e-06 1.500048e-03 0.9920084
#> 16  0.09928954    21    51 6.868360e-06 2.046550e-03 0.9920084
#> 17  0.09791914    21    88 9.192376e-06 2.520617e-03 0.9920084
#> 18  0.09719685    18    95 1.070233e-05 2.790103e-03 0.9920084
#> 19  0.09621791    28    90 1.313008e-05 3.171818e-03 0.9920084
#> 20  0.09619099    12    80 1.320374e-05 3.182527e-03 0.9920084
#> 21  0.09576091    89    95 1.443542e-05 3.354778e-03 0.9891317
#> 22  0.09473210     7    51 1.784127e-05 3.864827e-03 0.9891317
#> 23 -0.09386896    53    58 2.127623e-05 4.313591e-03 0.9891317
#> 24 -0.09366615    29    83 2.217013e-05 4.421101e-03 0.9891317
#> 25 -0.09341148    21    89 2.334321e-05 4.556948e-03 0.9810727
#> 26 -0.09156391    49    93 3.380044e-05 5.955974e-03 0.9810727
#> 27 -0.09150710    80    90 3.418364e-05 6.002084e-03 0.9810727
#> 28  0.09101505     7    53 3.767967e-05 6.408104e-03 0.9810727
#> 29  0.09050688    21    84 4.164472e-05 6.838785e-03 0.9810727
#> 30  0.08965490    72    73 4.919367e-05 7.581868e-03 0.9810727
#> 31 -0.08934025    29    99 5.229606e-05 7.861419e-03 0.9810727
#> 32 -0.08906819     9    95 5.512710e-05 8.104761e-03 0.9810727
#> 33  0.08888345     2    49 5.713146e-05 8.270675e-03 0.9810727
#> 34  0.08850681    86    90 6.143364e-05 8.610164e-03 0.9810727
#> 35  0.08805868    17    53 6.695172e-05 9.015178e-03 0.9810727
#> 36  0.08790809    28    48 6.890886e-05 9.151294e-03 0.9810727
#> 37  0.08783471    33    58 6.988213e-05 9.217600e-03 0.9682377
#> 38 -0.08705796     7    49 8.101246e-05 1.021362e-02 0.9682377
#> 39  0.08645033    20    46 9.086550e-05 1.102467e-02 0.9682377
#> 40  0.08609950    48    86 9.705865e-05 1.150393e-02 0.9682377
#> 41  0.08598769    21    52 9.911461e-05 1.165817e-02 0.9682377
#> 42  0.08555275    32    95 1.075099e-04 1.226435e-02 0.9682377
#> 43  0.08548231    17    51 1.089311e-04 1.236337e-02 0.9424721
#> 44  0.08470370    80    83 1.258659e-04 1.382357e-02 0.9424721
#> 45  0.08442510    80    82 1.325063e-04 1.437068e-02 0.9174572
#> 46  0.08271606    80    93 1.810275e-04 1.845632e-02 0.9174572
#> 47  0.08235175    46    91 1.933329e-04 1.941580e-02 0.9174572
#> 48  0.08217787    25    95 1.994789e-04 1.988433e-02 0.9174572
#> 49 -0.08170331    29    87 2.171999e-04 2.119715e-02 0.9174572
#> 50  0.08123632    19    29 2.360717e-04 2.253606e-02 0.9174572
#> 51  0.08101702    51    84 2.454547e-04 2.318025e-02 0.9174572
#> 52  0.08030748    16    93 2.782643e-04 2.532796e-02 0.9174572
#> 53  0.08006503    28    52 2.903870e-04 2.608272e-02 0.9174572
#> 54 -0.07941656    41    80 3.252834e-04 2.814825e-02 0.9174572
#> 55  0.07941410    54    89 3.254230e-04 2.815621e-02 0.9174572
#> 56 -0.07934653    28    80 3.292785e-04 2.837512e-02 0.9174572
#> 57  0.07916783    29    92 3.396803e-04 2.895702e-02 0.9174572
#> 58 -0.07866905    17    86 3.703636e-04 3.060294e-02 0.9174572
#> 59  0.07827749    16    29 3.962447e-04 3.191463e-02 0.9174572
#> 60 -0.07808262    73    89 4.097453e-04 3.257290e-02 0.9174572
#> 61  0.07766261    52    67 4.403166e-04 3.400207e-02 0.9174572
#> 62  0.07762917    25    87 4.428397e-04 3.411638e-02 0.9174572
#> 63 -0.07739378     9    93 4.609873e-04 3.492296e-02 0.9174572
#> 64  0.07738885    31    80 4.613748e-04 3.493988e-02 0.9174572
#> 65 -0.07718681    80    94 4.775137e-04 3.563445e-02 0.9174572

# significant based on FDR cutoff Q=0.05?
num.significant.1 <- sum(test.results$qval <= 0.05)
test.results[1:num.significant.1,]
#>           pcor node1 node2         pval         qval      prob
#> 1   0.23185664    51    53 2.220446e-16 3.612205e-13 1.0000000
#> 2   0.22405545    52    53 2.220446e-16 3.612205e-13 1.0000000
#> 3   0.21507824    51    52 2.220446e-16 3.612205e-13 1.0000000
#> 4   0.17328863     7    93 3.108624e-15 3.792816e-12 0.9999945
#> 5  -0.13418892    29    86 1.120813e-09 1.093998e-06 0.9999516
#> 6   0.12594697    21    72 1.103837e-08 8.978569e-06 0.9998400
#> 7   0.11956105    28    86 5.890927e-08 3.853592e-05 0.9998400
#> 8  -0.11723897    26    80 1.060526e-07 5.816175e-05 0.9998400
#> 9  -0.11711625    72    89 1.093655e-07 5.930502e-05 0.9972804
#> 10  0.10658013    20    21 1.366611e-06 5.925278e-04 0.9972804
#> 11  0.10589778    21    73 1.596860e-06 6.678431e-04 0.9972804
#> 12  0.10478689    20    91 2.053404e-06 8.024428e-04 0.9972804
#> 13  0.10420836     7    52 2.338383e-06 8.778608e-04 0.9944557
#> 14  0.10236077    87    95 3.525188e-06 1.224964e-03 0.9944557
#> 15  0.10113550    27    95 4.610445e-06 1.500048e-03 0.9920084
#> 16  0.09928954    21    51 6.868360e-06 2.046550e-03 0.9920084
#> 17  0.09791914    21    88 9.192376e-06 2.520617e-03 0.9920084
#> 18  0.09719685    18    95 1.070233e-05 2.790103e-03 0.9920084
#> 19  0.09621791    28    90 1.313008e-05 3.171818e-03 0.9920084
#> 20  0.09619099    12    80 1.320374e-05 3.182527e-03 0.9920084
#> 21  0.09576091    89    95 1.443542e-05 3.354778e-03 0.9891317
#> 22  0.09473210     7    51 1.784127e-05 3.864827e-03 0.9891317
#> 23 -0.09386896    53    58 2.127623e-05 4.313591e-03 0.9891317
#> 24 -0.09366615    29    83 2.217013e-05 4.421101e-03 0.9891317
#> 25 -0.09341148    21    89 2.334321e-05 4.556948e-03 0.9810727
#> 26 -0.09156391    49    93 3.380044e-05 5.955974e-03 0.9810727
#> 27 -0.09150710    80    90 3.418364e-05 6.002084e-03 0.9810727
#> 28  0.09101505     7    53 3.767967e-05 6.408104e-03 0.9810727
#> 29  0.09050688    21    84 4.164472e-05 6.838785e-03 0.9810727
#> 30  0.08965490    72    73 4.919367e-05 7.581868e-03 0.9810727
#> 31 -0.08934025    29    99 5.229606e-05 7.861419e-03 0.9810727
#> 32 -0.08906819     9    95 5.512710e-05 8.104761e-03 0.9810727
#> 33  0.08888345     2    49 5.713146e-05 8.270675e-03 0.9810727
#> 34  0.08850681    86    90 6.143364e-05 8.610164e-03 0.9810727
#> 35  0.08805868    17    53 6.695172e-05 9.015178e-03 0.9810727
#> 36  0.08790809    28    48 6.890886e-05 9.151294e-03 0.9810727
#> 37  0.08783471    33    58 6.988213e-05 9.217600e-03 0.9682377
#> 38 -0.08705796     7    49 8.101246e-05 1.021362e-02 0.9682377
#> 39  0.08645033    20    46 9.086550e-05 1.102467e-02 0.9682377
#> 40  0.08609950    48    86 9.705865e-05 1.150393e-02 0.9682377
#> 41  0.08598769    21    52 9.911461e-05 1.165817e-02 0.9682377
#> 42  0.08555275    32    95 1.075099e-04 1.226435e-02 0.9682377
#> 43  0.08548231    17    51 1.089311e-04 1.236337e-02 0.9424721
#> 44  0.08470370    80    83 1.258659e-04 1.382357e-02 0.9424721
#> 45  0.08442510    80    82 1.325063e-04 1.437068e-02 0.9174572
#> 46  0.08271606    80    93 1.810275e-04 1.845632e-02 0.9174572
#> 47  0.08235175    46    91 1.933329e-04 1.941580e-02 0.9174572
#> 48  0.08217787    25    95 1.994789e-04 1.988433e-02 0.9174572
#> 49 -0.08170331    29    87 2.171999e-04 2.119715e-02 0.9174572
#> 50  0.08123632    19    29 2.360717e-04 2.253606e-02 0.9174572
#> 51  0.08101702    51    84 2.454547e-04 2.318025e-02 0.9174572
#> 52  0.08030748    16    93 2.782643e-04 2.532796e-02 0.9174572
#> 53  0.08006503    28    52 2.903870e-04 2.608272e-02 0.9174572
#> 54 -0.07941656    41    80 3.252834e-04 2.814825e-02 0.9174572
#> 55  0.07941410    54    89 3.254230e-04 2.815621e-02 0.9174572
#> 56 -0.07934653    28    80 3.292785e-04 2.837512e-02 0.9174572
#> 57  0.07916783    29    92 3.396803e-04 2.895702e-02 0.9174572
#> 58 -0.07866905    17    86 3.703636e-04 3.060294e-02 0.9174572
#> 59  0.07827749    16    29 3.962447e-04 3.191463e-02 0.9174572
#> 60 -0.07808262    73    89 4.097453e-04 3.257290e-02 0.9174572
#> 61  0.07766261    52    67 4.403166e-04 3.400207e-02 0.9174572
#> 62  0.07762917    25    87 4.428397e-04 3.411638e-02 0.9174572
#> 63 -0.07739378     9    93 4.609873e-04 3.492296e-02 0.9174572
#> 64  0.07738885    31    80 4.613748e-04 3.493988e-02 0.9174572
#> 65 -0.07718681    80    94 4.775137e-04 3.563445e-02 0.9174572
#> 66  0.07706275    27    58 4.876832e-04 3.606179e-02 0.8297810
#> 67 -0.07610709    16    83 5.730534e-04 4.085920e-02 0.8297810
#> 68  0.07550557    53    84 6.337144e-04 4.406473e-02 0.8297810

# significant based on "local fdr" cutoff (prob > 0.9)?
num.significant.2 <- sum(test.results$prob > 0.9)
test.results[test.results$prob > 0.9,]
#>           pcor node1 node2         pval         qval      prob
#> 1   0.23185664    51    53 2.220446e-16 3.612205e-13 1.0000000
#> 2   0.22405545    52    53 2.220446e-16 3.612205e-13 1.0000000
#> 3   0.21507824    51    52 2.220446e-16 3.612205e-13 1.0000000
#> 4   0.17328863     7    93 3.108624e-15 3.792816e-12 0.9999945
#> 5  -0.13418892    29    86 1.120813e-09 1.093998e-06 0.9999516
#> 6   0.12594697    21    72 1.103837e-08 8.978569e-06 0.9998400
#> 7   0.11956105    28    86 5.890927e-08 3.853592e-05 0.9998400
#> 8  -0.11723897    26    80 1.060526e-07 5.816175e-05 0.9998400
#> 9  -0.11711625    72    89 1.093655e-07 5.930502e-05 0.9972804
#> 10  0.10658013    20    21 1.366611e-06 5.925278e-04 0.9972804
#> 11  0.10589778    21    73 1.596860e-06 6.678431e-04 0.9972804
#> 12  0.10478689    20    91 2.053404e-06 8.024428e-04 0.9972804
#> 13  0.10420836     7    52 2.338383e-06 8.778608e-04 0.9944557
#> 14  0.10236077    87    95 3.525188e-06 1.224964e-03 0.9944557
#> 15  0.10113550    27    95 4.610445e-06 1.500048e-03 0.9920084
#> 16  0.09928954    21    51 6.868360e-06 2.046550e-03 0.9920084
#> 17  0.09791914    21    88 9.192376e-06 2.520617e-03 0.9920084
#> 18  0.09719685    18    95 1.070233e-05 2.790103e-03 0.9920084
#> 19  0.09621791    28    90 1.313008e-05 3.171818e-03 0.9920084
#> 20  0.09619099    12    80 1.320374e-05 3.182527e-03 0.9920084
#> 21  0.09576091    89    95 1.443542e-05 3.354778e-03 0.9891317
#> 22  0.09473210     7    51 1.784127e-05 3.864827e-03 0.9891317
#> 23 -0.09386896    53    58 2.127623e-05 4.313591e-03 0.9891317
#> 24 -0.09366615    29    83 2.217013e-05 4.421101e-03 0.9891317
#> 25 -0.09341148    21    89 2.334321e-05 4.556948e-03 0.9810727
#> 26 -0.09156391    49    93 3.380044e-05 5.955974e-03 0.9810727
#> 27 -0.09150710    80    90 3.418364e-05 6.002084e-03 0.9810727
#> 28  0.09101505     7    53 3.767967e-05 6.408104e-03 0.9810727
#> 29  0.09050688    21    84 4.164472e-05 6.838785e-03 0.9810727
#> 30  0.08965490    72    73 4.919367e-05 7.581868e-03 0.9810727
#> 31 -0.08934025    29    99 5.229606e-05 7.861419e-03 0.9810727
#> 32 -0.08906819     9    95 5.512710e-05 8.104761e-03 0.9810727
#> 33  0.08888345     2    49 5.713146e-05 8.270675e-03 0.9810727
#> 34  0.08850681    86    90 6.143364e-05 8.610164e-03 0.9810727
#> 35  0.08805868    17    53 6.695172e-05 9.015178e-03 0.9810727
#> 36  0.08790809    28    48 6.890886e-05 9.151294e-03 0.9810727
#> 37  0.08783471    33    58 6.988213e-05 9.217600e-03 0.9682377
#> 38 -0.08705796     7    49 8.101246e-05 1.021362e-02 0.9682377
#> 39  0.08645033    20    46 9.086550e-05 1.102467e-02 0.9682377
#> 40  0.08609950    48    86 9.705865e-05 1.150393e-02 0.9682377
#> 41  0.08598769    21    52 9.911461e-05 1.165817e-02 0.9682377
#> 42  0.08555275    32    95 1.075099e-04 1.226435e-02 0.9682377
#> 43  0.08548231    17    51 1.089311e-04 1.236337e-02 0.9424721
#> 44  0.08470370    80    83 1.258659e-04 1.382357e-02 0.9424721
#> 45  0.08442510    80    82 1.325063e-04 1.437068e-02 0.9174572
#> 46  0.08271606    80    93 1.810275e-04 1.845632e-02 0.9174572
#> 47  0.08235175    46    91 1.933329e-04 1.941580e-02 0.9174572
#> 48  0.08217787    25    95 1.994789e-04 1.988433e-02 0.9174572
#> 49 -0.08170331    29    87 2.171999e-04 2.119715e-02 0.9174572
#> 50  0.08123632    19    29 2.360717e-04 2.253606e-02 0.9174572
#> 51  0.08101702    51    84 2.454547e-04 2.318025e-02 0.9174572
#> 52  0.08030748    16    93 2.782643e-04 2.532796e-02 0.9174572
#> 53  0.08006503    28    52 2.903870e-04 2.608272e-02 0.9174572
#> 54 -0.07941656    41    80 3.252834e-04 2.814825e-02 0.9174572
#> 55  0.07941410    54    89 3.254230e-04 2.815621e-02 0.9174572
#> 56 -0.07934653    28    80 3.292785e-04 2.837512e-02 0.9174572
#> 57  0.07916783    29    92 3.396803e-04 2.895702e-02 0.9174572
#> 58 -0.07866905    17    86 3.703636e-04 3.060294e-02 0.9174572
#> 59  0.07827749    16    29 3.962447e-04 3.191463e-02 0.9174572
#> 60 -0.07808262    73    89 4.097453e-04 3.257290e-02 0.9174572
#> 61  0.07766261    52    67 4.403166e-04 3.400207e-02 0.9174572
#> 62  0.07762917    25    87 4.428397e-04 3.411638e-02 0.9174572
#> 63 -0.07739378     9    93 4.609873e-04 3.492296e-02 0.9174572
#> 64  0.07738885    31    80 4.613748e-04 3.493988e-02 0.9174572
#> 65 -0.07718681    80    94 4.775137e-04 3.563445e-02 0.9174572

# parameters of the mixture distribution used to compute p-values etc.
c <- fdrtool(sm2vec(inferred.pcor), statistic="correlation")
#> Step 1... determine cutoff point
#> Step 2... estimate parameters of null distribution and eta0
#> Step 3... compute p-values and estimate empirical PDF/CDF
#> Step 4... compute q-values and local fdr
#> Step 5... prepare for plotting

c$param
#>          cutoff N.cens      eta0     eta0.SE    kappa kappa.SE
#> [1,] 0.03553068   4352 0.9474623 0.005656465 2043.377 94.72264

## A random network with 20 nodes and 10 percent (=19) edges
true.pcor <- ggm.simulate.pcor(20, 0.1)

# convert to edge list
test.results <- ggm.list.edges(true.pcor)[1:19,]
nlab <- LETTERS[1:20]

# graphviz
# network.make.dot(filename="test.dot", test.results, nlab, main = "A graph")
# system("fdp -T svg -o test.svg test.dot")

# Rgraphviz
gr <- network.make.graph( test.results, nlab)
gr
#> A graphNEL graph with directed edges
#> Number of Nodes = 20 
#> Number of Edges = 38
num.nodes(gr)
#> [1] 20
edge.info(gr)
#> $weight
#>      A~G      A~L      B~N      C~G      D~F      E~T      E~L      F~K 
#>  0.30150  0.43276  0.31852 -0.84373  0.34564  0.00540  0.43994  0.22434 
#>      F~P      F~S      F~T      F~H      H~S      I~K      I~J      J~K 
#>  0.31241 -0.43556  0.44821 -0.44838 -0.08991 -0.28767 -0.37601  0.50361 
#>      K~N      L~M      N~O 
#> -0.19796 -0.72855  0.79786 
#> 
#> $dir
#>    A~G    A~L    B~N    C~G    D~F    E~T    E~L    F~K    F~P    F~S    F~T 
#> "none" "none" "none" "none" "none" "none" "none" "none" "none" "none" "none" 
#>    F~H    H~S    I~K    I~J    J~K    K~N    L~M    N~O 
#> "none" "none" "none" "none" "none" "none" "none" "none"
gr2 <- network.make.graph( test.results, nlab, drop.singles=TRUE)
gr2
#> A graphNEL graph with directed edges
#> Number of Nodes = 18 
#> Number of Edges = 38
num.nodes(gr2)
#> [1] 18
edge.info(gr2)
#> $weight
#>      A~G      A~L      B~N      C~G      D~F      E~T      E~L      F~K 
#>  0.30150  0.43276  0.31852 -0.84373  0.34564  0.00540  0.43994  0.22434 
#>      F~P      F~S      F~T      F~H      H~S      I~K      I~J      J~K 
#>  0.31241 -0.43556  0.44821 -0.44838 -0.08991 -0.28767 -0.37601  0.50361 
#>      K~N      L~M      N~O 
#> -0.19796 -0.72855  0.79786 
#> 
#> $dir
#>    A~G    A~L    B~N    C~G    D~F    E~T    E~L    F~K    F~P    F~S    F~T 
#> "none" "none" "none" "none" "none" "none" "none" "none" "none" "none" "none" 
#>    F~H    H~S    I~K    I~J    J~K    K~N    L~M    N~O 
#> "none" "none" "none" "none" "none" "none" "none" "none"

# plot network
plot(gr, "fdp")
#> Warning in arrows(tail_from[1], tail_from[2], tail_to[1], tail_to[2], col =
#> edgeColor, : zero-length arrow is of indeterminate angle and so skipped
#> Warning in arrows(head_from[1], head_from[2], head_to[1], head_to[2], col =
#> edgeColor, : zero-length arrow is of indeterminate angle and so skipped

#> Warning in arrows(head_from[1], head_from[2], head_to[1], head_to[2], col =
#> edgeColor, : zero-length arrow is of indeterminate angle and so skipped

plot(gr2, "fdp")
#> Warning in arrows(head_from[1], head_from[2], head_to[1], head_to[2], col =
#> edgeColor, : zero-length arrow is of indeterminate angle and so skipped
#> Warning in arrows(tail_from[1], tail_from[2], tail_to[1], tail_to[2], col =
#> edgeColor, : zero-length arrow is of indeterminate angle and so skipped
#> Warning in arrows(head_from[1], head_from[2], head_to[1], head_to[2], col =
#> edgeColor, : zero-length arrow is of indeterminate angle and so skipped

A side-by-side heatmaps

set.seed(123454321)
m <- matrix(runif(2500),50)
r <- cor(m)
g <- as.matrix(r>=0.7)+0
f1 <- Heatmap(r)
f2 <- Heatmap(g)
f <- f1+f2
draw(f)


df <- normalize(mtcars)
heatmaply(df,k_col=5,k_row=5,colors = colorRampPalette(brewer.pal(3, "RdBu"))(256))

and a module analysis with WGCNA,

pwr <- c(1:10, seq(from=12, to=30, by=2))
sft <- pickSoftThreshold(dat, powerVector=pwr, verbose=5)
ADJ <- abs(cor(dat, method="pearson", use="pairwise.complete.obs"))^6
dissADJ <- 1-ADJ
dissTOM <- TOMdist(ADJ)
TOM <- TOMsimilarityFromExpr(dat)
Tree <- hclust(as.dist(1-TOM), method="average")
for(j in pwr)
{
  pam_name <- paste0("pam",j)
  assign(pam_name, pam(as.dist(dissADJ),j))
  pamTOM_name <- paste0("pamTOM",j)
  assign(pamTOM_name,pam(as.dist(dissTOM),j))
  tc <- table(get(pam_name)$clustering,get(pamTOM_name)$clustering)
  print(tc)
  print(diag(tc))
}
colorStaticTOM <- as.character(cutreeStaticColor(Tree,cutHeight=.99,minSize=5))
colorDynamicTOM <- labels2colors(cutreeDynamic(Tree,method="tree",minClusterSize=5))
Colors <- data.frame(pamTOM6$clustering,colorStaticTOM,colorDynamicTOM)
plotDendroAndColors(Tree, Colors, dendroLabels=FALSE, hang=0.03, addGuide=TRUE, guideHang=0.05)
meg <- moduleEigengenes(dat, color=1:ncol(dat), softPower=6)

Meta-data

hs <- available_projects()
#> 2022-08-23 16:19:13 caching file sra.recount_project.MD.gz.
#> 2022-08-23 16:19:14 caching file gtex.recount_project.MD.gz.
#> 2022-08-23 16:19:14 caching file tcga.recount_project.MD.gz.
dim(subset(hs,file_source=="gtex"))
#> [1] 32  6
annotation_options("human")
#> [1] "gencode_v26" "gencode_v29" "fantom6_cat" "refseq"      "ercc"       
#> [6] "sirv"
blood_rse <- create_rse(subset(hs,project=="BLOOD"))
#> 2022-08-23 16:19:19 downloading and reading the metadata.
#> 2022-08-23 16:19:19 caching file gtex.gtex.BLOOD.MD.gz.
#> 2022-08-23 16:19:20 caching file gtex.recount_project.BLOOD.MD.gz.
#> 2022-08-23 16:19:21 caching file gtex.recount_qc.BLOOD.MD.gz.
#> 2022-08-23 16:19:21 caching file gtex.recount_seq_qc.BLOOD.MD.gz.
#> 2022-08-23 16:19:23 downloading and reading the feature information.
#> 2022-08-23 16:19:23 caching file human.gene_sums.G026.gtf.gz.
#> 2022-08-23 16:19:24 downloading and reading the counts: 1048 samples across 63856 features.
#> 2022-08-23 16:19:25 caching file gtex.gene_sums.BLOOD.G026.gz.
#> 2022-08-23 16:19:33 construcing the RangedSummarizedExperiment (rse) object.
metadata(blood_rse)
#> $time_created
#> [1] "2022-08-23 16:19:33 BST"
#> 
#> $recount3_version
#>           package ondiskversion loadedversion
#> recount3 recount3         1.6.0         1.6.0
#>                                         path
#> recount3 /rds/user/jhz22/hpc-work/R/recount3
#>                                   loadedpath attached is_base       date
#> recount3 /rds/user/jhz22/hpc-work/R/recount3     TRUE   FALSE 2022-04-26
#>                source md5ok                    library
#> recount3 Bioconductor    NA /rds/user/jhz22/hpc-work/R
#> 
#> $project
#> [1] "BLOOD"
#> 
#> $project_home
#> [1] "data_sources/gtex"
#> 
#> $type
#> [1] "gene"
#> 
#> $organism
#> [1] "human"
#> 
#> $annotation
#> [1] "gencode_v26"
#> 
#> $recount3_url
#> [1] "http://duffel.rail.bio/recount3"
rowRanges(blood_rse)
#> GRanges object with 63856 ranges and 10 metadata columns:
#>                              seqnames            ranges strand |   source
#>                                 <Rle>         <IRanges>  <Rle> | <factor>
#>          ENSG00000278704.1 GL000009.2       56140-58376      - |  ENSEMBL
#>          ENSG00000277400.1 GL000194.1      53590-115018      - |  ENSEMBL
#>          ENSG00000274847.1 GL000194.1      53594-115055      - |  ENSEMBL
#>          ENSG00000277428.1 GL000195.1       37434-37534      - |  ENSEMBL
#>          ENSG00000276256.1 GL000195.1       42939-49164      - |  ENSEMBL
#>                        ...        ...               ...    ... .      ...
#>   ENSG00000124334.17_PAR_Y       chrY 57184101-57197337      + |   HAVANA
#>   ENSG00000185203.12_PAR_Y       chrY 57201143-57203357      - |   HAVANA
#>    ENSG00000270726.6_PAR_Y       chrY 57190738-57208756      + |   HAVANA
#>   ENSG00000182484.15_PAR_Y       chrY 57207346-57212230      + |   HAVANA
#>    ENSG00000227159.8_PAR_Y       chrY 57212184-57214397      - |   HAVANA
#>                                type bp_length     phase                gene_id
#>                            <factor> <numeric> <integer>            <character>
#>          ENSG00000278704.1     gene      2237      <NA>      ENSG00000278704.1
#>          ENSG00000277400.1     gene      2179      <NA>      ENSG00000277400.1
#>          ENSG00000274847.1     gene      1599      <NA>      ENSG00000274847.1
#>          ENSG00000277428.1     gene       101      <NA>      ENSG00000277428.1
#>          ENSG00000276256.1     gene      2195      <NA>      ENSG00000276256.1
#>                        ...      ...       ...       ...                    ...
#>   ENSG00000124334.17_PAR_Y     gene      2504      <NA> ENSG00000124334.17_P..
#>   ENSG00000185203.12_PAR_Y     gene      1054      <NA> ENSG00000185203.12_P..
#>    ENSG00000270726.6_PAR_Y     gene       773      <NA> ENSG00000270726.6_PA..
#>   ENSG00000182484.15_PAR_Y     gene      4618      <NA> ENSG00000182484.15_P..
#>    ENSG00000227159.8_PAR_Y     gene      1306      <NA> ENSG00000227159.8_PA..
#>                                         gene_type   gene_name       level
#>                                       <character> <character> <character>
#>          ENSG00000278704.1         protein_coding  BX004987.1           3
#>          ENSG00000277400.1         protein_coding  AC145212.2           3
#>          ENSG00000274847.1         protein_coding  AC145212.1           3
#>          ENSG00000277428.1               misc_RNA       Y_RNA           3
#>          ENSG00000276256.1         protein_coding  AC011043.1           3
#>                        ...                    ...         ...         ...
#>   ENSG00000124334.17_PAR_Y         protein_coding        IL9R           2
#>   ENSG00000185203.12_PAR_Y              antisense      WASIR1           2
#>    ENSG00000270726.6_PAR_Y   processed_transcript AJ271736.10           2
#>   ENSG00000182484.15_PAR_Y transcribed_unproces..      WASH6P           2
#>    ENSG00000227159.8_PAR_Y unprocessed_pseudogene    DDX11L16           2
#>                                     havana_gene         tag
#>                                     <character> <character>
#>          ENSG00000278704.1                 <NA>        <NA>
#>          ENSG00000277400.1                 <NA>        <NA>
#>          ENSG00000274847.1                 <NA>        <NA>
#>          ENSG00000277428.1                 <NA>        <NA>
#>          ENSG00000276256.1                 <NA>        <NA>
#>                        ...                  ...         ...
#>   ENSG00000124334.17_PAR_Y OTTHUMG00000022720.1         PAR
#>   ENSG00000185203.12_PAR_Y OTTHUMG00000022676.3         PAR
#>    ENSG00000270726.6_PAR_Y OTTHUMG00000184987.2         PAR
#>   ENSG00000182484.15_PAR_Y OTTHUMG00000022677.5         PAR
#>    ENSG00000227159.8_PAR_Y OTTHUMG00000022678.1         PAR
#>   -------
#>   seqinfo: 374 sequences from an unspecified genome; no seqlengths
colnames(colData(blood_rse))[1:20]
#>  [1] "rail_id"        "external_id"    "study"          "gtex.run_acc"  
#>  [5] "gtex.subjid"    "gtex.sex"       "gtex.age"       "gtex.dthhrdy"  
#>  [9] "gtex.sampid"    "gtex.smatsscr"  "gtex.smcenter"  "gtex.smpthnts" 
#> [13] "gtex.smrin"     "gtex.smts"      "gtex.smtsd"     "gtex.smubrid"  
#> [17] "gtex.smtsisch"  "gtex.smtspax"   "gtex.smnabtch"  "gtex.smnabtcht"
expand_sra_attributes(blood_rse)
#> Warning: sra.sample_attributes was absent from the input rse. Will return the
#> original rse object.
#> class: RangedSummarizedExperiment 
#> dim: 63856 1048 
#> metadata(8): time_created recount3_version ... annotation recount3_url
#> assays(1): raw_counts
#> rownames(63856): ENSG00000278704.1 ENSG00000277400.1 ...
#>   ENSG00000182484.15_PAR_Y ENSG00000227159.8_PAR_Y
#> rowData names(10): source type ... havana_gene tag
#> colnames(1048): GTEX-R55C-0005-SM-3GAE9.1 GTEX-QMR6-0005-SM-32PKY.1 ...
#>   GTEX-1NSGN-0005-SM-DKPPX.1 GTEX-1QP29-0005-SM-DLZQX.1
#> colData names(198): rail_id external_id ... recount_seq_qc.errq
#>   BigWigURL

Pathway and enrichment analysis

reactome <- pathways("hsapiens", "reactome")
kegg <- pathways("hsapiens","kegg")
pharmgkb <- pathways("hsapiens","pharmgkb")
nodes(kegg[[21]])
#>  [1] "ENTREZID:102724560" "ENTREZID:10993"     "ENTREZID:113675"   
#>  [4] "ENTREZID:132158"    "ENTREZID:1610"      "ENTREZID:1738"     
#>  [7] "ENTREZID:1757"      "ENTREZID:189"       "ENTREZID:211"      
#> [10] "ENTREZID:212"       "ENTREZID:23464"     "ENTREZID:2593"     
#> [13] "ENTREZID:26227"     "ENTREZID:2628"      "ENTREZID:27232"    
#> [16] "ENTREZID:2731"      "ENTREZID:275"       "ENTREZID:29958"    
#> [19] "ENTREZID:29968"     "ENTREZID:441531"    "ENTREZID:501"      
#> [22] "ENTREZID:51268"     "ENTREZID:5223"      "ENTREZID:5224"     
#> [25] "ENTREZID:55349"     "ENTREZID:5723"      "ENTREZID:635"      
#> [28] "ENTREZID:63826"     "ENTREZID:6470"      "ENTREZID:6472"     
#> [31] "ENTREZID:64902"     "ENTREZID:669"       "ENTREZID:875"      
#> [34] "ENTREZID:9380"      "ENTREZID:1491"
kegg_t2g <- ldply(lapply(kegg, nodes), data.frame)
names(kegg_t2g) <- c("gs_name", "gene_symbol")
VEGF <- subset(kegg_t2g,gs_name=="VEGF signaling pathway")[[2]]
eKEGG <- enricher(gene=VEGF, TERM2GENE = kegg_t2g,
                  universe=,
                  pAdjustMethod = "BH",
                  pvalueCutoff = 0.1, qvalueCutoff = 0.05,
                  minGSSize = 10, maxGSSize = 500)

Transcript databases

An overview of annotation is available.2

options(width=200)

# columns(org.Hs.eg.db)
# keyref <- keys(org.Hs.eg.db, keytype="ENTREZID")
# symbol_uniprot <- select(org.Hs.eg.db,keys=keyref,columns = c("SYMBOL","UNIPROT"))
# subset(symbol_uniprot,SYMBOL=="MC4R")

x <- EnsDb.Hsapiens.v86
listColumns(x, "protein", skip.keys=TRUE)
#> [1] "tx_id"            "protein_id"       "protein_sequence"
listGenebiotypes(x)
#>  [1] "protein_coding"                     "unitary_pseudogene"                 "unprocessed_pseudogene"             "processed_pseudogene"               "processed_transcript"              
#>  [6] "transcribed_unprocessed_pseudogene" "antisense"                          "transcribed_unitary_pseudogene"     "polymorphic_pseudogene"             "lincRNA"                           
#> [11] "sense_intronic"                     "transcribed_processed_pseudogene"   "sense_overlapping"                  "IG_V_pseudogene"                    "pseudogene"                        
#> [16] "TR_V_gene"                          "3prime_overlapping_ncRNA"           "IG_V_gene"                          "bidirectional_promoter_lncRNA"      "snRNA"                             
#> [21] "miRNA"                              "misc_RNA"                           "snoRNA"                             "rRNA"                               "Mt_tRNA"                           
#> [26] "Mt_rRNA"                            "IG_C_gene"                          "IG_J_gene"                          "TR_J_gene"                          "TR_C_gene"                         
#> [31] "TR_V_pseudogene"                    "TR_J_pseudogene"                    "IG_D_gene"                          "ribozyme"                           "IG_C_pseudogene"                   
#> [36] "TR_D_gene"                          "TEC"                                "IG_J_pseudogene"                    "scRNA"                              "scaRNA"                            
#> [41] "vaultRNA"                           "sRNA"                               "macro_lncRNA"                       "non_coding"                         "IG_pseudogene"                     
#> [46] "LRG_gene"
listTxbiotypes(x)
#>  [1] "protein_coding"                     "processed_transcript"               "nonsense_mediated_decay"            "retained_intron"                    "unitary_pseudogene"                
#>  [6] "TEC"                                "miRNA"                              "misc_RNA"                           "non_stop_decay"                     "unprocessed_pseudogene"            
#> [11] "processed_pseudogene"               "transcribed_unprocessed_pseudogene" "lincRNA"                            "antisense"                          "transcribed_unitary_pseudogene"    
#> [16] "polymorphic_pseudogene"             "sense_intronic"                     "transcribed_processed_pseudogene"   "sense_overlapping"                  "IG_V_pseudogene"                   
#> [21] "pseudogene"                         "TR_V_gene"                          "3prime_overlapping_ncRNA"           "IG_V_gene"                          "bidirectional_promoter_lncRNA"     
#> [26] "snRNA"                              "snoRNA"                             "rRNA"                               "Mt_tRNA"                            "Mt_rRNA"                           
#> [31] "IG_C_gene"                          "IG_J_gene"                          "TR_J_gene"                          "TR_C_gene"                          "TR_V_pseudogene"                   
#> [36] "TR_J_pseudogene"                    "IG_D_gene"                          "ribozyme"                           "IG_C_pseudogene"                    "TR_D_gene"                         
#> [41] "IG_J_pseudogene"                    "scRNA"                              "scaRNA"                             "vaultRNA"                           "sRNA"                              
#> [46] "macro_lncRNA"                       "non_coding"                         "IG_pseudogene"                      "LRG_gene"
listTables(x)
#> $gene
#> [1] "gene_id"          "gene_name"        "gene_biotype"     "gene_seq_start"   "gene_seq_end"     "seq_name"         "seq_strand"       "seq_coord_system" "symbol"          
#> 
#> $tx
#> [1] "tx_id"            "tx_biotype"       "tx_seq_start"     "tx_seq_end"       "tx_cds_seq_start" "tx_cds_seq_end"   "gene_id"          "tx_name"         
#> 
#> $tx2exon
#> [1] "tx_id"    "exon_id"  "exon_idx"
#> 
#> $exon
#> [1] "exon_id"        "exon_seq_start" "exon_seq_end"  
#> 
#> $chromosome
#> [1] "seq_name"    "seq_length"  "is_circular"
#> 
#> $protein
#> [1] "tx_id"            "protein_id"       "protein_sequence"
#> 
#> $uniprot
#> [1] "protein_id"           "uniprot_id"           "uniprot_db"           "uniprot_mapping_type"
#> 
#> $protein_domain
#> [1] "protein_id"            "protein_domain_id"     "protein_domain_source" "interpro_accession"    "prot_dom_start"        "prot_dom_end"         
#> 
#> $entrezgene
#> [1] "gene_id"  "entrezid"
#> 
#> $metadata
#> [1] "name"  "value"
metadata(x)
#>                  name                               value
#> 1             Db type                               EnsDb
#> 2     Type of Gene ID                     Ensembl Gene ID
#> 3  Supporting package                           ensembldb
#> 4       Db created by ensembldb package from Bioconductor
#> 5      script_version                               0.3.0
#> 6       Creation time            Thu May 18 16:32:27 2017
#> 7     ensembl_version                                  86
#> 8        ensembl_host                           localhost
#> 9            Organism                        homo_sapiens
#> 10        taxonomy_id                                9606
#> 11       genome_build                              GRCh38
#> 12    DBSCHEMAVERSION                                 2.0
organism(x)
#> [1] "Homo sapiens"
returnFilterColumns(x)
#> [1] TRUE
seqinfo(x)
#> Seqinfo object with 357 sequences (1 circular) from GRCh38 genome:
#>   seqnames seqlengths isCircular genome
#>   X         156040895      FALSE GRCh38
#>   20         64444167      FALSE GRCh38
#>   1         248956422      FALSE GRCh38
#>   6         170805979      FALSE GRCh38
#>   3         198295559      FALSE GRCh38
#>   ...             ...        ...    ...
#>   LRG_239      114904      FALSE GRCh38
#>   LRG_311      115492      FALSE GRCh38
#>   LRG_721       33396      FALSE GRCh38
#>   LRG_741      231167      FALSE GRCh38
#>   LRG_93        22459      FALSE GRCh38
seqlevels(x)
#>   [1] "1"                                      "10"                                     "11"                                     "12"                                    
#>   [5] "13"                                     "14"                                     "15"                                     "16"                                    
#>   [9] "17"                                     "18"                                     "19"                                     "2"                                     
#>  [13] "20"                                     "21"                                     "22"                                     "3"                                     
#>  [17] "4"                                      "5"                                      "6"                                      "7"                                     
#>  [21] "8"                                      "9"                                      "CHR_HG107_PATCH"                        "CHR_HG126_PATCH"                       
#>  [25] "CHR_HG1311_PATCH"                       "CHR_HG1342_HG2282_PATCH"                "CHR_HG1362_PATCH"                       "CHR_HG142_HG150_NOVEL_TEST"            
#>  [29] "CHR_HG151_NOVEL_TEST"                   "CHR_HG1651_PATCH"                       "CHR_HG1832_PATCH"                       "CHR_HG2021_PATCH"                      
#>  [33] "CHR_HG2022_PATCH"                       "CHR_HG2023_PATCH"                       "CHR_HG2030_PATCH"                       "CHR_HG2058_PATCH"                      
#>  [37] "CHR_HG2062_PATCH"                       "CHR_HG2063_PATCH"                       "CHR_HG2066_PATCH"                       "CHR_HG2072_PATCH"                      
#>  [41] "CHR_HG2095_PATCH"                       "CHR_HG2104_PATCH"                       "CHR_HG2116_PATCH"                       "CHR_HG2128_PATCH"                      
#>  [45] "CHR_HG2191_PATCH"                       "CHR_HG2213_PATCH"                       "CHR_HG2217_PATCH"                       "CHR_HG2232_PATCH"                      
#>  [49] "CHR_HG2233_PATCH"                       "CHR_HG2235_PATCH"                       "CHR_HG2239_PATCH"                       "CHR_HG2247_PATCH"                      
#>  [53] "CHR_HG2249_PATCH"                       "CHR_HG2288_HG2289_PATCH"                "CHR_HG2290_PATCH"                       "CHR_HG2291_PATCH"                      
#>  [57] "CHR_HG2334_PATCH"                       "CHR_HG26_PATCH"                         "CHR_HG986_PATCH"                        "CHR_HSCHR10_1_CTG1"                    
#>  [61] "CHR_HSCHR10_1_CTG2"                     "CHR_HSCHR10_1_CTG3"                     "CHR_HSCHR10_1_CTG4"                     "CHR_HSCHR10_1_CTG6"                    
#>  [65] "CHR_HSCHR11_1_CTG1_2"                   "CHR_HSCHR11_1_CTG5"                     "CHR_HSCHR11_1_CTG6"                     "CHR_HSCHR11_1_CTG7"                    
#>  [69] "CHR_HSCHR11_1_CTG8"                     "CHR_HSCHR11_2_CTG1"                     "CHR_HSCHR11_2_CTG1_1"                   "CHR_HSCHR11_3_CTG1"                    
#>  [73] "CHR_HSCHR12_1_CTG1"                     "CHR_HSCHR12_1_CTG2_1"                   "CHR_HSCHR12_2_CTG1"                     "CHR_HSCHR12_2_CTG2"                    
#>  [77] "CHR_HSCHR12_2_CTG2_1"                   "CHR_HSCHR12_3_CTG2"                     "CHR_HSCHR12_3_CTG2_1"                   "CHR_HSCHR12_4_CTG2"                    
#>  [81] "CHR_HSCHR12_4_CTG2_1"                   "CHR_HSCHR12_5_CTG2"                     "CHR_HSCHR12_5_CTG2_1"                   "CHR_HSCHR12_6_CTG2_1"                  
#>  [85] "CHR_HSCHR13_1_CTG1"                     "CHR_HSCHR13_1_CTG3"                     "CHR_HSCHR13_1_CTG5"                     "CHR_HSCHR13_1_CTG8"                    
#>  [89] "CHR_HSCHR14_1_CTG1"                     "CHR_HSCHR14_2_CTG1"                     "CHR_HSCHR14_3_CTG1"                     "CHR_HSCHR14_7_CTG1"                    
#>  [93] "CHR_HSCHR15_1_CTG1"                     "CHR_HSCHR15_1_CTG3"                     "CHR_HSCHR15_1_CTG8"                     "CHR_HSCHR15_2_CTG3"                    
#>  [97] "CHR_HSCHR15_2_CTG8"                     "CHR_HSCHR15_3_CTG3"                     "CHR_HSCHR15_3_CTG8"                     "CHR_HSCHR15_4_CTG8"                    
#> [101] "CHR_HSCHR15_5_CTG8"                     "CHR_HSCHR15_6_CTG8"                     "CHR_HSCHR16_1_CTG1"                     "CHR_HSCHR16_1_CTG3_1"                  
#> [105] "CHR_HSCHR16_2_CTG3_1"                   "CHR_HSCHR16_3_CTG1"                     "CHR_HSCHR16_4_CTG1"                     "CHR_HSCHR16_4_CTG3_1"                  
#> [109] "CHR_HSCHR16_5_CTG1"                     "CHR_HSCHR16_CTG2"                       "CHR_HSCHR17_10_CTG4"                    "CHR_HSCHR17_1_CTG1"                    
#> [113] "CHR_HSCHR17_1_CTG2"                     "CHR_HSCHR17_1_CTG4"                     "CHR_HSCHR17_1_CTG5"                     "CHR_HSCHR17_1_CTG9"                    
#> [117] "CHR_HSCHR17_2_CTG1"                     "CHR_HSCHR17_2_CTG2"                     "CHR_HSCHR17_2_CTG4"                     "CHR_HSCHR17_2_CTG5"                    
#> [121] "CHR_HSCHR17_3_CTG2"                     "CHR_HSCHR17_3_CTG4"                     "CHR_HSCHR17_4_CTG4"                     "CHR_HSCHR17_5_CTG4"                    
#> [125] "CHR_HSCHR17_6_CTG4"                     "CHR_HSCHR17_7_CTG4"                     "CHR_HSCHR17_8_CTG4"                     "CHR_HSCHR17_9_CTG4"                    
#> [129] "CHR_HSCHR18_1_CTG1_1"                   "CHR_HSCHR18_1_CTG2_1"                   "CHR_HSCHR18_2_CTG1_1"                   "CHR_HSCHR18_2_CTG2"                    
#> [133] "CHR_HSCHR18_2_CTG2_1"                   "CHR_HSCHR18_3_CTG2_1"                   "CHR_HSCHR18_5_CTG1_1"                   "CHR_HSCHR18_ALT21_CTG2_1"              
#> [137] "CHR_HSCHR18_ALT2_CTG2_1"                "CHR_HSCHR19KIR_ABC08_A1_HAP_CTG3_1"     "CHR_HSCHR19KIR_ABC08_AB_HAP_C_P_CTG3_1" "CHR_HSCHR19KIR_ABC08_AB_HAP_T_P_CTG3_1"
#> [141] "CHR_HSCHR19KIR_FH05_A_HAP_CTG3_1"       "CHR_HSCHR19KIR_FH05_B_HAP_CTG3_1"       "CHR_HSCHR19KIR_FH06_A_HAP_CTG3_1"       "CHR_HSCHR19KIR_FH06_BA1_HAP_CTG3_1"    
#> [145] "CHR_HSCHR19KIR_FH08_A_HAP_CTG3_1"       "CHR_HSCHR19KIR_FH08_BAX_HAP_CTG3_1"     "CHR_HSCHR19KIR_FH13_A_HAP_CTG3_1"       "CHR_HSCHR19KIR_FH13_BA2_HAP_CTG3_1"    
#> [149] "CHR_HSCHR19KIR_FH15_A_HAP_CTG3_1"       "CHR_HSCHR19KIR_FH15_B_HAP_CTG3_1"       "CHR_HSCHR19KIR_G085_A_HAP_CTG3_1"       "CHR_HSCHR19KIR_G085_BA1_HAP_CTG3_1"    
#> [153] "CHR_HSCHR19KIR_G248_A_HAP_CTG3_1"       "CHR_HSCHR19KIR_G248_BA2_HAP_CTG3_1"     "CHR_HSCHR19KIR_GRC212_AB_HAP_CTG3_1"    "CHR_HSCHR19KIR_GRC212_BA1_HAP_CTG3_1"  
#> [157] "CHR_HSCHR19KIR_LUCE_A_HAP_CTG3_1"       "CHR_HSCHR19KIR_LUCE_BDEL_HAP_CTG3_1"    "CHR_HSCHR19KIR_RP5_B_HAP_CTG3_1"        "CHR_HSCHR19KIR_RSH_A_HAP_CTG3_1"       
#> [161] "CHR_HSCHR19KIR_RSH_BA2_HAP_CTG3_1"      "CHR_HSCHR19KIR_T7526_A_HAP_CTG3_1"      "CHR_HSCHR19KIR_T7526_BDEL_HAP_CTG3_1"   "CHR_HSCHR19LRC_COX1_CTG3_1"            
#> [165] "CHR_HSCHR19LRC_COX2_CTG3_1"             "CHR_HSCHR19LRC_LRC_I_CTG3_1"            "CHR_HSCHR19LRC_LRC_J_CTG3_1"            "CHR_HSCHR19LRC_LRC_S_CTG3_1"           
#> [169] "CHR_HSCHR19LRC_LRC_T_CTG3_1"            "CHR_HSCHR19LRC_PGF1_CTG3_1"             "CHR_HSCHR19LRC_PGF2_CTG3_1"             "CHR_HSCHR19_1_CTG2"                    
#> [173] "CHR_HSCHR19_1_CTG3_1"                   "CHR_HSCHR19_2_CTG2"                     "CHR_HSCHR19_2_CTG3_1"                   "CHR_HSCHR19_3_CTG2"                    
#> [177] "CHR_HSCHR19_3_CTG3_1"                   "CHR_HSCHR19_4_CTG2"                     "CHR_HSCHR19_4_CTG3_1"                   "CHR_HSCHR19_5_CTG2"                    
#> [181] "CHR_HSCHR1_1_CTG11"                     "CHR_HSCHR1_1_CTG3"                      "CHR_HSCHR1_1_CTG31"                     "CHR_HSCHR1_1_CTG32_1"                  
#> [185] "CHR_HSCHR1_2_CTG3"                      "CHR_HSCHR1_2_CTG31"                     "CHR_HSCHR1_2_CTG32_1"                   "CHR_HSCHR1_3_CTG3"                     
#> [189] "CHR_HSCHR1_3_CTG31"                     "CHR_HSCHR1_3_CTG32_1"                   "CHR_HSCHR1_4_CTG3"                      "CHR_HSCHR1_4_CTG31"                    
#> [193] "CHR_HSCHR1_5_CTG3"                      "CHR_HSCHR1_5_CTG32_1"                   "CHR_HSCHR1_ALT2_1_CTG32_1"              "CHR_HSCHR20_1_CTG1"                    
#> [197] "CHR_HSCHR20_1_CTG2"                     "CHR_HSCHR20_1_CTG3"                     "CHR_HSCHR20_1_CTG4"                     "CHR_HSCHR21_2_CTG1_1"                  
#> [201] "CHR_HSCHR21_3_CTG1_1"                   "CHR_HSCHR21_4_CTG1_1"                   "CHR_HSCHR21_5_CTG2"                     "CHR_HSCHR21_6_CTG1_1"                  
#> [205] "CHR_HSCHR21_8_CTG1_1"                   "CHR_HSCHR22_1_CTG1"                     "CHR_HSCHR22_1_CTG2"                     "CHR_HSCHR22_1_CTG3"                    
#> [209] "CHR_HSCHR22_1_CTG4"                     "CHR_HSCHR22_1_CTG5"                     "CHR_HSCHR22_1_CTG6"                     "CHR_HSCHR22_1_CTG7"                    
#> [213] "CHR_HSCHR22_2_CTG1"                     "CHR_HSCHR22_3_CTG1"                     "CHR_HSCHR22_4_CTG1"                     "CHR_HSCHR22_5_CTG1"                    
#> [217] "CHR_HSCHR22_6_CTG1"                     "CHR_HSCHR22_7_CTG1"                     "CHR_HSCHR22_8_CTG1"                     "CHR_HSCHR2_1_CTG1"                     
#> [221] "CHR_HSCHR2_1_CTG15"                     "CHR_HSCHR2_1_CTG5"                      "CHR_HSCHR2_1_CTG7"                      "CHR_HSCHR2_1_CTG7_2"                   
#> [225] "CHR_HSCHR2_2_CTG1"                      "CHR_HSCHR2_2_CTG15"                     "CHR_HSCHR2_2_CTG7"                      "CHR_HSCHR2_2_CTG7_2"                   
#> [229] "CHR_HSCHR2_3_CTG1"                      "CHR_HSCHR2_3_CTG15"                     "CHR_HSCHR2_3_CTG7_2"                    "CHR_HSCHR2_4_CTG1"                     
#> [233] "CHR_HSCHR2_6_CTG7_2"                    "CHR_HSCHR3_1_CTG1"                      "CHR_HSCHR3_1_CTG2_1"                    "CHR_HSCHR3_1_CTG3"                     
#> [237] "CHR_HSCHR3_2_CTG2_1"                    "CHR_HSCHR3_2_CTG3"                      "CHR_HSCHR3_3_CTG1"                      "CHR_HSCHR3_3_CTG3"                     
#> [241] "CHR_HSCHR3_4_CTG2_1"                    "CHR_HSCHR3_4_CTG3"                      "CHR_HSCHR3_5_CTG2_1"                    "CHR_HSCHR3_5_CTG3"                     
#> [245] "CHR_HSCHR3_6_CTG3"                      "CHR_HSCHR3_7_CTG3"                      "CHR_HSCHR3_8_CTG3"                      "CHR_HSCHR3_9_CTG3"                     
#> [249] "CHR_HSCHR4_11_CTG12"                    "CHR_HSCHR4_1_CTG12"                     "CHR_HSCHR4_1_CTG4"                      "CHR_HSCHR4_1_CTG6"                     
#> [253] "CHR_HSCHR4_1_CTG9"                      "CHR_HSCHR4_2_CTG12"                     "CHR_HSCHR4_2_CTG4"                      "CHR_HSCHR4_3_CTG12"                    
#> [257] "CHR_HSCHR4_4_CTG12"                     "CHR_HSCHR4_5_CTG12"                     "CHR_HSCHR4_6_CTG12"                     "CHR_HSCHR4_7_CTG12"                    
#> [261] "CHR_HSCHR4_8_CTG12"                     "CHR_HSCHR4_9_CTG12"                     "CHR_HSCHR5_1_CTG1"                      "CHR_HSCHR5_1_CTG1_1"                   
#> [265] "CHR_HSCHR5_1_CTG5"                      "CHR_HSCHR5_2_CTG1"                      "CHR_HSCHR5_2_CTG1_1"                    "CHR_HSCHR5_2_CTG5"                     
#> [269] "CHR_HSCHR5_3_CTG1"                      "CHR_HSCHR5_3_CTG5"                      "CHR_HSCHR5_4_CTG1"                      "CHR_HSCHR5_4_CTG1_1"                   
#> [273] "CHR_HSCHR5_5_CTG1"                      "CHR_HSCHR5_6_CTG1"                      "CHR_HSCHR5_7_CTG1"                      "CHR_HSCHR6_1_CTG10"                    
#> [277] "CHR_HSCHR6_1_CTG2"                      "CHR_HSCHR6_1_CTG3"                      "CHR_HSCHR6_1_CTG4"                      "CHR_HSCHR6_1_CTG5"                     
#> [281] "CHR_HSCHR6_1_CTG6"                      "CHR_HSCHR6_1_CTG7"                      "CHR_HSCHR6_1_CTG8"                      "CHR_HSCHR6_1_CTG9"                     
#> [285] "CHR_HSCHR6_8_CTG1"                      "CHR_HSCHR6_MHC_APD_CTG1"                "CHR_HSCHR6_MHC_COX_CTG1"                "CHR_HSCHR6_MHC_DBB_CTG1"               
#> [289] "CHR_HSCHR6_MHC_MANN_CTG1"               "CHR_HSCHR6_MHC_MCF_CTG1"                "CHR_HSCHR6_MHC_QBL_CTG1"                "CHR_HSCHR6_MHC_SSTO_CTG1"              
#> [293] "CHR_HSCHR7_1_CTG1"                      "CHR_HSCHR7_1_CTG4_4"                    "CHR_HSCHR7_1_CTG6"                      "CHR_HSCHR7_1_CTG7"                     
#> [297] "CHR_HSCHR7_2_CTG1"                      "CHR_HSCHR7_2_CTG4_4"                    "CHR_HSCHR7_2_CTG6"                      "CHR_HSCHR7_2_CTG7"                     
#> [301] "CHR_HSCHR7_3_CTG6"                      "CHR_HSCHR8_1_CTG1"                      "CHR_HSCHR8_1_CTG6"                      "CHR_HSCHR8_1_CTG7"                     
#> [305] "CHR_HSCHR8_2_CTG1"                      "CHR_HSCHR8_2_CTG7"                      "CHR_HSCHR8_3_CTG1"                      "CHR_HSCHR8_3_CTG7"                     
#> [309] "CHR_HSCHR8_4_CTG1"                      "CHR_HSCHR8_4_CTG7"                      "CHR_HSCHR8_5_CTG1"                      "CHR_HSCHR8_5_CTG7"                     
#> [313] "CHR_HSCHR8_6_CTG1"                      "CHR_HSCHR8_7_CTG1"                      "CHR_HSCHR8_8_CTG1"                      "CHR_HSCHR8_9_CTG1"                     
#> [317] "CHR_HSCHR9_1_CTG1"                      "CHR_HSCHR9_1_CTG2"                      "CHR_HSCHR9_1_CTG3"                      "CHR_HSCHR9_1_CTG4"                     
#> [321] "CHR_HSCHR9_1_CTG5"                      "CHR_HSCHR9_1_CTG6"                      "CHR_HSCHRX_1_CTG3"                      "CHR_HSCHRX_2_CTG12"                    
#> [325] "CHR_HSCHRX_2_CTG3"                      "GL000009.2"                             "GL000194.1"                             "GL000195.1"                            
#> [329] "GL000205.2"                             "GL000213.1"                             "GL000216.2"                             "GL000218.1"                            
#> [333] "GL000219.1"                             "GL000220.1"                             "GL000225.1"                             "KI270442.1"                            
#> [337] "KI270711.1"                             "KI270713.1"                             "KI270721.1"                             "KI270726.1"                            
#> [341] "KI270727.1"                             "KI270728.1"                             "KI270731.1"                             "KI270733.1"                            
#> [345] "KI270734.1"                             "KI270744.1"                             "KI270750.1"                             "LRG_183"                               
#> [349] "LRG_187"                                "LRG_239"                                "LRG_311"                                "LRG_721"                               
#> [353] "LRG_741"                                "LRG_93"                                 "MT"                                     "X"                                     
#> [357] "Y"
updateEnsDb(x)
#> EnsDb for Ensembl:
#> |Backend: SQLite
#> |Db type: EnsDb
#> |Type of Gene ID: Ensembl Gene ID
#> |Supporting package: ensembldb
#> |Db created by: ensembldb package from Bioconductor
#> |script_version: 0.3.0
#> |Creation time: Thu May 18 16:32:27 2017
#> |ensembl_version: 86
#> |ensembl_host: localhost
#> |Organism: homo_sapiens
#> |taxonomy_id: 9606
#> |genome_build: GRCh38
#> |DBSCHEMAVERSION: 2.0
#> | No. of genes: 63970.
#> | No. of transcripts: 216741.
#> |Protein data available.

genes(x, columns=c("gene_name"), filter=list(SeqNameFilter("X"), GeneBiotypeFilter("protein_coding")))
#> GRanges object with 841 ranges and 3 metadata columns:
#>                   seqnames              ranges strand |   gene_name         gene_id   gene_biotype
#>                      <Rle>           <IRanges>  <Rle> | <character>     <character>    <character>
#>   ENSG00000182378        X       276322-303356      + |      PLCXD1 ENSG00000182378 protein_coding
#>   ENSG00000178605        X       304529-318819      - |      GTPBP6 ENSG00000178605 protein_coding
#>   ENSG00000167393        X       333963-386955      - |     PPP2R3B ENSG00000167393 protein_coding
#>   ENSG00000185960        X       624344-659411      + |        SHOX ENSG00000185960 protein_coding
#>   ENSG00000205755        X     1187549-1212750      - |       CRLF2 ENSG00000205755 protein_coding
#>               ...      ...                 ...    ... .         ...             ...            ...
#>   ENSG00000277745        X 155459415-155460005      - |      H2AFB3 ENSG00000277745 protein_coding
#>   ENSG00000185973        X 155490115-155669944      - |       TMLHE ENSG00000185973 protein_coding
#>   ENSG00000168939        X 155767812-155782459      + |       SPRY3 ENSG00000168939 protein_coding
#>   ENSG00000124333        X 155881293-155943769      + |       VAMP7 ENSG00000124333 protein_coding
#>   ENSG00000124334        X 155997581-156010817      + |        IL9R ENSG00000124334 protein_coding
#>   -------
#>   seqinfo: 1 sequence from GRCh38 genome
transcripts(x, columns=listColumns(x, "tx"), filter = AnnotationFilterList(), order.type = "asc", return.type = "GRanges")
#> GRanges object with 216741 ranges and 6 metadata columns:
#>                   seqnames            ranges strand |           tx_id             tx_biotype tx_cds_seq_start tx_cds_seq_end         gene_id         tx_name
#>                      <Rle>         <IRanges>  <Rle> |     <character>            <character>        <integer>      <integer>     <character>     <character>
#>   ENST00000456328        1       11869-14409      + | ENST00000456328   processed_transcript             <NA>           <NA> ENSG00000223972 ENST00000456328
#>   ENST00000450305        1       12010-13670      + | ENST00000450305 transcribed_unproces..             <NA>           <NA> ENSG00000223972 ENST00000450305
#>   ENST00000488147        1       14404-29570      - | ENST00000488147 unprocessed_pseudogene             <NA>           <NA> ENSG00000227232 ENST00000488147
#>   ENST00000619216        1       17369-17436      - | ENST00000619216                  miRNA             <NA>           <NA> ENSG00000278267 ENST00000619216
#>   ENST00000473358        1       29554-31097      + | ENST00000473358                lincRNA             <NA>           <NA> ENSG00000243485 ENST00000473358
#>               ...      ...               ...    ... .             ...                    ...              ...            ...             ...             ...
#>   ENST00000420810        Y 26549425-26549743      + | ENST00000420810   processed_pseudogene             <NA>           <NA> ENSG00000224240 ENST00000420810
#>   ENST00000456738        Y 26586642-26591601      - | ENST00000456738 unprocessed_pseudogene             <NA>           <NA> ENSG00000227629 ENST00000456738
#>   ENST00000435945        Y 26594851-26634652      - | ENST00000435945 unprocessed_pseudogene             <NA>           <NA> ENSG00000237917 ENST00000435945
#>   ENST00000435741        Y 26626520-26627159      - | ENST00000435741   processed_pseudogene             <NA>           <NA> ENSG00000231514 ENST00000435741
#>   ENST00000431853        Y 56855244-56855488      + | ENST00000431853   processed_pseudogene             <NA>           <NA> ENSG00000235857 ENST00000431853
#>   -------
#>   seqinfo: 357 sequences (1 circular) from GRCh38 genome

txdbEnsemblGRCh38 <- makeTxDbFromEnsembl(organism="Homo sapiens", release=98)
#> Fetch transcripts and genes from Ensembl ... OK
#>   (fetched 250194 transcripts from 67946 genes)
#> Fetch exons and CDS from Ensembl ... OK
#> Fetch chromosome names and lengths from Ensembl ...OK
#> Gather the metadata ... OK
#> Make the TxDb object ... OK
txdb <- as.list(txdbEnsemblGRCh38)
lapply(txdb,head)
#> $transcripts
#>   tx_id         tx_name        tx_type        tx_chrom tx_strand tx_start  tx_end
#> 1     1 ENST00000636745         lncRNA CHR_HG107_PATCH         +  1049876 1055745
#> 2     2 ENST00000636387         lncRNA CHR_HG107_PATCH         +  1052607 1055745
#> 3     3 ENST00000643422 protein_coding CHR_HG107_PATCH         +  1075018 1112365
#> 4     4 ENST00000645631 protein_coding CHR_HG107_PATCH         +  1075018 1112365
#> 5     5 ENST00000636567 protein_coding CHR_HG107_PATCH         +  1159911 1203106
#> 6     6 ENST00000636545 protein_coding CHR_HG107_PATCH         -  1012823 1036718
#> 
#> $splicings
#>   tx_id exon_rank exon_id       exon_name      exon_chrom exon_strand exon_start exon_end cds_id        cds_name cds_start cds_end
#> 1     1         1       1 ENSE00003797146 CHR_HG107_PATCH           +    1049876  1049958     NA            <NA>        NA      NA
#> 2     1         2       2 ENSE00003795151 CHR_HG107_PATCH           +    1051619  1051839     NA            <NA>        NA      NA
#> 3     1         3       4 ENSE00003793692 CHR_HG107_PATCH           +    1054235  1054388     NA            <NA>        NA      NA
#> 4     1         4       5 ENSE00003797325 CHR_HG107_PATCH           +    1055110  1055745     NA            <NA>        NA      NA
#> 5     2         1       3 ENSE00003798310 CHR_HG107_PATCH           +    1052607  1055745     NA            <NA>        NA      NA
#> 6     3         1       6 ENSE00003815958 CHR_HG107_PATCH           +    1075018  1075093      1 ENSP00000494473   1075018 1075093
#> 
#> $genes
#>   tx_id         gene_id
#> 1     1 ENSG00000283640
#> 2     2 ENSG00000283640
#> 3     3 ENSG00000284971
#> 4     4 ENSG00000284971
#> 5     5 ENSG00000283158
#> 6     6 ENSG00000283350
#> 
#> $chrominfo
#>              chrom    length is_circular
#> 1  CHR_HG107_PATCH 135088590          NA
#> 2  CHR_HG109_PATCH  58617934          NA
#> 3  CHR_HG126_PATCH 198295908          NA
#> 4 CHR_HG1277_PATCH 133754853          NA
#> 5 CHR_HG1296_PATCH 190208697          NA
#> 6 CHR_HG1298_PATCH 190196285          NA

txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene

# liverExprs <- quantifyExpressionsFromBWs(txdb = txdb,BWfiles=,experimentalDesign=)

Bionconductor forum

Web: https://support.bioconductor.org/

Bioconductor/CRAN packages

Package Description
Bioconductor
AnnotationDbi AnnotationDb objects and their progeny, methods etc.
Biobase Base functions for Bioconductor
org.Hs.eg.db Conversion of Entrez ID – gene symbols
EnsDb.Hsapiens.v86 Exposes an annotation databases generated from Ensembl
ensembldb Retrieve annotation data from an Ensembl based package
TxDb.Hsapiens.UCSC.hg38.knownGene Annotation of the human genome
INSPEcT Quantification of the intronic and exonic gene features and the post-transcriptional regulation analysis
graphite GRAPH Interaction from pathway topological environment
clusterProfiler Functional profiles for genes and gene clusters
DESSeq2 Differential gene expression analysis based on the negative binomial distribution
edgeR Empirical analysis of digital gene expression
WGCNA Weighted correlation network analysis
ComplexHeatmap Make complex heatmaps
recount3 Interface to uniformly processed RNA-seq data
Pi Priority index, leveraging genetic evidence to prioritise drug targets at the gene and pathway level
quantro A test for when to use quantile normalisation
FlowSorted.DLPFC.450k Illumina HumanMethylation data on sorted frontal cortex cell populations
Rgraphiz Interfaces R with the AT&T graphviz library for plotting R graph objects from the graph package
sva Surrogate Variable Analysis
doParallel Foreach Parallel Adaptor for the ‘parallel’ Package
CRAN
GeneNet Modeling and Inferring Gene Networks
RColorBrewer ColorBrewer Palettes
ggplot2 Data Visualisations Using the grammar of graphics
heatmaply Interactive Cluster Heat Maps Using plotly and ggplot2
pheatmap results visualisation
plyr Splitting, applying and combining data

References

1.
Köster, J., Forster, J., Schmeier, S., Salazar, V. & matrs. snakemake-workflows/rna-seq-star-deseq2: Version 1.2.0. (Zenodo, 2021). doi:10.5281/zenodo.5245549.
2.
Carlson, M. R. J., Pagès, H., Arora, S., Obenchain, V. & Morgan, M. Genomic annotation resources in R/Bioconductor. in Statistical genomics: Methods and protocols (eds. Mathé, E. & Davis, S.) 67–90 (Springer New York, 2016). doi:10.1007/978-1-4939-3578-9_4.