## Graph the raw metrics of all samples mapped against the transcripts and miRNAs
mmmi_mature_metrics <- sm(graph_metrics(mmmi_mature))mmmi_mature_norm <- default_norm(mmmi_mature, transform="log2")
mmmi_mature_norm_metrics <- sm(graph_metrics(mmmi_mature_norm))mmmi_mature_writer <- write_expt(mmmi_mature, excel=paste0("excel/mature_data-v", ver, ".xlsx"))## Writing the legend.
## The sheet: legend is in legend.
## Writing the raw reads.
## Graphing the raw reads.
## Warning: Transformation introduced infinite values in continuous x-axis
## Warning: Transformation introduced infinite values in continuous y-axis
## This function will replace the expt$expressionset slot with:
## log2(cpm(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
## Filter is false, this should likely be set to something, good
## choices include cbcb, kofa, pofa (anything but FALSE). If you want this to
## stay FALSE, keep in mind that if other normalizations are performed, then the
## resulting libsizes are likely to be strange (potentially negative!)
## Leaving the data unnormalized. This is necessary for DESeq, but
## EdgeR/limma might benefit from normalization. Good choices include quantile,
## size-factor, tmm, etc.
## 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: not doing count filtering.
## Step 2: not normalizing the data.
## Step 3: converting the data with cpm.
## Step 4: transforming the data with log2.
## transform_counts: Found 5653 values equal to 0, adding 1 to the matrix.
## Step 5: not doing batch correction.
## The sheet: raw_graphs is in legend, raw_reads, raw_graphs.
## The sheet: raw_graphs is in legend, raw_reads, raw_graphs.
## Writing the normalized reads.
## This function will replace the expt$expressionset slot with:
## log2(sva(cpm(quant(cbcb(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
## Warning in normalize_expt(expt = expt, transform = transform, norm = norm, : Quantile
## normalization and sva do not always play well together.
## Step 1: performing count filter with option: cbcb
## Removing 801 low-count genes (427 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 2 values equal to 0, adding 1 to the matrix.
## Step 5: doing batch correction with sva.
## 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.
## Note to self: I keep forgetting this, but the most common batch correction performed in Dr. El-Sayed's lab is implemented here as 'limmaresid'.
## batch_counts: Before batch correction, 390 entries 0<x<1.
## batch_counts: Before batch correction, 2 entries are >= 0.
## Passing the batch method to get_model_adjust().
## It currently understands: 'sva_(un)supervised', 'ruv_empirical', 'svaseq', 'pca', 'ruv_supervised', and 'ruv_residuals'.
## Not able to discern the state of the data. Going to use a simplistic metric to guess if it is log scale.
## The be method chose 1 surrogate variable(s).
## Estimate type 'sva' is shorthand for 'sva_unsupervised'.
## Other sva options include: sva_supervised and svaseq.
## Attempting sva unsupervised surrogate estimation.
## The number of elements which are < 0 after batch correction is: 383
## The variable low_to_zero sets whether to change <0 values to 0 and is: FALSE
## Graphing the normalized reads.
## Warning in self$trans$transform(x): NaNs produced
## Warning in self$trans$transform(x): Transformation introduced infinite values in
## continuous x-axis
## Warning: Transformation introduced infinite values in continuous y-axis
## The sheet: norm_graphs is in legend, raw_reads, raw_graphs, norm_data, norm_graphs.
## The sheet: norm_graphs is in legend, raw_reads, raw_graphs, norm_data, norm_graphs.
## Writing the median reads by factor.
## The factor cell_mirna_mut has 2 rows.
## The factor cell_mirna_wt has 2 rows.
## The factor exo_mirna_mut has 2 rows.
## The factor exo_mirna_wt has 2 rows.
First, do not forget to print a legend showing the colors used and what they mean:
mmmi_mature_metrics$legend$plot## This should be the same for the mm_mi and mm_tx objects.mmmi_mature_metrics$libsizemmmi_mature_norm_metrics$corheatmmmi_mature_norm_metrics$pcaplotmmmi_mature_de <- all_pairwise(mmmi_mature, model_batch="sva")## The be method chose 1 surrogate variable(s).
## Estimate type 'sva' is shorthand for 'sva_unsupervised'.
## Other sva options include: sva_supervised and svaseq.
## Attempting sva unsupervised surrogate estimation.
## Finished running DE analyses, collecting outputs.
## Comparing analyses 1/6: cell_mirna_wt_vs_cell_mirna_mut
## Comparing analyses 2/6: exo_mirna_mut_vs_cell_mirna_mut
## Comparing analyses 3/6: exo_mirna_wt_vs_cell_mirna_mut
## Comparing analyses 4/6: exo_mirna_mut_vs_cell_mirna_wt
## Comparing analyses 5/6: exo_mirna_wt_vs_cell_mirna_wt
## Comparing analyses 6/6: exo_mirna_wt_vs_exo_mirna_mut
mature_keepers <- list(
"mutvwt_cell" = c("cell_mirna_mut", "cell_mirna_wt"),
"mutvwt_exo" = c("exo_mirna_mut", "exo_mirna_wt"),
"exovcell_wt" = c("exo_mirna_wt", "cell_mirna_wt"),
"exovcell_mut" = c("exo_mirna_mut", "cell_mirna_mut"))
mmmi_mature_tables <- combine_de_tables(mmmi_mature_de,
excel=paste0("excel/mature", ver, ".xlsx"),
keepers=mature_keepers)## Deleting the file excel/mature15.xlsx before writing the tables.
## Writing a legend of columns.
## Working on 1/4: mutvwt_cell
## Found inverse table with cell_mirna_wt_vs_cell_mirna_mut
## Working on 2/4: mutvwt_exo
## Found inverse table with exo_mirna_wt_vs_exo_mirna_mut
## Working on 3/4: exovcell_wt
## Found table with exo_mirna_wt_vs_cell_mirna_wt
## Working on 4/4: exovcell_mut
## Found table with exo_mirna_mut_vs_cell_mirna_mut
## Adding venn plots for mutvwt_cell.
## Limma expression coefficients for mutvwt_cell; R^2: 0.975; equation: y = 0.969x - 0.161
## Warning: Removed 838 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 838 rows containing missing values (geom_point).
## Warning: Removed 212 rows containing missing values (geom_point).
## Warning: Removed 73 rows containing missing values (geom_point).
## Warning: Removed 838 rows containing missing values (geom_point).
## Edger expression coefficients for mutvwt_cell; R^2: 0.971; equation: y = 0.993x + 0.195
## DESeq2 expression coefficients for mutvwt_cell; R^2: 0.985; equation: y = 1.01x - 0.04
## Warning: Removed 237 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 237 rows containing missing values (geom_point).
## Warning: Removed 125 rows containing missing values (geom_point).
## Warning: Removed 64 rows containing missing values (geom_point).
## Warning: Removed 237 rows containing missing values (geom_point).
## Adding venn plots for mutvwt_exo.
## Limma expression coefficients for mutvwt_exo; R^2: 0.252; equation: y = 0.0113x - 1.26
## Warning: Removed 887 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 887 rows containing missing values (geom_point).
## Warning: Removed 198 rows containing missing values (geom_point).
## Warning: Removed 66 rows containing missing values (geom_point).
## Warning: Removed 887 rows containing missing values (geom_point).
## Edger expression coefficients for mutvwt_exo; R^2: 0.351; equation: y = -0.009x + 17.5
## DESeq2 expression coefficients for mutvwt_exo; R^2: 0.997; equation: y = 0.986x + 0.043
## Warning: Removed 232 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 232 rows containing missing values (geom_point).
## Warning: Removed 47 rows containing missing values (geom_point).
## Warning: Removed 123 rows containing missing values (geom_point).
## Warning: Removed 232 rows containing missing values (geom_point).
## Adding venn plots for exovcell_wt.
## Limma expression coefficients for exovcell_wt; R^2: 0.903; equation: y = 1.11x - 0.685
## Warning: Removed 861 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 861 rows containing missing values (geom_point).
## Warning: Removed 23 rows containing missing values (geom_point).
## Warning: Removed 199 rows containing missing values (geom_point).
## Warning: Removed 861 rows containing missing values (geom_point).
## Edger expression coefficients for exovcell_wt; R^2: 0.998; equation: y = 1.05x - 0.898
## DESeq2 expression coefficients for exovcell_wt; R^2: 0.989; equation: y = 0.98x - 0.0233
## Warning: Removed 232 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 232 rows containing missing values (geom_point).
## Warning: Removed 87 rows containing missing values (geom_point).
## Warning: Removed 56 rows containing missing values (geom_point).
## Warning: Removed 232 rows containing missing values (geom_point).
## Adding venn plots for exovcell_mut.
## Limma expression coefficients for exovcell_mut; R^2: 0.989; equation: y = 1.24x - 1.78
## Warning: Removed 889 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 889 rows containing missing values (geom_point).
## Warning: Removed 38 rows containing missing values (geom_point).
## Warning: Removed 241 rows containing missing values (geom_point).
## Warning: Removed 889 rows containing missing values (geom_point).
## Edger expression coefficients for exovcell_mut; R^2: 0.893; equation: y = 0.939x + 0.605
## DESeq2 expression coefficients for exovcell_mut; R^2: 0.988; equation: y = 0.997x - 0.0747
## Warning: Removed 249 rows containing non-finite values (stat_smooth).
## Warning: Removed 1 rows containing missing values (geom_vline).
## Warning: Removed 1 rows containing missing values (geom_hline).
## Warning: Removed 249 rows containing missing values (geom_point).
## Warning: Removed 137 rows containing missing values (geom_point).
## Warning: Removed 30 rows containing missing values (geom_point).
## Warning: Removed 249 rows containing missing values (geom_point).
## Writing summary information.
## The sheet: pairwise_summary is in legend, mutvwt_cell, mutvwt_exo, exovcell_wt, exovcell_mut, pairwise_summary.
## Attempting to add the comparison plot to pairwise_summary at row: 22 and column: 1
## Performing save of the workbook.
saveme(filename="mature.rda.xz")## The savefile is: /cbcb/nelsayed-scratch/atb/small_rna/mmusculus_exosomev2/savefiles/mature.rda.xz
## Renaming /cbcb/nelsayed-scratch/atb/small_rna/mmusculus_exosomev2/savefiles/mature.rda.xz to /cbcb/nelsayed-scratch/atb/small_rna/mmusculus_exosomev2/savefiles/mature.rda.xz.01.
## The save string is: con <- base::pipe(paste0('pxz -T4 > /cbcb/nelsayed-scratch/atb/small_rna/mmusculus_exosomev2/savefiles/mature.rda.xz'), 'wb');
## save(list=ls(all.names=TRUE, envir=globalenv()), envir=globalenv(), file=con, compress=FALSE);
## close(con)