This document should make clear the suitability of this Pseudomonas data for differential expression analyses. It should also give some ideas about the depth and distribution of the data.
rownames(pa14_annot) <- make.names(pa14_annot[["sysName"]], unique=TRUE)
pa_expt <- create_expt(metadata="sample_sheets/rna_new_old_samples.xlsx",
gene_info=all_annot)
## Reading the sample metadata.
## The sample definitions comprises: 20, 27 rows, columns.
## Reading count tables.
## Reading count tables with read.table().
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0975/outputs/bowtie2_paeruginosa_pa14/hpgl0975.count.xz contains 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0976/outputs/bowtie2_paeruginosa_pa14/hpgl0976.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0977/outputs/bowtie2_paeruginosa_pa14/hpgl0977.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0978/outputs/bowtie2_paeruginosa_pa14/hpgl0978.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0979/outputs/bowtie2_paeruginosa_pa14/hpgl0979.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0980/outputs/bowtie2_paeruginosa_pa14/hpgl0980.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0981/outputs/bowtie2_paeruginosa_pa14/hpgl0981.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0982/outputs/bowtie2_paeruginosa_pa14/hpgl0982.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0983/outputs/bowtie2_paeruginosa_pa14/hpgl0983.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0984/outputs/bowtie2_paeruginosa_pa14/hpgl0984.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0985/outputs/bowtie2_paeruginosa_pa14/hpgl0985.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/new_large/hpgl0986/outputs/bowtie2_paeruginosa_pa14/hpgl0986.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/previous_large/vl05_pa14/outputs/bowtie2_paeruginosa_pa14/vl05_pa14.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/previous_large/vl06_pa14/outputs/bowtie2_paeruginosa_pa14/vl06_pa14.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/previous_large/vl07_pa14/outputs/bowtie2_paeruginosa_pa14/vl07_pa14.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/previous_large/vl08_pa14/outputs/bowtie2_paeruginosa_pa14/vl08_pa14.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/previous_large/vl09_orn/outputs/bowtie2_paeruginosa_pa14/vl09_orn.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/previous_large/vl10_orn/outputs/bowtie2_paeruginosa_pa14/vl10_orn.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/previous_large/vl11_orn/outputs/bowtie2_paeruginosa_pa14/vl11_orn.count.xz contains 5984 rows and merges to 5984 rows.
## /cbcb/nelsayed-scratch/atb/rnaseq/paeruginosa_201710/preprocessing/previous_large/vl12_orn/outputs/bowtie2_paeruginosa_pa14/vl12_orn.count.xz contains 5984 rows and merges to 5984 rows.
## Finished reading count tables.
## Matched 5972 annotations and counts.
## Bringing together the count matrix and gene information.
## Some annotations were lost in merging, setting them to 'undefined'.
new_expt <- subset_expt(pa_expt, subset="batch=='new'")
## There were 20, now there are 12 samples.
old_expt <- subset_expt(pa_expt, subset="batch=='previous'")
## There were 20, now there are 8 samples.
new_raw <- sm(graph_metrics(new_expt))
new_norm <- normalize_expt(new_expt, transform="log2", norm="quant", filter=TRUE)
## This function will replace the expt$expressionset slot with:
## log2(quant(hpgl(data)))
## It backs up the current data into a slot named:
## expt$backup_expressionset. It will also save copies of each step along the way
## in expt$normalized with the corresponding libsizes. Keep the libsizes in mind
## when invoking limma. The appropriate libsize is the non-log(cpm(normalized)).
## This is most likely kept at:
## 'new_expt$normalized$intermediate_counts$normalization$libsizes'
## A copy of this may also be found at:
## new_expt$best_libsize
## Leaving the data unconverted. It is often advisable to cpm/rpkm
## the data to normalize for sampling differences, keep in mind though that rpkm
## has some annoying biases, and voom() by default does a cpm (though hpgl_voom()
## will try to detect this).
## Not correcting the count-data for batch effects. If batch is
## included in EdgerR/limma's model, then this is probably wise; but in extreme
## batch effects this is a good parameter to play with.
## Step 1: performing count filter with option: hpgl
## Removing 59 low-count genes (5920 remaining).
## Step 2: normalizing the data with quant.
## Step 3: not converting the data.
## Step 4: transforming the data with log2.
## Step 5: not doing batch correction.
new_plots <- sm(graph_metrics(new_norm))
tt <- pp(file="images/legend.png", image=new_raw$legend)
## Writing the image to: images/legend.png and calling dev.off().
tt <- pp(file="images/new_libsize.png", image=new_raw$libsize)
## Writing the image to: images/new_libsize.png and calling dev.off().
tt <- pp(file="images/new_raw_corheat.png", image=new_raw$corheat)
## Writing the image to: images/new_raw_corheat.png and calling dev.off().
tt <- pp(file="images/new_boxplot.png", image=new_raw$boxplot)
## Writing the image to: images/new_boxplot.png and calling dev.off().
tt <- pp(file="images/norm_pca.png", image=new_plots$pcaplot)
## Writing the image to: images/norm_pca.png and calling dev.off().
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
pa_graph_raw <- sm(graph_metrics(pa_expt))
pa_norm <- normalize_expt(pa_expt, transform="log2", convert="cpm", norm="quant", filter=TRUE)
## This function will replace the expt$expressionset slot with:
## log2(cpm(quant(hpgl(data))))
## It backs up the current data into a slot named:
## expt$backup_expressionset. It will also save copies of each step along the way
## in expt$normalized with the corresponding libsizes. Keep the libsizes in mind
## when invoking limma. The appropriate libsize is the non-log(cpm(normalized)).
## This is most likely kept at:
## 'new_expt$normalized$intermediate_counts$normalization$libsizes'
## A copy of this may also be found at:
## new_expt$best_libsize
## Not correcting the count-data for batch effects. If batch is
## included in EdgerR/limma's model, then this is probably wise; but in extreme
## batch effects this is a good parameter to play with.
## Step 1: performing count filter with option: hpgl
## Removing 47 low-count genes (5932 remaining).
## Step 2: normalizing the data with quant.
## Step 3: converting the data with cpm.
## Step 4: transforming the data with log2.
## transform_counts: Found 5 values equal to 0, adding 1 to the matrix.
## Step 5: not doing batch correction.
pa_graph_norm <- graph_metrics(pa_norm)
## Graphing number of non-zero genes with respect to CPM by library.
## Graphing library sizes.
## Graphing a boxplot.
## Graphing a correlation heatmap.
## Graphing a standard median correlation.
## Performing correlation.
## Graphing a distance heatmap.
## Graphing a standard median distance.
## Performing distance.
## Graphing a PCA plot.
## Graphing a T-SNE plot.
## Warning in plot_tsne(expt, title = tsne_title, ...): There are no
## conditions/batches.
## Plotting a density plot.
## Plotting the representation of the top-n genes.
## Printing a color to condition legend.
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
pa_graph_norm$pcaplot
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
pa_graph_norm$tsneplot
pa_nb <- normalize_expt(pa_expt, transform="log2", convert="cpm",
norm="quant", filter=TRUE, batch="limma")
## This function will replace the expt$expressionset slot with:
## log2(limma(cpm(quant(hpgl(data)))))
## It backs up the current data into a slot named:
## expt$backup_expressionset. It will also save copies of each step along the way
## in expt$normalized with the corresponding libsizes. Keep the libsizes in mind
## when invoking limma. The appropriate libsize is the non-log(cpm(normalized)).
## This is most likely kept at:
## 'new_expt$normalized$intermediate_counts$normalization$libsizes'
## A copy of this may also be found at:
## new_expt$best_libsize
## Step 1: performing count filter with option: hpgl
## Removing 47 low-count genes (5932 remaining).
## Step 2: normalizing the data with quant.
## Step 3: converting the data with cpm.
## Step 4: transforming the data with log2.
## transform_counts: Found 5 values equal to 0, adding 1 to the matrix.
## Step 5: doing batch correction with limma.
## In norm_batch, after testing logic of surrogate method/number, the
## number of surrogates is: and the method is: be.
## Note to self: If you get an error like 'x contains missing values'; I think this
## means that the data has too many 0's and needs to have a better low-count filter applied.
## batch_counts: Before batch correction, 1265 entries 0<x<1.
## batch_counts: Before batch correction, 5 entries are >= 0.
## After checking/setting the number of surrogates, it is: 4.
## batch_counts: Using limma's removeBatchEffect to remove batch effect.
## If you receive a warning: 'NANs produced', one potential reason is that the data was quantile normalized.
## The number of elements which are < 0 after batch correction is: 6
## The variable low_to_zero sets whether to change <0 values to 0 and is: FALSE
pa_nb_graph <- graph_metrics(pa_nb)
## Graphing number of non-zero genes with respect to CPM by library.
## Graphing library sizes.
## Graphing a boxplot.
## Graphing a correlation heatmap.
## Graphing a standard median correlation.
## Performing correlation.
## Graphing a distance heatmap.
## Graphing a standard median distance.
## Performing distance.
## Graphing a PCA plot.
## Graphing a T-SNE plot.
## Warning in plot_tsne(expt, title = tsne_title, ...): There are no
## conditions/batches.
## Plotting a density plot.
## Plotting the representation of the top-n genes.
## Printing a color to condition legend.
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
pa_nb_graph$pcaplot
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
tt <- pp(file="images/all_libsize.png", image=pa_graph_raw$libsize)
## Writing the image to: images/all_libsize.png and calling dev.off().
tt <- pp(file="images/all_density.png", image=pa_graph_raw$density)
## Writing the image to: images/all_density.png and calling dev.off().
tt <- pp(file="images/norm_corheat.png", image=pa_graph_norm$corheat)
## Writing the image to: images/norm_corheat.png and calling dev.off().
tt <- pp(file="images/all_legend.png", image=pa_graph_raw$legend)
## Writing the image to: images/all_legend.png and calling dev.off().
tt <- pp(file="images/all_pca.png", image=pa_graph_norm$pcaplot)
## Writing the image to: images/all_pca.png and calling dev.off().
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
tt <- pp(file="images/all_batch_pca.png", image=pa_nb_graph$pcaplot)
## Writing the image to: images/all_batch_pca.png and calling dev.off().
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
## Too few points to calculate an ellipse
pander::pander(sessionInfo())
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
locale: LC_CTYPE=en_US.utf8, LC_NUMERIC=C, LC_TIME=en_US.utf8, LC_COLLATE=en_US.utf8, LC_MONETARY=en_US.utf8, LC_MESSAGES=en_US.utf8, LC_PAPER=en_US.utf8, LC_NAME=C, LC_ADDRESS=C, LC_TELEPHONE=C, LC_MEASUREMENT=en_US.utf8 and LC_IDENTIFICATION=C
attached base packages: stats, graphics, grDevices, utils, datasets, methods and base
other attached packages: hpgltools(v.2018.03)
loaded via a namespace (and not attached): nlme(v.3.1-137), bitops(v.1.0-6), matrixStats(v.0.53.1), devtools(v.1.13.6), bit64(v.0.9-7), RColorBrewer(v.1.1-2), progress(v.1.2.0), httr(v.1.3.1), rprojroot(v.1.3-2), GenomeInfoDb(v.1.16.0), tools(v.3.5.1), backports(v.1.1.2), R6(v.2.2.2), mgcv(v.1.8-24), DBI(v.1.0.0), lazyeval(v.0.2.1), BiocGenerics(v.0.26.0), colorspace(v.1.3-2), withr(v.2.1.2), tidyselect(v.0.2.4), prettyunits(v.1.0.2), bit(v.1.1-14), compiler(v.3.5.1), preprocessCore(v.1.42.0), Biobase(v.2.40.0), xml2(v.1.2.0), DelayedArray(v.0.6.1), rtracklayer(v.1.40.3), labeling(v.0.3), scales(v.0.5.0), genefilter(v.1.62.0), quadprog(v.1.5-5), commonmark(v.1.5), stringr(v.1.3.1), digest(v.0.6.15), Rsamtools(v.1.32.2), rmarkdown(v.1.10), XVector(v.0.20.0), base64enc(v.0.1-3), pkgconfig(v.2.0.1), htmltools(v.0.3.6), limma(v.3.36.2), rlang(v.0.2.1), RSQLite(v.2.1.1), bindr(v.0.1.1), BiocParallel(v.1.14.2), gtools(v.3.8.1), dplyr(v.0.7.6), zip(v.1.0.0), RCurl(v.1.95-4.11), magrittr(v.1.5), GenomeInfoDbData(v.1.1.0), Matrix(v.1.2-14), Rcpp(v.0.12.17), munsell(v.0.5.0), S4Vectors(v.0.18.3), stringi(v.1.2.3), yaml(v.2.1.19), edgeR(v.3.22.3), MASS(v.7.3-50), SummarizedExperiment(v.1.10.1), zlibbioc(v.1.26.0), Rtsne(v.0.13), plyr(v.1.8.4), grid(v.3.5.1), blob(v.1.1.1), parallel(v.3.5.1), ggrepel(v.0.8.0), crayon(v.1.3.4), lattice(v.0.20-35), splines(v.3.5.1), Biostrings(v.2.48.0), pander(v.0.6.2), GenomicFeatures(v.1.32.0), annotate(v.1.58.0), hms(v.0.4.2), locfit(v.1.5-9.1), knitr(v.1.20), pillar(v.1.3.0), GenomicRanges(v.1.32.4), corpcor(v.1.6.9), reshape2(v.1.4.3), codetools(v.0.2-15), biomaRt(v.2.36.1), stats4(v.3.5.1), XML(v.3.98-1.12), glue(v.1.3.0), evaluate(v.0.11), data.table(v.1.11.4), foreach(v.1.4.4), gtable(v.0.2.0), purrr(v.0.2.5), assertthat(v.0.2.0), ggplot2(v.3.0.0), openxlsx(v.4.1.0), xtable(v.1.8-2), roxygen2(v.6.0.1), survival(v.2.42-6), tibble(v.1.4.2), iterators(v.1.0.10), GenomicAlignments(v.1.16.0), AnnotationDbi(v.1.42.1), memoise(v.1.1.0), IRanges(v.2.14.10), bindrcpp(v.0.2.2), sva(v.3.28.0) and directlabels(v.2018.05.22)
message(paste0("This is hpgltools commit: ", get_git_commit()))
## If you wish to reproduce this exact build of hpgltools, invoke the following:
## > git clone http://github.com/abelew/hpgltools.git
## > git reset c730ef178f8e57bbf3819e21cf5e6cfe879e6328
## R> packrat::restore()
## This is hpgltools commit: Fri Jul 13 17:21:39 2018 -0400: c730ef178f8e57bbf3819e21cf5e6cfe879e6328
this_save <- paste0(gsub(pattern="\\.Rmd", replace="", x=rmd_file), "-v", ver, ".rda.xz")
message(paste0("Saving to ", this_save))
## Saving to 01_annotation-v20171019.rda.xz
tmp <- sm(saveme(filename=this_save))