The various differential expression analyses of the data generated in tmrc3_datasets will occur in this document.
Each of the following lists describes the set of contrasts that I think are interesting for the various ways one might consider the TMRC3 dataset. The variables are named according to the assumed data with which they will be used, thus tc_cf_contrasts is expected to be used for the Tumaco+Cali data and provide a series of cure/fail comparisons which (to the extent possible) across both locations. In every case, the name of the list element will be used as the contrast name, and will thus be seen as the sheet name in the output xlsx file(s); the two pieces of the character vector value are the numerator and denominator of the associated contrast.
The Gene set enrichment will follow each DE analysis during this document. I am adding a series of explicitly GSEA analyses in this most recent iteration, in these I will pass the full DE table and check the distribution of logFC values against the genes in each category as opposed to the simpler over-enrichment of the high/low DE values.
Most (all?) of the Gene set enrichment analyses used in this paper were done via gProfiler rather than goseq/clusterProfiler/topGO/GOstats. Primarily because it is so easy to invoke gprofiler.
clinic_contrasts <- list(
"clinics" = c("Cali", "Tumaco"))
## In some cases we have no Cali failure samples, so there remain only 2
## contrasts that are likely of interest
tc_cf_contrasts <- list(
"tumaco" = c("Tumacofailure", "Tumacocure"),
"cure" = c("Tumacocure", "Calicure"))
## In other cases, we have cure/fail for both places.
clinic_cf_contrasts <- list(
"cali" = c("Califailure", "Calicure"),
"tumaco" = c("Tumacofailure", "Tumacocure"),
"cure" = c("Tumacocure", "Calicure"),
"fail" = c("Tumacofailure", "Califailure"))
cf_contrast <- list(
"outcome" = c("Tumacofailure", "Tumacocure"))
t_cf_contrast <- list(
"outcome" = c("failure", "cure"))
visitcf_contrasts <- list(
"v1cf" = c("v1failure", "v1cure"),
"v2cf" = c("v2failure", "v2cure"),
"v3cf" = c("v3failure", "v3cure"))
visit_contrasts <- list(
"v2v1" = c("c2", "c1"),
"v3v1" = c("c3", "c1"),
"v3v2" = c("c3", "c2"))
visit_v1later <- list(
"later_vs_first" = c("later", "first"))
celltypes <- list(
"eo_mono" = c("eosinophils", "monocytes"),
"ne_mono" = c("neutrophils", "monocytes"),
"eo_ne" = c("eosinophils", "neutrophils"))
ethnicity_contrasts <- list(
"mestizo_indigenous" = c("mestiza", "indigena"),
"mestizo_afrocol" = c("mestiza", "afrocol"),
"indigenous_afrocol" = c("indigena", "afrocol"))
Start over, this time with only the samples from Tumaco. We currently are assuming these will prove to be the only analyses used for final interpretation. This is primarily because we have insufficient failed treatment samples from Cali.
Start by considering all Tumaco cell types. Note that in this case we only use SVA, primarily because I am not certain what would be an appropriate batch factor, perhaps visit?
##
## cure failure
## 67 56
## Removing 0 low-count genes (14156 remaining).
## Setting 17331 low elements to zero.
## transform_counts: Found 17331 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## falr_vs_cr
## limma_vs_deseq 0.8063
## limma_vs_edger 0.8177
## limma_vs_ebseq 0.6054
## limma_vs_basic 0.8704
## limma_vs_noiseq -0.7287
## deseq_vs_edger 0.9845
## deseq_vs_ebseq 0.6981
## deseq_vs_basic 0.8242
## deseq_vs_noiseq -0.7317
## edger_vs_ebseq 0.6715
## edger_vs_basic 0.8285
## edger_vs_noiseq -0.7370
## ebseq_vs_basic 0.6341
## ebseq_vs_noiseq -0.5838
## basic_vs_noiseq -0.7978
t_cf_clinical_table_sva <- combine_de_tables(
t_cf_clinical_de_sva, keepers = t_cf_contrast,
excel = glue("{cf_prefix}/All_Samples/t_clinical_cf_tables_sva-v{ver}.xlsx"))
t_cf_clinical_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 failure_vs_cure 93 183 103 159
## limma_sigup limma_sigdown
## 1 50 38
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_clinical_sig_sva <- extract_significant_genes(
t_cf_clinical_table_sva,
excel = glue("{cf_prefix}/All_Samples/t_clinical_cf_sig_sva-v{ver}.xlsx"))
t_cf_clinical_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 50 38 103 159 93 183 0
## ebseq_down basic_up basic_down
## outcome 49 16 4
## [1] 93 69
## [1] 183 69
The following gProfiler searches use the all_gprofiler() function instead of simple_gprofiler(). As a result, the results are separated by {contrast}_{direction}. Thus ‘outcome_down’.
The same plots are available as the previous gProfiler searches, but in many of the following runs, I used the dotplot() function to get a slightly different view of the results.
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 51 0 5 3 28 1 0 0 0
## outcome_down 80 0 0 0 1 0 0 0 0
written <- write_gprofiler_data(
t_cf_clinical_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/clinical_cure_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_cf_clinical_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/clinical_cure_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Wikipathways of the up c/f genes
enrichplot::dotplot(t_cf_clinical_gp[["outcome_up"]][["WP_enrich"]])
## Transcription factor database of the up c/f genes
enrichplot::dotplot(t_cf_clinical_gp[["outcome_up"]][["TF_enrich"]])
## Reactome of the up c/f genes
enrichplot::dotplot(t_cf_clinical_gp[["outcome_up"]][["REAC_enrich"]])
## Reactome of the down c/f genes
enrichplot::dotplot(t_cf_clinical_gp[["outcome_down"]][["GO_enrich"]])
Later in this document I do a bunch of visit/cf comparisons. In this block I want to explicitly only compare v1 to other visits. This is something I did quite a lot in the 2019 datasets, but never actually moved to this document.
##
## first later
## 40 69
## Removing 0 low-count genes (11910 remaining).
## Setting 9640 low elements to zero.
## transform_counts: Found 9640 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## ltr_vs_frs
## limma_vs_deseq 0.8393
## limma_vs_edger 0.8457
## limma_vs_ebseq 0.7791
## limma_vs_basic 0.8133
## limma_vs_noiseq -0.7094
## deseq_vs_edger 0.9983
## deseq_vs_ebseq 0.7809
## deseq_vs_basic 0.7946
## deseq_vs_noiseq -0.7474
## edger_vs_ebseq 0.7868
## edger_vs_basic 0.7984
## edger_vs_noiseq -0.7524
## ebseq_vs_basic 0.7513
## ebseq_vs_noiseq -0.7736
## basic_vs_noiseq -0.8068
tv1_vs_later_table <- combine_de_tables(
tv1_vs_later, keepers = visit_v1later,
excel = glue("{xlsx_prefix}/DE_Visits/tv1_vs_later_tables-v{ver}.xlsx"))
tv1_vs_later_table
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 later_vs_first 24 7 22 7
## limma_sigup limma_sigdown
## 1 23 7
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
tv1_vs_later_sig <- extract_significant_genes(
tv1_vs_later_table,
excel = glue("{xlsx_prefix}/DE_Visits/tv1_vs_later_sig-v{ver}.xlsx"))
tv1_vs_later_sig
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down
## later_vs_first 23 7 22 7 24 7
## ebseq_up ebseq_down basic_up basic_down
## later_vs_first 0 0 0 0
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## later_vs_first_up 10 0 3 2 1 0 0 0 0
## later_vs_first_down 20 2 4 0 1 0 0 0 10
## The samples excluded are: TMRC30156, TMRC30185, TMRC30186, TMRC30178, TMRC30179, TMRC30221, TMRC30222, TMRC30223, TMRC30224, TMRC30269, TMRC30148, TMRC30149, TMRC30253, TMRC30150, TMRC30140, TMRC30138, TMRC30176, TMRC30153, TMRC30151, TMRC30234, TMRC30235, TMRC30270, TMRC30225, TMRC30226, TMRC30227, TMRC30228, TMRC30229, TMRC30230, TMRC30231, TMRC30232, TMRC30233, TMRC30209, TMRC30210, TMRC30211, TMRC30212, TMRC30213, TMRC30216, TMRC30214, TMRC30215, TMRC30271, TMRC30273, TMRC30275, TMRC30272, TMRC30274, TMRC30276, TMRC30254, TMRC30255, TMRC30256, TMRC30277, TMRC30239, TMRC30240, TMRC30278, TMRC30279, TMRC30280, TMRC30257, TMRC30258, TMRC30281, TMRC30283, TMRC30284, TMRC30282, TMRC30285.
## subset_expt(): There were 184, now there are 123 samples.
##
##
## female male
## 22 101
## Removing 0 low-count genes (14156 remaining).
## Setting 17311 low elements to zero.
## transform_counts: Found 17311 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## mal_vs_fml
## limma_vs_deseq 0.8596
## limma_vs_edger 0.8663
## limma_vs_ebseq 0.7762
## limma_vs_basic 0.9481
## limma_vs_noiseq -0.7351
## deseq_vs_edger 0.9909
## deseq_vs_ebseq 0.7608
## deseq_vs_basic 0.8703
## deseq_vs_noiseq -0.7263
## edger_vs_ebseq 0.7802
## edger_vs_basic 0.8748
## edger_vs_noiseq -0.7283
## ebseq_vs_basic 0.7161
## ebseq_vs_noiseq -0.7147
## basic_vs_noiseq -0.7498
t_sex_table <- combine_de_tables(
t_sex_de, excel = glue("{xlsx_prefix}/Gene set enrichment/t_sex_table-v{ver}.xlsx"))
t_sex_table
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 male_vs_female 129 96 116 95
## limma_sigup limma_sigdown
## 1 54 74
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_sex_sig <- extract_significant_genes(
t_sex_table, excel = glue("{xlsx_prefix}/Gene set enrichment/t_sex_sig-v{ver}.xlsx"))
t_sex_sig
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down
## male_vs_female 54 74 116 95 129 96
## ebseq_up ebseq_down basic_up basic_down
## male_vs_female 12 13 15 10
Let us see if we observe general male/female differences in the data. This has an important caveat: there are few female failures in the dataset and so the results may reflect that.
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## male_vs_female_up 61 0 4 1 46 0 0 0 2
## male_vs_female_down 23 0 0 0 0 0 0 0 0
written <- write_gprofiler_data(
t_sex_gp[[1]],
excel = glue("{xlsx_prefix}/Gene set enrichment/sex_female_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_sex_gp[[2]],
excel = glue("{xlsx_prefix}/Gene set enrichment/sex_male_up-v{ver}.xlsx"))
## The samples excluded are: TMRC30178, TMRC30179, TMRC30221, TMRC30222, TMRC30223, TMRC30224, TMRC30017, TMRC30019, TMRC30071, TMRC30056, TMRC30105, TMRC30058, TMRC30094, TMRC30119, TMRC30122, TMRC30107, TMRC30096, TMRC30083, TMRC30115, TMRC30118, TMRC30121, TMRC30026, TMRC30048, TMRC30054, TMRC30046, TMRC30070, TMRC30049, TMRC30055, TMRC30047, TMRC30053, TMRC30068, TMRC30123, TMRC30072, TMRC30078, TMRC30116, TMRC30076, TMRC30088, TMRC30197, TMRC30199, TMRC30198, TMRC30201, TMRC30200, TMRC30203, TMRC30202, TMRC30205, TMRC30204, TMRC30177, TMRC30241, TMRC30237, TMRC30206, TMRC30207, TMRC30238, TMRC30074, TMRC30217, TMRC30208, TMRC30077, TMRC30219, TMRC30218, TMRC30079, TMRC30220, TMRC30264, TMRC30265.
## subset_expt(): There were 184, now there are 122 samples.
## The samples excluded are: TMRC30156, TMRC30185, TMRC30186, TMRC30269, TMRC30148, TMRC30149, TMRC30253, TMRC30150, TMRC30140, TMRC30138, TMRC30176, TMRC30153, TMRC30151, TMRC30234, TMRC30235, TMRC30270, TMRC30225, TMRC30226, TMRC30227, TMRC30228, TMRC30229, TMRC30230, TMRC30231, TMRC30232, TMRC30233, TMRC30209, TMRC30210, TMRC30211, TMRC30212, TMRC30213, TMRC30216, TMRC30214, TMRC30215, TMRC30271, TMRC30273, TMRC30275, TMRC30272, TMRC30274, TMRC30276, TMRC30254, TMRC30255, TMRC30256, TMRC30277, TMRC30239, TMRC30240, TMRC30278, TMRC30279, TMRC30280, TMRC30257, TMRC30258, TMRC30281, TMRC30283, TMRC30284, TMRC30282, TMRC30285.
## subset_expt(): There were 122, now there are 67 samples.
##
## female male
## 13 54
## Removing 0 low-count genes (13971 remaining).
## Setting 8998 low elements to zero.
## transform_counts: Found 8998 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## mal_vs_fml
## limma_vs_deseq 0.7804
## limma_vs_edger 0.8380
## limma_vs_ebseq 0.7446
## limma_vs_basic 0.9284
## limma_vs_noiseq -0.7515
## deseq_vs_edger 0.9294
## deseq_vs_ebseq 0.7224
## deseq_vs_basic 0.7994
## deseq_vs_noiseq -0.6523
## edger_vs_ebseq 0.7687
## edger_vs_basic 0.8474
## edger_vs_noiseq -0.6952
## ebseq_vs_basic 0.6679
## ebseq_vs_noiseq -0.6566
## basic_vs_noiseq -0.7882
t_sex_cure_table <- combine_de_tables(
t_sex_cure_de, excel = glue("{xlsx_prefix}/DE_Sex/t_sex_cure_table-v{ver}.xlsx"))
t_sex_cure_table
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 male_vs_female 174 129 162 143
## limma_sigup limma_sigdown
## 1 64 108
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_sex_cure_sig <- extract_significant_genes(
t_sex_cure_table, excel = glue("{xlsx_prefix}/DE_Sex/t_sex_cure_sig-v{ver}.xlsx"))
t_sex_cure_sig
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down
## male_vs_female 64 108 162 143 174 129
## ebseq_up ebseq_down basic_up basic_down
## male_vs_female 11 15 13 5
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## male_vs_female_up 63 2 7 0 36 0 0 0 10
## male_vs_female_down 0 0 0 0 0 0 0 0 0
##
## afrocol indigena mestiza
## 76 19 28
## Removing 0 low-count genes (14156 remaining).
## Setting 15869 low elements to zero.
## transform_counts: Found 15869 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
t_ethnicity_table <- combine_de_tables(
keepers = ethnicity_contrasts,
t_ethnicity_de, excel = glue("{xlsx_prefix}/DE_Ethnicity/t_ethnicity_table-v{ver}.xlsx"))
t_ethnicity_table
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 mestiza_vs_indigena 83 97 67 108
## 2 mestiza_vs_afrocol 57 92 52 96
## 3 indigena_vs_afrocol 165 236 187 216
## limma_sigup limma_sigdown
## 1 58 56
## 2 42 53
## 3 165 147
## Plot describing unique/shared genes in a differential expression table.
t_ethnicity_sig <- extract_significant_genes(
t_ethnicity_table, excel = glue("{xlsx_prefix}/DE_Ethnicity/t_ethnicity_sig-v{ver}.xlsx"))
t_ethnicity_sig
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down
## mestizo_indigenous 58 56 67 108 83 97
## mestizo_afrocol 42 53 52 96 57 92
## indigenous_afrocol 165 147 187 216 165 236
## ebseq_up ebseq_down basic_up basic_down
## mestizo_indigenous 8 1 2 2
## mestizo_afrocol 10 1 2 9
## indigenous_afrocol 16 15 16 17
Performed once with both clinics and again with only Tumaco.
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## mestizo_indigenous_up 21 0 2 0 7 0 0 0 0
## mestizo_indigenous_down 10 0 1 0 7 5 0 0 0
## mestizo_afrocol_up 5 0 0 0 0 0 0 0 0
## mestizo_afrocol_down 23 0 4 3 1 0 0 0 0
## indigenous_afrocol_up 63 1 2 0 1 0 1 0 0
## indigenous_afrocol_down 25 0 0 0 1 0 0 0 0
written <- write_gprofiler_data(
t_ethnicity_gp[[1]],
excel = glue("{xlsx_prefix}/Gene set enrichment/ethnicity_mi_up-v{ver}.xlsx"))
written <- write_gprofiler_data(
t_ethnicity_gp[[2]],
excel = glue("{xlsx_prefix}/Gene set enrichment/ethnicity_mi_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_ethnicity_gp[[3]],
excel = glue("{xlsx_prefix}/Gene set enrichment/ethnicity_ma_up-v{ver}.xlsx"))
written <- write_gprofiler_data(
t_ethnicity_gp[[4]],
excel = glue("{xlsx_prefix}/Gene set enrichment/ethnicity_ma_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_ethnicity_gp[[5]],
excel = glue("{xlsx_prefix}/Gene set enrichment/ethnicity_ia_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_ethnicity_gp[[6]],
excel = glue("{xlsx_prefix}/Gene set enrichment/ethnicity_ia_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_ethnicity_gp[["indigenous_afrocol_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/ethnicity_afrocol_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
One of the most compelling ideas in the data is the opportunity to find genes in the first visit which may help predict the likelihood that a person will respond well to treatment. The following block will therefore look at cure/fail from Tumaco at visit 1.
##
## cure failure
## 30 24
## Removing 0 low-count genes (14023 remaining).
## Setting 7655 low elements to zero.
## transform_counts: Found 7655 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## falr_vs_cr
## limma_vs_deseq 0.7398
## limma_vs_edger 0.7830
## limma_vs_ebseq 0.5530
## limma_vs_basic 0.6887
## limma_vs_noiseq -0.5606
## deseq_vs_edger 0.9537
## deseq_vs_ebseq 0.7128
## deseq_vs_basic 0.6956
## deseq_vs_noiseq -0.6069
## edger_vs_ebseq 0.6799
## edger_vs_basic 0.7228
## edger_vs_noiseq -0.6304
## ebseq_vs_basic 0.6519
## ebseq_vs_noiseq -0.6776
## basic_vs_noiseq -0.7772
t_cf_clinical_v1_table_sva <- combine_de_tables(
t_cf_clinical_v1_de_sva, keepers = t_cf_contrast,
excel = glue("{cf_prefix}/Visits/t_clinical_v1_cf_tables_sva-v{ver}.xlsx"))
t_cf_clinical_v1_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 failure_vs_cure 27 75 28 55
## limma_sigup limma_sigdown
## 1 3 3
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_clinical_v1_sig_sva <- extract_significant_genes(
t_cf_clinical_v1_table_sva,
excel = glue("{cf_prefix}/Visits/t_clinical_v1_cf_sig_sva-v{ver}.xlsx"))
t_cf_clinical_v1_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 3 3 28 55 27 75 0
## ebseq_down basic_up basic_down
## outcome 37 0 0
## [1] 27 69
## [1] 75 69
It looks like there are very few groups in the visit 1 significant genes.
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 1 0 0 0 0 0 0 0 0
## outcome_down 30 0 0 1 2 2 0 0 0
## Wikipathways of the up c/f genes
enrichplot::dotplot(t_cf_clinical_v1_sig_sva_gp[["outcome_up"]][["GO_enrich"]])
The visit 2 and visit 3 samples are interesting because they provide an opportunity to see if we can observe changes in response in the middle and end of treatment…
##
## cure failure
## 20 15
## Removing 0 low-count genes (11562 remaining).
## Setting 2857 low elements to zero.
## transform_counts: Found 2857 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## falr_vs_cr
## limma_vs_deseq 0.8138
## limma_vs_edger 0.8162
## limma_vs_ebseq 0.6903
## limma_vs_basic 0.7404
## limma_vs_noiseq -0.6361
## deseq_vs_edger 0.9986
## deseq_vs_ebseq 0.7894
## deseq_vs_basic 0.7689
## deseq_vs_noiseq -0.7586
## edger_vs_ebseq 0.7929
## edger_vs_basic 0.7702
## edger_vs_noiseq -0.7602
## ebseq_vs_basic 0.7215
## ebseq_vs_noiseq -0.8047
## basic_vs_noiseq -0.8078
t_cf_clinical_v2_table_sva <- combine_de_tables(
t_cf_clinical_v2_de_sva, keepers = t_cf_contrast,
excel = glue("{cf_prefix}/Visits/t_clinical_v2_cf_tables_sva-v{ver}.xlsx"))
t_cf_clinical_v2_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 failure_vs_cure 51 15 50 11
## limma_sigup limma_sigdown
## 1 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_clinical_v2_sig_sva <- extract_significant_genes(
t_cf_clinical_v2_table_sva,
excel = glue("{cf_prefix}/Visits/t_clinical_v2_cf_sig_sva-v{ver}.xlsx"))
t_cf_clinical_v2_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 50 11 51 15 0
## ebseq_down basic_up basic_down
## outcome 0 0 0
## [1] 51 69
## [1] 15 69
Up: 74 GO, 4 KEGG, 6 reactome, 4 WP, 56 TF, 1 miRNA, 0 HP/HPA/CORUM. Down: 19 GO, 1 KEGG, 1 HP, 2 HPA, 0 reactome/wp/tf/corum
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 78 4 6 4 54 1 0 0 0
## outcome_down 19 2 0 0 0 0 2 0 5
written <- write_gprofiler_data(
t_cf_clinical_v2_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_clinical_v2_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_cf_clinical_v2_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_clinical_v2_down-v{ver}.xlsx"))
## Wikipathways of the up c/f genes
enrichplot::dotplot(t_cf_clinical_v2_sig_sva_gp[["outcome_up"]][["GO_enrich"]])
##
## cure failure
## 17 17
## Removing 0 low-count genes (11452 remaining).
## Setting 1887 low elements to zero.
## transform_counts: Found 1887 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## falr_vs_cr
## limma_vs_deseq 0.8530
## limma_vs_edger 0.8605
## limma_vs_ebseq 0.7614
## limma_vs_basic 0.8193
## limma_vs_noiseq -0.7001
## deseq_vs_edger 0.9978
## deseq_vs_ebseq 0.8006
## deseq_vs_basic 0.7970
## deseq_vs_noiseq -0.7532
## edger_vs_ebseq 0.8041
## edger_vs_basic 0.8030
## edger_vs_noiseq -0.7622
## ebseq_vs_basic 0.7585
## ebseq_vs_noiseq -0.7808
## basic_vs_noiseq -0.8306
t_cf_clinical_v3_table_sva <- combine_de_tables(
t_cf_clinical_v3_de_sva, keepers = t_cf_contrast,
excel = glue("{cf_prefix}/Visits/t_clinical_v3_cf_tables_sva-v{ver}.xlsx"))
t_cf_clinical_v3_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 failure_vs_cure 120 61 120 50
## limma_sigup limma_sigdown
## 1 3 1
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_clinical_v3_sig_sva <- extract_significant_genes(
t_cf_clinical_v3_table_sva,
excel = glue("{cf_prefix}/Visits/t_clinical_v3_cf_sig_sva-v{ver}.xlsx"))
t_cf_clinical_v3_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 3 1 120 50 120 61 0
## ebseq_down basic_up basic_down
## outcome 0 0 0
## [1] 120 69
## [1] 61 69
Up: 120 genes; 141 GO, 1 KEGG, 5 Reactome, 2 WP, 30 TF, 1 miRNA, 0 HPA/CORUM/HP Down: 62 genes; 30 GO, 2 KEGG, 1 Reactome, 0 WP/TF/miRNA/HPA/CORUM/HP,
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 152 1 5 3 32 1 0 0 0
## outcome_down 31 2 1 0 0 0 0 0 0
written <- write_gprofiler_data(
t_cf_clinical_v3_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_clinical_v3_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_cf_clinical_v3_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_clinical_v3_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Wikipathways of the up c/f genes
enrichplot::dotplot(t_cf_clinical_v3_sig_sva_gp[["outcome_up"]][["GO_enrich"]])
The biopsy samples are problematic for a few reasons, so let us repeat without them.
t_cf_clinical_nobiop_de_sva <- all_pairwise(t_clinical_nobiop,
model_batch = "svaseq", filter = TRUE)
##
## cure failure
## 58 51
## Removing 0 low-count genes (11910 remaining).
## Setting 9605 low elements to zero.
## transform_counts: Found 9605 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## falr_vs_cr
## limma_vs_deseq 0.8463
## limma_vs_edger 0.8506
## limma_vs_ebseq 0.7814
## limma_vs_basic 0.8571
## limma_vs_noiseq -0.7532
## deseq_vs_edger 0.9964
## deseq_vs_ebseq 0.8187
## deseq_vs_basic 0.8267
## deseq_vs_noiseq -0.7746
## edger_vs_ebseq 0.8142
## edger_vs_basic 0.8367
## edger_vs_noiseq -0.7818
## ebseq_vs_basic 0.7405
## ebseq_vs_noiseq -0.7404
## basic_vs_noiseq -0.8524
t_cf_clinical_nobiop_table_sva <- combine_de_tables(
t_cf_clinical_nobiop_de_sva, keepers = t_cf_contrast,
excel = glue("{cf_prefix}/No_Biopsies/t_clinical_nobiop_cf_tables_sva-v{ver}.xlsx"))
t_cf_clinical_nobiop_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 failure_vs_cure 140 75 142 67
## limma_sigup limma_sigdown
## 1 54 46
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_clinical_nobiop_sig_sva <- extract_significant_genes(
t_cf_clinical_nobiop_table_sva,
excel = glue("{cf_prefix}/No_Biopsies/t_clinical_nobiop_cf_sig_sva-v{ver}.xlsx"))
t_cf_clinical_nobiop_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 54 46 142 67 140 75 1
## ebseq_down basic_up basic_down
## outcome 7 29 7
## [1] 140 69
## [1] 75 69
Up: 137 genes; 88 GO, 0 KEGG, 6 Reactome, 1 WP, 46 TF, 1 miRNA, 0 others Down: 73 genes; 78 GO, 1 KEGG, 1 Reactome, 9 TF, 0 others
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 93 0 6 2 41 1 0 0 0
## outcome_down 65 2 1 1 2 0 0 0 1
written <- write_gprofiler_data(
t_cf_clinical_nobiop_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_clinical_nobiop_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_cf_clinical_nobiop_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_clinical_nobiop_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
Now let us switch our view to each individual cell type collected. The hope here is that we will be able to learn some cell-specific differences in the response for people who did(not) respond well.
##
## Tumaco_cure Tumaco_failure
## 9 5
## Removing 0 low-count genes (13513 remaining).
## Setting 146 low elements to zero.
## transform_counts: Found 146 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.7926
## limma_vs_edger 0.8628
## limma_vs_ebseq 0.7354
## limma_vs_basic 0.8497
## limma_vs_noiseq -0.7628
## deseq_vs_edger 0.9516
## deseq_vs_ebseq 0.8629
## deseq_vs_basic 0.8164
## deseq_vs_noiseq -0.7927
## edger_vs_ebseq 0.8844
## edger_vs_basic 0.8809
## edger_vs_noiseq -0.8535
## ebseq_vs_basic 0.8011
## ebseq_vs_noiseq -0.7965
## basic_vs_noiseq -0.8819
t_cf_biopsy_table_sva <- combine_de_tables(
t_cf_biopsy_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Biopsies/t_biopsy_cf_tables_sva-v{ver}.xlsx"))
t_cf_biopsy_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 17 11 19
## edger_sigdown limma_sigup limma_sigdown
## 1 15 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_biopsy_sig_sva <- extract_significant_genes(
t_cf_biopsy_table_sva,
excel = glue("{cf_prefix}/Biopsies/t_cf_biopsy_sig_sva-v{ver}.xlsx"))
t_cf_biopsy_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 19 15 17 11 11
## ebseq_down basic_up basic_down
## outcome 57 0 0
## [1] 17 69
## [1] 11 69
Up: 17 genes; 74 GO, 3 KEGG, 1 Reactome, 3 WP, 1 TF, 0 others Down: 11 genes; 2 GO, 0 others
FIXME: Add write_gprofiler_data() to other stanzas.
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 89 4 1 5 2 0 0 0 0
## outcome_down 2 0 0 0 0 0 0 0 0
t_cf_biopsy_gp_up_written <- write_gprofiler_data(
t_cf_biopsy_sig_sva_gp[[1]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_biopsy_sig_sva_up.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
t_cf_biopsy_gp_down_written <- write_gprofiler_data(
t_cf_biopsy_sig_sva_gp[[2]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_biopsy_sig_sva_down.xlsx"))
enrichplot::dotplot(t_cf_biopsy_sig_sva_gp[["outcome_up"]][["GO_enrich"]])
Same question, but this time looking at monocytes. In addition, this comparison was done twice, once using SVA and once using visit as a batch factor.
##
## Tumaco_cure Tumaco_failure
## 21 21
## Removing 0 low-count genes (10862 remaining).
## Setting 736 low elements to zero.
## transform_counts: Found 736 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8614
## limma_vs_edger 0.8663
## limma_vs_ebseq 0.7794
## limma_vs_basic 0.9210
## limma_vs_noiseq -0.8064
## deseq_vs_edger 0.9989
## deseq_vs_ebseq 0.8556
## deseq_vs_basic 0.8506
## deseq_vs_noiseq -0.7947
## edger_vs_ebseq 0.8564
## edger_vs_basic 0.8560
## edger_vs_noiseq -0.8011
## ebseq_vs_basic 0.8470
## ebseq_vs_noiseq -0.7829
## basic_vs_noiseq -0.8949
t_cf_monocyte_tables_sva <- combine_de_tables(
t_cf_monocyte_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_cf_tables_sva-v{ver}.xlsx"))
t_cf_monocyte_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 60 52 56
## edger_sigdown limma_sigup limma_sigdown
## 1 51 11 34
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_monocyte_sig_sva <- extract_significant_genes(
t_cf_monocyte_tables_sva,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_cf_sig_sva-v{ver}.xlsx"))
t_cf_monocyte_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 11 34 56 51 60 52 0
## ebseq_down basic_up basic_down
## outcome 23 8 21
## [1] 60 69
## [1] 52 69
##
## Tumaco_cure Tumaco_failure
## 21 21
##
## 3 2 1
## 13 13 16
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: batch in model/limma.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8120
## limma_vs_edger 0.8150
## limma_vs_ebseq 0.7952
## limma_vs_basic 0.9509
## limma_vs_noiseq -0.8326
## deseq_vs_edger 0.9998
## deseq_vs_ebseq 0.9932
## deseq_vs_basic 0.8505
## deseq_vs_noiseq -0.7807
## edger_vs_ebseq 0.9935
## edger_vs_basic 0.8540
## edger_vs_noiseq -0.7852
## ebseq_vs_basic 0.8470
## ebseq_vs_noiseq -0.7829
## basic_vs_noiseq -0.8949
t_cf_monocyte_tables_batchvisit <- combine_de_tables(
t_cf_monocyte_de_batchvisit, keepers = cf_contrast,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_cf_tables_batchvisit-v{ver}.xlsx"))
t_cf_monocyte_tables_batchvisit
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 43 93 47
## edger_sigdown limma_sigup limma_sigdown
## 1 105 6 13
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_monocyte_sig_batchvisit <- extract_significant_genes(
t_cf_monocyte_tables_batchvisit,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_cf_sig_batchvisit-v{ver}.xlsx"))
t_cf_monocyte_sig_batchvisit
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 6 13 47 105 43 93 0
## ebseq_down basic_up basic_down
## outcome 23 8 21
## [1] 43 69
## [1] 93 69
Now that I am looking back over these results, I am not compeltely certain why I only did the gprofiler search for the sva data…
Up: 60 genes; 12 GO, 1 KEGG, 1 WP, 4 TF, 0 others Down: 53 genes; 26 GO, 1 KEGG, 1 Reactome, 2 TF, 0 others
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 23 1 0 1 5 0 0 0 0
## outcome_down 33 1 1 0 1 0 0 0 0
written <- write_gprofiler_data(
t_cf_monocyte_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_monocyte_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_cf_monocyte_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_monocyte_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 42 6 20 5 0 3 0 0 22
## outcome_down 60 2 1 0 0 1 0 0 0
written <- write_gprofiler_data(
t_cf_monocyte_sig_batch_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_monocyte_batch_up-v{ver}.xlsx"))
written <- write_gprofiler_data(
t_cf_monocyte_sig_batch_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_monocyte_batch_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
Now focus in on the monocyte samples on a per-visit basis.
##
## Tumaco_cure Tumaco_failure
## 8 8
## Removing 0 low-count genes (10482 remaining).
## Setting 190 low elements to zero.
## transform_counts: Found 190 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8902
## limma_vs_edger 0.8905
## limma_vs_ebseq 0.8280
## limma_vs_basic 0.9441
## limma_vs_noiseq -0.8548
## deseq_vs_edger 0.9999
## deseq_vs_ebseq 0.8945
## deseq_vs_basic 0.8866
## deseq_vs_noiseq -0.8760
## edger_vs_ebseq 0.8950
## edger_vs_basic 0.8870
## edger_vs_noiseq -0.8766
## ebseq_vs_basic 0.9060
## ebseq_vs_noiseq -0.8785
## basic_vs_noiseq -0.9062
t_cf_monocyte_v1_tables_sva <- combine_de_tables(
t_cf_monocyte_v1_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_v1_cf_tables_sva-v{ver}.xlsx"))
t_cf_monocyte_v1_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 14 52 15
## edger_sigdown limma_sigup limma_sigdown
## 1 57 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_monocyte_v1_sig_sva <- extract_significant_genes(
t_cf_monocyte_v1_tables_sva,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_v1_cf_sig_sva-v{ver}.xlsx"))
t_cf_monocyte_v1_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 15 57 14 52 0
## ebseq_down basic_up basic_down
## outcome 15 0 0
## [1] 14 69
## [1] 52 69
V1: Up: 14 genes; No categories V1: Down: 52 genes; 20 GO, 5 TF
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 1 0 0 0 0 0 0 0 0
## outcome_down 19 0 0 0 2 0 0 0 0
written <- write_gprofiler_data(
t_cf_monocyte_v1_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_monocyte_v1_up-v{ver}.xlsx"))
written <- write_gprofiler_data(
t_cf_monocyte_v1_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_monocyte_v1_down-v{ver}.xlsx"))
enrichplot::dotplot(t_cf_monocyte_v1_sig_sva_gp[["outcome_down"]][["GO_enrich"]])
##
## Tumaco_cure Tumaco_failure
## 7 6
## Removing 0 low-count genes (10523 remaining).
## Setting 117 low elements to zero.
## transform_counts: Found 117 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8480
## limma_vs_edger 0.8416
## limma_vs_ebseq 0.7855
## limma_vs_basic 0.8817
## limma_vs_noiseq -0.8037
## deseq_vs_edger 0.9980
## deseq_vs_ebseq 0.9491
## deseq_vs_basic 0.8728
## deseq_vs_noiseq -0.8881
## edger_vs_ebseq 0.9485
## edger_vs_basic 0.8658
## edger_vs_noiseq -0.8791
## ebseq_vs_basic 0.8717
## ebseq_vs_noiseq -0.8882
## basic_vs_noiseq -0.9042
t_cf_monocyte_v2_tables_sva <- combine_de_tables(
t_cf_monocyte_v2_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_v2_cf_tables_sva-v{ver}.xlsx"))
t_cf_monocyte_v2_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 0 1 0
## edger_sigdown limma_sigup limma_sigdown
## 1 0 0 0
## Only outcome_down has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
t_cf_monocyte_v2_sig_sva <- extract_significant_genes(
t_cf_monocyte_v2_tables_sva,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_v2_cf_sig_sva-v{ver}.xlsx"))
t_cf_monocyte_v2_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 0 0 0 1 1
## ebseq_down basic_up basic_down
## outcome 5 0 0
## [1] 0 69
## [1] 1 69
Insufficient data to use in gProfiler.
V2: Up: 1 gene V2: Down: 0 genes.
##
## Tumaco_cure Tumaco_failure
## 6 7
## Removing 0 low-count genes (10377 remaining).
## Setting 58 low elements to zero.
## transform_counts: Found 58 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8342
## limma_vs_edger 0.8344
## limma_vs_ebseq 0.7169
## limma_vs_basic 0.8937
## limma_vs_noiseq -0.7371
## deseq_vs_edger 0.9997
## deseq_vs_ebseq 0.8722
## deseq_vs_basic 0.7750
## deseq_vs_noiseq -0.7603
## edger_vs_ebseq 0.8712
## edger_vs_basic 0.7746
## edger_vs_noiseq -0.7588
## ebseq_vs_basic 0.8351
## ebseq_vs_noiseq -0.8624
## basic_vs_noiseq -0.8441
t_cf_monocyte_v3_tables_sva <- combine_de_tables(
t_cf_monocyte_v3_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_v3_cf_tables_sva-v{ver}.xlsx"))
t_cf_monocyte_v3_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 0 4 0
## edger_sigdown limma_sigup limma_sigdown
## 1 8 0 0
## Only outcome_down has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
t_cf_monocyte_v3_sig_sva <- extract_significant_genes(
t_cf_monocyte_v3_tables_sva,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_v3_cf_sig_sva-v{ver}.xlsx"))
t_cf_monocyte_v3_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 0 8 0 4 0
## ebseq_down basic_up basic_down
## outcome 1 0 0
## [1] 0 69
## [1] 4 69
V3: Up: 4 genes. V3: Down: 0 genes.
sva_aucc <- calculate_aucc(t_cf_monocyte_tables_sva[["data"]][[1]],
tbl2 = t_cf_monocyte_tables_batchvisit[["data"]][[1]],
py = "deseq_adjp", ly = "deseq_logfc")
sva_aucc
## These two tables have an aucc value of: 0.694269508631419 and correlation:
##
## Pearson's product-moment correlation
##
## data: tbl[[lx]] and tbl[[ly]]
## t = 182, df = 10860, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.8634 0.8726
## sample estimates:
## cor
## 0.8681
shared_ids <- rownames(t_cf_monocyte_tables_sva[["data"]][[1]]) %in%
rownames(t_cf_monocyte_tables_batchvisit[["data"]][[1]])
first <- t_cf_monocyte_tables_sva[["data"]][[1]][shared_ids, ]
second <- t_cf_monocyte_tables_batchvisit[["data"]][[1]][rownames(first), ]
cor.test(first[["deseq_logfc"]], second[["deseq_logfc"]])
##
## Pearson's product-moment correlation
##
## data: first[["deseq_logfc"]] and second[["deseq_logfc"]]
## t = 182, df = 10860, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.8634 0.8726
## sample estimates:
## cor
## 0.8681
Switch context to the Neutrophils, once again repeat the analysis using SVA and visit as a batch factor.
##
## Tumaco_cure Tumaco_failure
## 20 21
## Removing 0 low-count genes (9101 remaining).
## Setting 754 low elements to zero.
## transform_counts: Found 754 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8742
## limma_vs_edger 0.8784
## limma_vs_ebseq 0.8430
## limma_vs_basic 0.9321
## limma_vs_noiseq -0.8237
## deseq_vs_edger 0.9994
## deseq_vs_ebseq 0.9062
## deseq_vs_basic 0.8755
## deseq_vs_noiseq -0.8196
## edger_vs_ebseq 0.9068
## edger_vs_basic 0.8813
## edger_vs_noiseq -0.8269
## ebseq_vs_basic 0.8587
## ebseq_vs_noiseq -0.8164
## basic_vs_noiseq -0.8903
t_cf_neutrophil_tables_sva <- combine_de_tables(
t_cf_neutrophil_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_cf_tables_sva-v{ver}.xlsx"))
t_cf_neutrophil_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 129 30 120
## edger_sigdown limma_sigup limma_sigdown
## 1 27 12 12
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_neutrophil_sig_sva <- extract_significant_genes(
t_cf_neutrophil_tables_sva,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_cf_sig_sva-v{ver}.xlsx"))
t_cf_neutrophil_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 12 12 120 27 129 30 7
## ebseq_down basic_up basic_down
## outcome 7 4 2
## [1] 129 69
## [1] 30 69
##
## Tumaco_cure Tumaco_failure
## 20 21
##
## 3 2 1
## 12 13 16
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: batch in model/limma.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8380
## limma_vs_edger 0.8401
## limma_vs_ebseq 0.8284
## limma_vs_basic 0.9658
## limma_vs_noiseq -0.8544
## deseq_vs_edger 0.9999
## deseq_vs_ebseq 0.9813
## deseq_vs_basic 0.8644
## deseq_vs_noiseq -0.8164
## edger_vs_ebseq 0.9818
## edger_vs_basic 0.8671
## edger_vs_noiseq -0.8202
## ebseq_vs_basic 0.8587
## ebseq_vs_noiseq -0.8164
## basic_vs_noiseq -0.8903
t_cf_neutrophil_tables_batchvisit <- combine_de_tables(
t_cf_neutrophil_de_batchvisit, keepers = cf_contrast,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_cf_tables_batchvisit-v{ver}.xlsx"))
t_cf_neutrophil_tables_batchvisit
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 92 47 101
## edger_sigdown limma_sigup limma_sigdown
## 1 44 3 1
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_neutrophil_sig_batchvisit <- extract_significant_genes(
t_cf_neutrophil_tables_batchvisit,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_cf_sig_batchvisit-v{ver}.xlsx"))
t_cf_neutrophil_sig_batchvisit
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 3 1 101 44 92 47 7
## ebseq_down basic_up basic_down
## outcome 7 4 2
## [1] 92 69
## [1] 47 69
Up: 84 genes; 5 GO, 2 Reactome, 3 TF, no others. Down: 29 genes: 12 GO, 1 Reactome, 1 TF, 1 miRNA, 11 HP, 0 others
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 72 0 5 2 53 1 0 0 0
## outcome_down 3 0 0 0 0 1 0 0 1
written <- write_gprofiler_data(
t_cf_neutrophil_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_neutrophil_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_cf_neutrophil_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_neutrophil_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
When I did this with the monocytes, I split it up into multiple blocks for each visit. This time I am just going to run them all together.
visitcf_factor <- paste0("v", pData(t_neutrophils)[["visitnumber"]],
pData(t_neutrophils)[["finaloutcome"]])
t_neutrophil_visitcf <- set_expt_conditions(t_neutrophils, fact=visitcf_factor)
## The numbers of samples by condition are:
##
## v1cure v1failure v2cure v2failure v3cure v3failure
## 8 8 7 6 5 7
t_cf_neutrophil_visits_de_sva <- all_pairwise(t_neutrophil_visitcf, model_batch = "svaseq",
filter = TRUE)
##
## v1cure v1failure v2cure v2failure v3cure v3failure
## 8 8 7 6 5 7
## Removing 0 low-count genes (9101 remaining).
## Setting 685 low elements to zero.
## transform_counts: Found 685 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 10 comparisons.
t_cf_neutrophil_visits_tables_sva <- combine_de_tables(
t_cf_neutrophil_visits_de_sva, keepers = visitcf_contrasts,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_visitcf_tables_sva-v{ver}.xlsx"))
t_cf_neutrophil_visits_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 v1failure_vs_v1cure 12 6 6 6
## 2 v2failure_vs_v2cure 2 6 2 3
## 3 v3failure_vs_v3cure 2 2 0 2
## limma_sigup limma_sigdown
## 1 1 0
## 2 0 0
## 3 0 0
## Plot describing unique/shared genes in a differential expression table.
t_cf_neutrophil_visits_sig_sva <- extract_significant_genes(
t_cf_neutrophil_visits_tables_sva,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_visitcf_sig_sva-v{ver}.xlsx"))
t_cf_neutrophil_visits_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down basic_up
## v1cf 1 0 6 6 12 6 0
## v2cf 0 0 2 3 2 6 0
## v3cf 0 0 0 2 2 2 0
## basic_down
## v1cf 0
## v2cf 0
## v3cf 0
## [1] 12 59
## [1] 6 59
##
## Tumaco_cure Tumaco_failure
## 8 8
## Removing 0 low-count genes (8717 remaining).
## Setting 145 low elements to zero.
## transform_counts: Found 145 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8182
## limma_vs_edger 0.8319
## limma_vs_ebseq 0.7986
## limma_vs_basic 0.8910
## limma_vs_noiseq -0.8084
## deseq_vs_edger 0.9946
## deseq_vs_ebseq 0.9420
## deseq_vs_basic 0.8627
## deseq_vs_noiseq -0.8290
## edger_vs_ebseq 0.9422
## edger_vs_basic 0.8792
## edger_vs_noiseq -0.8474
## ebseq_vs_basic 0.8706
## ebseq_vs_noiseq -0.8574
## basic_vs_noiseq -0.9014
t_cf_neutrophil_v1_tables_sva <- combine_de_tables(
t_cf_neutrophil_v1_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_v1_cf_tables_sva-v{ver}.xlsx"))
t_cf_neutrophil_v1_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 5 8 5
## edger_sigdown limma_sigup limma_sigdown
## 1 11 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_neutrophil_v1_sig_sva <- extract_significant_genes(
t_cf_neutrophil_v1_tables_sva,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_v1_cf_sig_sva-v{ver}.xlsx"))
t_cf_neutrophil_v1_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 5 11 5 8 0
## ebseq_down basic_up basic_down
## outcome 2 0 0
## [1] 5 69
## [1] 8 69
##
## Tumaco_cure Tumaco_failure
## 7 6
## Removing 0 low-count genes (8452 remaining).
## Setting 78 low elements to zero.
## transform_counts: Found 78 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8893
## limma_vs_edger 0.8880
## limma_vs_ebseq 0.8654
## limma_vs_basic 0.9485
## limma_vs_noiseq -0.8394
## deseq_vs_edger 0.9986
## deseq_vs_ebseq 0.9777
## deseq_vs_basic 0.9021
## deseq_vs_noiseq -0.9024
## edger_vs_ebseq 0.9754
## edger_vs_basic 0.9026
## edger_vs_noiseq -0.9009
## ebseq_vs_basic 0.8977
## ebseq_vs_noiseq -0.9151
## basic_vs_noiseq -0.8742
t_cf_neutrophil_v2_tables_sva <- combine_de_tables(
t_cf_neutrophil_v2_de_sva,
keepers = cf_contrast,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_v2_cf_tables_sva-v{ver}.xlsx"))
t_cf_neutrophil_v2_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 9 3 20
## edger_sigdown limma_sigup limma_sigdown
## 1 6 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_neutrophil_v2_sig_sva <- extract_significant_genes(
t_cf_neutrophil_v2_tables_sva,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_v2_cf_sig_sva-v{ver}.xlsx"))
t_cf_neutrophil_v2_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 20 6 9 3 1
## ebseq_down basic_up basic_down
## outcome 1 0 0
## [1] 9 69
## [1] 3 69
##
## Tumaco_cure Tumaco_failure
## 5 7
## Removing 0 low-count genes (8505 remaining).
## Setting 83 low elements to zero.
## transform_counts: Found 83 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8848
## limma_vs_edger 0.8859
## limma_vs_ebseq 0.7501
## limma_vs_basic 0.7953
## limma_vs_noiseq -0.7096
## deseq_vs_edger 0.9993
## deseq_vs_ebseq 0.7551
## deseq_vs_basic 0.7530
## deseq_vs_noiseq -0.7575
## edger_vs_ebseq 0.7595
## edger_vs_basic 0.7515
## edger_vs_noiseq -0.7564
## ebseq_vs_basic 0.8738
## ebseq_vs_noiseq -0.8915
## basic_vs_noiseq -0.8892
t_cf_neutrophil_v3_tables_sva <- combine_de_tables(
t_cf_neutrophil_v3_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_v3_cf_tables_sva-v{ver}.xlsx"))
t_cf_neutrophil_v3_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 5 1 5
## edger_sigdown limma_sigup limma_sigdown
## 1 1 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_neutrophil_v3_sig_sva <- extract_significant_genes(
t_cf_neutrophil_v3_tables_sva,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_v3_cf_sig_sva-v{ver}.xlsx"))
t_cf_neutrophil_v3_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 5 1 5 1 2
## ebseq_down basic_up basic_down
## outcome 3 0 0
## [1] 5 69
## [1] 4 69
V1: Up: 5 genes V1: Down: 8 genes; 14 GO.
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 0 0 0 0 0 0 0 0 0
## outcome_down 17 0 0 0 0 3 0 1 0
written <- write_gprofiler_data(
t_cf_neutrophil_v1_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_neutrophil_v1_up-v{ver}.xlsx"))
## Warning: Workbook does not contain any worksheets. A worksheet will be added.
written <- write_gprofiler_data(
t_cf_neutrophil_v1_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_neutrophil_v1_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
Up: 5 genes; 3 GO, 10 TF. Down: 1 gene.
sva_aucc <- calculate_aucc(t_cf_neutrophil_tables_sva[["data"]][[1]],
tbl2 = t_cf_neutrophil_tables_batchvisit[["data"]][[1]],
py = "deseq_adjp", ly = "deseq_logfc")
sva_aucc
## These two tables have an aucc value of: 0.673368382537023 and correlation:
##
## Pearson's product-moment correlation
##
## data: tbl[[lx]] and tbl[[ly]]
## t = 209, df = 9099, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.9060 0.9131
## sample estimates:
## cor
## 0.9096
shared_ids <- rownames(t_cf_neutrophil_tables_sva[["data"]][[1]]) %in%
rownames(t_cf_neutrophil_tables_batchvisit[["data"]][[1]])
first <- t_cf_neutrophil_tables_sva[["data"]][[1]][shared_ids, ]
second <- t_cf_neutrophil_tables_batchvisit[["data"]][[1]][rownames(first), ]
cor.test(first[["deseq_logfc"]], second[["deseq_logfc"]])
##
## Pearson's product-moment correlation
##
## data: first[["deseq_logfc"]] and second[["deseq_logfc"]]
## t = 209, df = 9099, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.9060 0.9131
## sample estimates:
## cor
## 0.9096
This time, with feeling! Repeating the same set of tasks with the eosinophil samples.
##
## Tumaco_cure Tumaco_failure
## 17 9
## Removing 0 low-count genes (10532 remaining).
## Setting 327 low elements to zero.
## transform_counts: Found 327 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.9099
## limma_vs_edger 0.9174
## limma_vs_ebseq 0.8005
## limma_vs_basic 0.8755
## limma_vs_noiseq -0.7909
## deseq_vs_edger 0.9973
## deseq_vs_ebseq 0.8058
## deseq_vs_basic 0.8488
## deseq_vs_noiseq -0.7864
## edger_vs_ebseq 0.8134
## edger_vs_basic 0.8546
## edger_vs_noiseq -0.7963
## ebseq_vs_basic 0.8636
## ebseq_vs_noiseq -0.8453
## basic_vs_noiseq -0.8713
t_cf_eosinophil_tables_sva <- combine_de_tables(
t_cf_eosinophil_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_cf_tables_sva-v{ver}.xlsx"))
t_cf_eosinophil_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 116 73 112
## edger_sigdown limma_sigup limma_sigdown
## 1 63 57 34
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_eosinophil_sig_sva <- extract_significant_genes(
t_cf_eosinophil_tables_sva,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_cf_sig_sva-v{ver}.xlsx"))
t_cf_eosinophil_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 57 34 112 63 116 73 7
## ebseq_down basic_up basic_down
## outcome 33 0 0
## [1] 116 69
## [1] 73 69
##
## Tumaco_cure Tumaco_failure
## 17 9
##
## 3 2 1
## 9 9 8
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: batch in model/limma.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8678
## limma_vs_edger 0.8696
## limma_vs_ebseq 0.8328
## limma_vs_basic 0.9676
## limma_vs_noiseq -0.8444
## deseq_vs_edger 0.9998
## deseq_vs_ebseq 0.9519
## deseq_vs_basic 0.8961
## deseq_vs_noiseq -0.8351
## edger_vs_ebseq 0.9559
## edger_vs_basic 0.8977
## edger_vs_noiseq -0.8396
## ebseq_vs_basic 0.8636
## ebseq_vs_noiseq -0.8453
## basic_vs_noiseq -0.8713
t_cf_eosinophil_tables_batchvisit <- combine_de_tables(
t_cf_eosinophil_de_batchvisit, keepers = cf_contrast,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_cf_tables_batchvisit-v{ver}.xlsx"))
t_cf_eosinophil_tables_batchvisit
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 99 35 103
## edger_sigdown limma_sigup limma_sigdown
## 1 24 35 15
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_eosinophil_sig_batchvisit <- extract_significant_genes(
t_cf_eosinophil_tables_batchvisit,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_cf_sig_batchvisit-v{ver}.xlsx"))
t_cf_eosinophil_sig_batchvisit
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 35 15 103 24 99 35 7
## ebseq_down basic_up basic_down
## outcome 33 0 0
## [1] 99 69
## [1] 35 69
visitcf_factor <- paste0("v", pData(t_eosinophils)[["visitnumber"]],
pData(t_eosinophils)[["finaloutcome"]])
t_eosinophil_visitcf <- set_expt_conditions(t_eosinophils, fact = visitcf_factor)
## The numbers of samples by condition are:
##
## v1cure v1failure v2cure v2failure v3cure v3failure
## 5 3 6 3 6 3
t_cf_eosinophil_visits_de_sva <- all_pairwise(t_eosinophil_visitcf, model_batch = "svaseq",
filter = TRUE)
##
## v1cure v1failure v2cure v2failure v3cure v3failure
## 5 3 6 3 6 3
## Removing 0 low-count genes (10532 remaining).
## Setting 373 low elements to zero.
## transform_counts: Found 373 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 10 comparisons.
t_cf_eosinophil_visits_tables_sva <- combine_de_tables(
t_cf_eosinophil_visits_de_sva, keepers = visitcf_contrasts,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_visitcf_tables_sva-v{ver}.xlsx"))
t_cf_eosinophil_visits_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 v1failure_vs_v1cure 9 11 2 3
## 2 v2failure_vs_v2cure 4 3 5 2
## 3 v3failure_vs_v3cure 14 7 17 2
## limma_sigup limma_sigdown
## 1 0 1
## 2 0 0
## 3 0 0
## Plot describing unique/shared genes in a differential expression table.
t_cf_eosinophil_visits_sig_sva <- extract_significant_genes(
t_cf_eosinophil_visits_tables_sva,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_visitcf_sig_sva-v{ver}.xlsx"))
t_cf_eosinophil_visits_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down basic_up
## v1cf 0 1 2 3 9 11 0
## v2cf 0 0 5 2 4 3 0
## v3cf 0 0 17 2 14 7 0
## basic_down
## v1cf 0
## v2cf 0
## v3cf 0
## [1] 9 59
## [1] 11 59
Up: 116 genes; 123 GO, 2 KEGG, 7 Reactome, 5 WP, 69 TF, 1 miRNA, 0 others Down: 74 genes; 5 GO, 1 Reactome, 4 TF, 0 others
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 148 2 7 5 68 1 0 0 0
## outcome_down 6 0 1 0 1 0 0 0 0
written <- write_gprofiler_data(
t_cf_eosinophil_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_eosinophil_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_cf_eosinophil_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_eosinophil_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
Note to self, when I rendered the html, stupid R ran out of temp files and so did not actually print the darn html document, as a result I modified the render function to try to make sure there is a clean directory in which to work; testing now. If it continues to not work, I will need to remove some of the images created in this document.
num_color <- color_choices[["clinic_cf"]][["Tumaco_failure"]]
den_color <- color_choices[["clinic_cf"]][["Tumaco_cure"]]
wanted_genes <- c("FI44L", "IFI27", "PRR5", "PRR5-ARHGAP8", "RHCE",
"FBXO39", "RSAD2", "SMTNL1", "USP18", "AFAP1")
cf_monocyte_table <- t_cf_monocyte_tables_sva[["data"]][["outcome"]]
cf_monocyte_volcano <- plot_volcano_condition_de(
cf_monocyte_table, "outcome", label = wanted_genes,
fc_col = "deseq_logfc", p_col = "deseq_adjp", line_position = NULL,
color_high = num_color, color_low = den_color, label_size = 6)
pp(file = glue("images/cf_monocyte_volcano_labeled-v{ver}.svg"))
## Warning in pp(file = glue("images/cf_monocyte_volcano_labeled-v{ver}.svg")):
## The directory: images does not exist, will attempt to create it.
## png
## 2
cf_eosinophil_table <- t_cf_eosinophil_tables_sva[["data"]][["outcome"]]
cf_eosinophil_volcano <- plot_volcano_condition_de(
cf_eosinophil_table, "outcome", label = wanted_genes,
fc_col = "deseq_logfc", p_col = "deseq_adjp", line_position = NULL,
color_high = num_color, color_low = den_color, label_size = 6)
pp(file = glue("images/cf_eosinophil_volcano_labeled-v{ver}.svg"))
cf_eosinophil_volcano$plot
dev.off()
## png
## 2
cf_neutrophil_table <- t_cf_neutrophil_tables_sva[["data"]][["outcome"]]
cf_neutrophil_volcano <- plot_volcano_condition_de(
cf_neutrophil_table, "outcome", label = wanted_genes,
fc_col = "deseq_logfc", p_col = "deseq_adjp", line_position = NULL,
color_high = num_color, color_low = den_color, label_size = 6)
pp(file = glue("images/cf_neutrophil_volcano_labeled-v{ver}.svg"))
cf_neutrophil_volcano$plot
dev.off()
## png
## 2
##
## Tumaco_cure Tumaco_failure
## 5 3
## Removing 0 low-count genes (9979 remaining).
## Setting 57 low elements to zero.
## transform_counts: Found 57 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8465
## limma_vs_edger 0.8498
## limma_vs_ebseq 0.8494
## limma_vs_basic 0.9207
## limma_vs_noiseq -0.8343
## deseq_vs_edger 0.9996
## deseq_vs_ebseq 0.8648
## deseq_vs_basic 0.8702
## deseq_vs_noiseq -0.7807
## edger_vs_ebseq 0.8683
## edger_vs_basic 0.8716
## edger_vs_noiseq -0.7850
## ebseq_vs_basic 0.8820
## ebseq_vs_noiseq -0.9448
## basic_vs_noiseq -0.8407
t_cf_eosinophil_v1_tables_sva <- combine_de_tables(
t_cf_eosinophil_v1_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_v1_cf_tables_sva-v{ver}.xlsx"))
t_cf_eosinophil_v1_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 13 19 11
## edger_sigdown limma_sigup limma_sigdown
## 1 10 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_eosinophil_v1_sig_sva <- extract_significant_genes(
t_cf_eosinophil_v1_tables_sva,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_v1_cf_sig_sva-v{ver}.xlsx"))
t_cf_eosinophil_v1_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 13 19 11
## edger_sigdown limma_sigup limma_sigdown
## 1 10 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
## [1] 13 69
## [1] 19 69
##
## Tumaco_cure Tumaco_failure
## 6 3
## Removing 0 low-count genes (10117 remaining).
## Setting 90 low elements to zero.
## transform_counts: Found 90 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.8540
## limma_vs_edger 0.8581
## limma_vs_ebseq 0.7590
## limma_vs_basic 0.8937
## limma_vs_noiseq -0.7844
## deseq_vs_edger 0.9996
## deseq_vs_ebseq 0.8803
## deseq_vs_basic 0.8446
## deseq_vs_noiseq -0.8332
## edger_vs_ebseq 0.8816
## edger_vs_basic 0.8465
## edger_vs_noiseq -0.8360
## ebseq_vs_basic 0.8616
## ebseq_vs_noiseq -0.8954
## basic_vs_noiseq -0.8616
t_cf_eosinophil_v2_tables_sva <- combine_de_tables(
t_cf_eosinophil_v2_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_v2_cf_tables_sva-v{ver}.xlsx"))
t_cf_eosinophil_v2_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 9 4 10
## edger_sigdown limma_sigup limma_sigdown
## 1 1 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_eosinophil_v2_sig_sva <- extract_significant_genes(
t_cf_eosinophil_v2_tables_sva,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_v2_cf_sig_sva-v{ver}.xlsx"))
t_cf_eosinophil_v2_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 10 1 9 4 9
## ebseq_down basic_up basic_down
## outcome 17 0 0
## [1] 9 69
## [1] 4 69
##
## Tumaco_cure Tumaco_failure
## 6 3
## Removing 0 low-count genes (10080 remaining).
## Setting 48 low elements to zero.
## transform_counts: Found 48 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Tmcflr_v_T
## limma_vs_deseq 0.9137
## limma_vs_edger 0.9138
## limma_vs_ebseq 0.7984
## limma_vs_basic 0.8620
## limma_vs_noiseq -0.7838
## deseq_vs_edger 1.0000
## deseq_vs_ebseq 0.8832
## deseq_vs_basic 0.8019
## deseq_vs_noiseq -0.8252
## edger_vs_ebseq 0.8833
## edger_vs_basic 0.8021
## edger_vs_noiseq -0.8258
## ebseq_vs_basic 0.8927
## ebseq_vs_noiseq -0.9333
## basic_vs_noiseq -0.8696
t_cf_eosinophil_v3_tables_sva <- combine_de_tables(
t_cf_eosinophil_v3_de_sva, keepers = cf_contrast,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_v3_cf_tables_sva-v{ver}.xlsx"))
t_cf_eosinophil_v3_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup
## 1 Tumacofailure_vs_Tumacocure 68 29 73
## edger_sigdown limma_sigup limma_sigdown
## 1 10 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_cf_eosinophil_v3_sig_sva <- extract_significant_genes(
t_cf_eosinophil_v3_tables_sva,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_v3_cf_sig_sva-v{ver}.xlsx"))
t_cf_eosinophil_v3_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## outcome 0 0 73 10 68 29 2
## ebseq_down basic_up basic_down
## outcome 9 0 0
## [1] 68 69
## [1] 29 69
Up: 13 genes, no hits. Down: 19 genes; 11 GO, 1 Reactome, 1 TF
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 0 0 0 0 0 0 0 0 0
## outcome_down 9 0 1 0 1 0 0 0 0
written <- write_gprofiler_data(
t_cf_eosinophil_v1_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_eosinophil_v1_up-v{ver}.xlsx"))
## Warning: Workbook does not contain any worksheets. A worksheet will be added.
written <- write_gprofiler_data(
t_cf_eosinophil_v1_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_eosinophil_v1_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
Up: 9 genes; 23 GO, 2 KEGG, 2 Reactome, 4 WP Down: 4 genes; no hits
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 26 2 2 4 0 0 0 0 0
## outcome_down 1 0 0 1 0 0 0 0 0
written <- write_gprofiler_data(
t_cf_eosinophil_v2_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_eosinophil_v2_up-v{ver}.xlsx"))
written <- write_gprofiler_data(
t_cf_eosinophil_v2_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_eosinophil_v2_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
Up: 68 genes; 95 GO, 2 KEGG, 12 Reactome, 3 WP, 63 TF, 1 miRNA Down: 29 genes; 3 GO, 1 WP, 1 TF, 3 miRNA
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## outcome_up 113 2 15 3 64 1 0 0 0
## outcome_down 3 0 0 1 1 3 0 0 1
written <- write_gprofiler_data(
t_cf_eosinophil_v3_sig_sva_gp[["outcome_up"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_eosinophil_v3_up-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
written <- write_gprofiler_data(
t_cf_eosinophil_v3_sig_sva_gp[["outcome_down"]],
excel = glue("{xlsx_prefix}/Gene set enrichment/t_cf_eosinophil_v3_down-v{ver}.xlsx"))
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
sva_aucc <- calculate_aucc(t_cf_eosinophil_tables_sva[["data"]][[1]],
tbl2 = t_cf_eosinophil_tables_batchvisit[["data"]][[1]],
py = "deseq_adjp", ly = "deseq_logfc")
sva_aucc
## These two tables have an aucc value of: 0.575992158061818 and correlation:
##
## Pearson's product-moment correlation
##
## data: tbl[[lx]] and tbl[[ly]]
## t = 152, df = 10530, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.8232 0.8351
## sample estimates:
## cor
## 0.8292
shared_ids <- rownames(t_cf_eosinophil_tables_sva[["data"]][[1]]) %in%
rownames(t_cf_eosinophil_tables_batchvisit[["data"]][[1]])
first <- t_cf_eosinophil_tables_sva[["data"]][[1]][shared_ids, ]
second <- t_cf_eosinophil_tables_batchvisit[["data"]][[1]][rownames(first), ]
cor.test(first[["deseq_logfc"]], second[["deseq_logfc"]])
##
## Pearson's product-moment correlation
##
## data: first[["deseq_logfc"]] and second[["deseq_logfc"]]
## t = 152, df = 10530, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.8232 0.8351
## sample estimates:
## cor
## 0.8292
t_mono_neut_sva_aucc <- calculate_aucc(t_cf_monocyte_tables_sva[["data"]][["outcome"]],
tbl2 = t_cf_neutrophil_tables_sva[["data"]][["outcome"]],
py = "deseq_adjp", ly = "deseq_logfc")
t_mono_neut_sva_aucc
## These two tables have an aucc value of: 0.204260579576817 and correlation:
##
## Pearson's product-moment correlation
##
## data: tbl[[lx]] and tbl[[ly]]
## t = 43, df = 8577, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.4028 0.4376
## sample estimates:
## cor
## 0.4204
t_mono_eo_sva_aucc <- calculate_aucc(t_cf_monocyte_tables_sva[["data"]][["outcome"]],
tbl2 = t_cf_eosinophil_tables_sva[["data"]][["outcome"]],
py = "deseq_adjp", ly = "deseq_logfc")
t_mono_eo_sva_aucc
## These two tables have an aucc value of: 0.0963272498511824 and correlation:
##
## Pearson's product-moment correlation
##
## data: tbl[[lx]] and tbl[[ly]]
## t = 22, df = 9765, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.2016 0.2393
## sample estimates:
## cor
## 0.2206
t_neut_eo_sva_aucc <- calculate_aucc(t_cf_neutrophil_tables_sva[["data"]][["outcome"]],
tbl2 = t_cf_eosinophil_tables_sva[["data"]][["outcome"]],
py = "deseq_adjp", ly = "deseq_logfc")
t_neut_eo_sva_aucc
## These two tables have an aucc value of: 0.201619581335336 and correlation:
##
## Pearson's product-moment correlation
##
## data: tbl[[lx]] and tbl[[ly]]
## t = 42, df = 8571, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.3974 0.4324
## sample estimates:
## cor
## 0.4151
For these contrasts, we want to see fail_v1 vs. cure_v1, fail_v2 vs. cure_v2 etc. As a result, we will need to juggle the data slightly and add another set of contrasts.
##
## v1cure v1failure v2cure v2failure v3cure v3failure
## 30 24 20 15 17 17
## Removing 0 low-count genes (14156 remaining).
## Setting 17161 low elements to zero.
## transform_counts: Found 17161 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 10 comparisons.
t_visit_cf_all_tables_sva <- combine_de_tables(
t_visit_cf_all_de_sva, keepers = visitcf_contrasts,
excel = glue("{cf_prefix}/t_all_visitcf_tables_sva-v{ver}.xlsx"))
t_visit_cf_all_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 v1failure_vs_v1cure 26 82 26 58
## 2 v2failure_vs_v2cure 51 41 43 28
## 3 v3failure_vs_v3cure 77 32 33 25
## limma_sigup limma_sigdown
## 1 9 17
## 2 3 0
## 3 3 0
## Plot describing unique/shared genes in a differential expression table.
t_visit_cf_all_sig_sva <- extract_significant_genes(
t_visit_cf_all_tables_sva,
excel = glue("{cf_prefix}/t_all_visitcf_sig_sva-v{ver}.xlsx"))
t_visit_cf_all_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down basic_up
## v1cf 9 17 26 58 26 82 0
## v2cf 3 0 43 28 51 41 0
## v3cf 3 0 33 25 77 32 0
## basic_down
## v1cf 0
## v2cf 0
## v3cf 0
I am adding every gprofiler call to this document, but I have a strong feeling that this one is redundant.
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Did not find the column: in the significant genes.
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## No results to show
## Please make sure that the organism is correct or set significant = FALSE
## Add a little logic here to use enrichplot::dotplot().
## Running gProfiler on every set of significant genes found:
## GO KEGG REAC WP TF MIRNA HPA CORUM HP
## v1cf_up 5 0 0 0 2 0 0 0 0
## v1cf_down 40 0 4 2 0 1 1 0 0
## v2cf_up 66 1 4 4 40 3 0 0 0
## v2cf_down 35 0 1 2 2 0 0 0 2
## v3cf_up 26 0 5 0 11 0 1 0 0
## v3cf_down 8 1 0 0 0 4 0 0 2
visitcf_factor <- paste0("v", pData(t_monocytes)[["visitnumber"]], "_",
pData(t_monocytes)[["finaloutcome"]])
t_monocytes_visitcf <- set_expt_conditions(t_monocytes, fact = visitcf_factor)
## The numbers of samples by condition are:
##
## v1_cure v1_failure v2_cure v2_failure v3_cure v3_failure
## 8 8 7 6 6 7
t_visit_cf_monocyte_de_sva <- all_pairwise(t_monocytes_visitcf, model_batch = "svaseq",
filter = TRUE)
##
## v1_cure v1_failure v2_cure v2_failure v3_cure v3_failure
## 8 8 7 6 6 7
## Removing 0 low-count genes (10862 remaining).
## Setting 700 low elements to zero.
## transform_counts: Found 700 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 10 comparisons.
t_visit_cf_monocyte_tables_sva <- combine_de_tables(
t_visit_cf_monocyte_de_sva, keepers = visitcf_contrasts,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_visitcf_tables_sva-v{ver}.xlsx"))
t_visit_cf_monocyte_tables_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 v1failure_vs_v1cure 15 10 10 13
## 2 v2failure_vs_v2cure 0 0 0 0
## 3 v3failure_vs_v3cure 0 0 0 0
## limma_sigup limma_sigdown
## 1 1 1
## 2 0 0
## 3 0 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_visit_cf_monocyte_sig_sva <- extract_significant_genes(
t_visit_cf_monocyte_tables_sva,
excel = glue("{cf_prefix}/Monocytes/t_monocyte_visitcf_sig_sva-v{ver}.xlsx"))
t_visit_cf_monocyte_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down basic_up
## v1cf 1 1 10 13 15 10 0
## v2cf 0 0 0 0 0 0 0
## v3cf 0 0 0 0 0 0 0
## basic_down
## v1cf 0
## v2cf 0
## v3cf 0
t_v1fc_deseq_ma <- t_visit_cf_monocyte_tables_sva[["plots"]][["v1cf"]][["deseq_ma_plots"]][["plot"]]
dev <- pp(file = "images/monocyte_cf_de_v1_maplot.png")
t_v1fc_deseq_ma
## NULL
## NULL
t_v2fc_deseq_ma <- t_visit_cf_monocyte_tables_sva[["plots"]][["v2cf"]][["deseq_ma_plots"]][["plot"]]
dev <- pp(file = "images/monocyte_cf_de_v2_maplot.png")
t_v2fc_deseq_ma
## NULL
## NULL
t_v3fc_deseq_ma <- t_visit_cf_monocyte_tables_sva[["plots"]][["v3cf"]][["deseq_ma_plots"]][["plot"]]
dev <- pp(file = "images/monocyte_cf_de_v3_maplot.png")
t_v3fc_deseq_ma
## NULL
## NULL
One query from Alejandro is to look at the genes shared up/down across visits. I am not entirely certain we have enough samples for this to work, but let us find out.
I am thinking this is a good place to use the AUCC curves I learned about thanks to Julie Cridland.
Note that the following is all monocyte samples, this should therefore potentially be moved up and a version of this with only the Tumaco samples put here?
v1cf <- t_visit_cf_monocyte_tables_sva[["data"]][["v1cf"]]
v2cf <- t_visit_cf_monocyte_tables_sva[["data"]][["v2cf"]]
v3cf <- t_visit_cf_monocyte_tables_sva[["data"]][["v3cf"]]
v1_sig <- c(
rownames(t_visit_cf_monocyte_sig_sva[["deseq"]][["ups"]][["v1cf"]]),
rownames(t_visit_cf_monocyte_sig_sva[["deseq"]][["downs"]][["v1cf"]]))
length(v1_sig)
## [1] 25
v2_sig <- c(
rownames(t_visit_cf_monocyte_sig_sva[["deseq"]][["ups"]][["v2cf"]]),
rownames(t_visit_cf_monocyte_sig_sva[["deseq"]][["downs"]][["v2cf"]]))
length(v2_sig)
## [1] 0
v3_sig <- c(
rownames(t_visit_cf_monocyte_sig_sva[["deseq"]][["ups"]][["v2cf"]]),
rownames(t_visit_cf_monocyte_sig_sva[["deseq"]][["downs"]][["v2cf"]]))
length(v3_sig)
## [1] 0
t_monocyte_visit_aucc_v2v1 <- calculate_aucc(v1cf, tbl2 = v2cf,
py = "deseq_adjp", ly = "deseq_logfc")
dev <- pp(file = "images/monocyte_visit_v2v1_aucc.png")
t_monocyte_visit_aucc_v2v1[["plot"]]
closed <- dev.off()
t_monocyte_visit_aucc_v2v1[["plot"]]
t_monocyte_visit_aucc_v3v1 <- calculate_aucc(v1cf, tbl2 = v3cf,
py = "deseq_adjp", ly = "deseq_logfc")
dev <- pp(file = "images/monocyte_visit_v3v1_aucc.png")
t_monocyte_visit_aucc_v3v1[["plot"]]
closed <- dev.off()
t_monocyte_visit_aucc_v3v1[["plot"]]
visitcf_factor <- paste0("v", pData(t_neutrophils)[["visitnumber"]], "_",
pData(t_neutrophils)[["finaloutcome"]])
t_neutrophil_visitcf <- set_expt_conditions(t_neutrophils, fact = visitcf_factor)
## The numbers of samples by condition are:
##
## v1_cure v1_failure v2_cure v2_failure v3_cure v3_failure
## 8 8 7 6 5 7
t_visit_cf_neutrophil_de_sva <- all_pairwise(t_neutrophil_visitcf, model_batch = "svaseq",
filter = TRUE)
##
## v1_cure v1_failure v2_cure v2_failure v3_cure v3_failure
## 8 8 7 6 5 7
## Removing 0 low-count genes (9101 remaining).
## Setting 685 low elements to zero.
## transform_counts: Found 685 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 10 comparisons.
t_visit_cf_neutrophil_tables_sva <- combine_de_tables(
t_visit_cf_neutrophil_de_sva, keepers = visitcf_contrasts,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_visitcf_tables_sva-v{ver}.xlsx"))
## Deleting the file analyses/4_tumaco/DE_Cure_vs_Fail/Neutrophils/t_neutrophil_visitcf_tables_sva-v202406.xlsx before writing the tables.
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 v1failure_vs_v1cure 12 6 6 6
## 2 v2failure_vs_v2cure 2 6 2 3
## 3 v3failure_vs_v3cure 2 2 0 2
## limma_sigup limma_sigdown
## 1 1 0
## 2 0 0
## 3 0 0
## Plot describing unique/shared genes in a differential expression table.
t_visit_cf_neutrophil_sig_sva <- extract_significant_genes(
t_visit_cf_neutrophil_tables_sva,
excel = glue("{cf_prefix}/Neutrophils/t_neutrophil_visitcf_sig_sva-v{ver}.xlsx"))
## Deleting the file analyses/4_tumaco/DE_Cure_vs_Fail/Neutrophils/t_neutrophil_visitcf_sig_sva-v202406.xlsx before writing the tables.
## A set of genes deemed significant according to limma, edger, deseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down basic_up
## v1cf 1 0 6 6 12 6 0
## v2cf 0 0 2 3 2 6 0
## v3cf 0 0 0 2 2 2 0
## basic_down
## v1cf 0
## v2cf 0
## v3cf 0
visitcf_factor <- paste0("v", pData(t_eosinophils)[["visitnumber"]], "_",
pData(t_eosinophils)[["finaloutcome"]])
t_eosinophil_visitcf <- set_expt_conditions(t_eosinophils, fact = visitcf_factor)
## The numbers of samples by condition are:
##
## v1_cure v1_failure v2_cure v2_failure v3_cure v3_failure
## 5 3 6 3 6 3
t_visit_cf_eosinophil_de_sva <- all_pairwise(t_eosinophil_visitcf, model_batch = "svaseq",
filter = TRUE)
##
## v1_cure v1_failure v2_cure v2_failure v3_cure v3_failure
## 5 3 6 3 6 3
## Removing 0 low-count genes (10532 remaining).
## Setting 373 low elements to zero.
## transform_counts: Found 373 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 10 comparisons.
t_visit_cf_eosinophil_tables_sva <- combine_de_tables(
t_visit_cf_eosinophil_de_sva, keepers = visitcf_contrasts,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_visitcf_tables_sva-v{ver}.xlsx"))
## Deleting the file analyses/4_tumaco/DE_Cure_vs_Fail/Eosinophils/t_eosinophil_visitcf_tables_sva-v202406.xlsx before writing the tables.
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 v1failure_vs_v1cure 9 11 2 3
## 2 v2failure_vs_v2cure 4 3 5 2
## 3 v3failure_vs_v3cure 14 7 17 2
## limma_sigup limma_sigdown
## 1 0 1
## 2 0 0
## 3 0 0
## Plot describing unique/shared genes in a differential expression table.
t_visit_cf_eosinophil_sig_sva <- extract_significant_genes(
t_visit_cf_eosinophil_tables_sva,
excel = glue("{cf_prefix}/Eosinophils/t_eosinophil_visitcf_sig_sva-v{ver}.xlsx"))
## Deleting the file analyses/4_tumaco/DE_Cure_vs_Fail/Eosinophils/t_eosinophil_visitcf_sig_sva-v202406.xlsx before writing the tables.
## A set of genes deemed significant according to limma, edger, deseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down basic_up
## v1cf 0 1 2 3 9 11 0
## v2cf 0 0 5 2 4 3 0
## v3cf 0 0 17 2 14 7 0
## basic_down
## v1cf 0
## v2cf 0
## v3cf 0
Having put some SL read mapping information in the sample sheet, Maria Adelaida added a new column using it with the putative persistence state on a per-sample basis. One question which arised from that: what differences are observable between the persistent yes vs. no samples on a per-cell-type basis among the visit 3 samples.
First things first, create the datasets.
persistence_expt <- subset_expt(t_clinical, subset = "persistence=='Y'|persistence=='N'") %>%
subset_expt(subset = 'visitnumber==3') %>%
set_expt_conditions(fact = 'persistence')
## The samples excluded are: TMRC30016, TMRC30017, TMRC30018, TMRC30019, TMRC30020, TMRC30094, TMRC30082, TMRC30022, TMRC30093, TMRC30029, TMRC30032, TMRC30083, TMRC30028, TMRC30118, TMRC30014, TMRC30196, TMRC30030, TMRC30021, TMRC30026, TMRC30037, TMRC30031, TMRC30027, TMRC30044, TMRC30194, TMRC30195, TMRC30045, TMRC30191, TMRC30041, TMRC30171, TMRC30192, TMRC30042, TMRC30072, TMRC30043, TMRC30241, TMRC30237, TMRC30238, TMRC30074, TMRC30077, TMRC30264, TMRC30265.
## subset_expt(): There were 123, now there are 83 samples.
## The samples excluded are: TMRC30071, TMRC30056, TMRC30113, TMRC30058, TMRC30080, TMRC30119, TMRC30103, TMRC30107, TMRC30096, TMRC30180, TMRC30165, TMRC30166, TMRC30048, TMRC30054, TMRC30046, TMRC30049, TMRC30047, TMRC30053, TMRC30158, TMRC30132, TMRC30157, TMRC30167, TMRC30123, TMRC30181, TMRC30116, TMRC30184, TMRC30076, TMRC30159, TMRC30129, TMRC30134, TMRC30174, TMRC30137, TMRC30142, TMRC30175, TMRC30143, TMRC30168, TMRC30197, TMRC30182, TMRC30199, TMRC30198, TMRC30200, TMRC30203, TMRC30204, TMRC30152, TMRC30177, TMRC30155, TMRC30154, TMRC30207, TMRC30217, TMRC30208, TMRC30218, TMRC30135, TMRC30144.
## subset_expt(): There were 83, now there are 30 samples.
## The numbers of samples by condition are:
##
## N Y
## 6 24
## persistence_biopsy <- subset_expt(persistence_expt, subset = "typeofcells=='biopsy'")
persistence_monocyte <- subset_expt(persistence_expt, subset = "typeofcells=='monocytes'")
## The samples excluded are: TMRC30164, TMRC30122, TMRC30170, TMRC30121, TMRC30070, TMRC30068, TMRC30160, TMRC30133, TMRC30088, TMRC30161, TMRC30146, TMRC30202, TMRC30206, TMRC30136, TMRC30079, TMRC30220, TMRC30173, TMRC30147.
## subset_expt(): There were 30, now there are 12 samples.
## The samples excluded are: TMRC30105, TMRC30164, TMRC30122, TMRC30169, TMRC30115, TMRC30070, TMRC30055, TMRC30139, TMRC30183, TMRC30078, TMRC30172, TMRC30161, TMRC30145, TMRC30201, TMRC30205, TMRC30136, TMRC30219, TMRC30079, TMRC30173, TMRC30147.
## subset_expt(): There were 30, now there are 10 samples.
## The samples excluded are: TMRC30105, TMRC30169, TMRC30170, TMRC30115, TMRC30121, TMRC30055, TMRC30068, TMRC30139, TMRC30160, TMRC30183, TMRC30133, TMRC30078, TMRC30088, TMRC30172, TMRC30145, TMRC30146, TMRC30201, TMRC30202, TMRC30205, TMRC30206, TMRC30219, TMRC30220.
## subset_expt(): There were 30, now there are 8 samples.
See if there are any patterns which look usable.
## All
persistence_norm <- normalize_expt(persistence_expt, transform = "log2", convert = "cpm",
norm = "quant", filter = TRUE)
## Removing 8563 low-count genes (11389 remaining).
## transform_counts: Found 15 values equal to 0, adding 1 to the matrix.
persistence_nb <- normalize_expt(persistence_expt, transform = "log2", convert = "cpm",
batch = "svaseq", filter = TRUE)
## Removing 8563 low-count genes (11389 remaining).
## Setting 1544 low elements to zero.
## transform_counts: Found 1544 values equal to 0, adding 1 to the matrix.
## Biopsies
##persistence_biopsy_norm <- normalize_expt(persistence_biopsy, transform = "log2", convert = "cpm",
## norm = "quant", filter = TRUE)
##plot_pca(persistence_biopsy_norm)$plot
## Insufficient data
## Monocytes
persistence_monocyte_norm <- normalize_expt(persistence_monocyte, transform = "log2", convert = "cpm",
norm = "quant", filter = TRUE)
## Removing 9623 low-count genes (10329 remaining).
## transform_counts: Found 1 values equal to 0, adding 1 to the matrix.
persistence_monocyte_nb <- normalize_expt(persistence_monocyte, transform = "log2", convert = "cpm",
batch = "svaseq", filter = TRUE)
## Removing 9623 low-count genes (10329 remaining).
## Setting 47 low elements to zero.
## transform_counts: Found 47 values equal to 0, adding 1 to the matrix.
## Neutrophils
persistence_neutrophil_norm <- normalize_expt(persistence_neutrophil, transform = "log2", convert = "cpm",
norm = "quant", filter = TRUE)
## Removing 11558 low-count genes (8394 remaining).
## transform_counts: Found 2 values equal to 0, adding 1 to the matrix.
persistence_neutrophil_nb <- normalize_expt(persistence_neutrophil, transform = "log2", convert = "cpm",
batch = "svaseq", filter = TRUE)
## Removing 11558 low-count genes (8394 remaining).
## Setting 46 low elements to zero.
## transform_counts: Found 46 values equal to 0, adding 1 to the matrix.
## Eosinophils
persistence_eosinophil_norm <- normalize_expt(persistence_eosinophil, transform = "log2", convert = "cpm",
norm = "quant", filter = TRUE)
## Removing 9922 low-count genes (10030 remaining).
## transform_counts: Found 1 values equal to 0, adding 1 to the matrix.
persistence_eosinophil_nb <- normalize_expt(persistence_eosinophil, transform = "log2", convert = "cpm",
batch = "svaseq", filter = TRUE)
## Removing 9922 low-count genes (10030 remaining).
## Setting 25 low elements to zero.
## transform_counts: Found 25 values equal to 0, adding 1 to the matrix.
##
## N Y
## 6 24
## Removing 0 low-count genes (11389 remaining).
## Setting 1544 low elements to zero.
## transform_counts: Found 1544 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Y_vs_N
## limma_vs_deseq 0.8111
## limma_vs_edger 0.8765
## limma_vs_ebseq 0.7876
## limma_vs_basic 0.8218
## limma_vs_noiseq -0.6444
## deseq_vs_edger 0.9605
## deseq_vs_ebseq 0.7777
## deseq_vs_basic 0.7178
## deseq_vs_noiseq -0.5868
## edger_vs_ebseq 0.7900
## edger_vs_basic 0.7791
## edger_vs_noiseq -0.6433
## ebseq_vs_basic 0.7451
## ebseq_vs_noiseq -0.7651
## basic_vs_noiseq -0.7960
persistence_table_sva <- combine_de_tables(
persistence_de_sva,
excel = glue("{xlsx_prefix}/DE_Persistence/persistence_all_de_sva-v{ver}.xlsx"))
persistence_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup
## 1 Y_vs_N 55 44 26 49 7
## limma_sigdown
## 1 22
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
persistence_monocyte_de_sva <- all_pairwise(persistence_monocyte, filter = TRUE, model_batch = "svaseq")
##
## N Y
## 2 10
## Removing 0 low-count genes (10329 remaining).
## Setting 47 low elements to zero.
## transform_counts: Found 47 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Y_vs_N
## limma_vs_deseq 0.9260
## limma_vs_edger 0.9270
## limma_vs_ebseq 0.9239
## limma_vs_basic 0.9858
## limma_vs_noiseq -0.9013
## deseq_vs_edger 1.0000
## deseq_vs_ebseq 0.9808
## deseq_vs_basic 0.9237
## deseq_vs_noiseq -0.9181
## edger_vs_ebseq 0.9809
## edger_vs_basic 0.9245
## edger_vs_noiseq -0.9193
## ebseq_vs_basic 0.9209
## ebseq_vs_noiseq -0.9275
## basic_vs_noiseq -0.9039
persistence_monocyte_table_sva <- combine_de_tables(
persistence_monocyte_de_sva,
excel = glue("{xlsx_prefix}/DE_Persistence/persistence_monocyte_de_sva-v{ver}.xlsx"))
persistence_monocyte_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup
## 1 Y_vs_N 1 0 0 1 0
## limma_sigdown
## 1 0
## Only Y_vs_N_up has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
persistence_neutrophil_de_sva <- all_pairwise(persistence_neutrophil, filter = TRUE, model_batch = "svaseq")
##
## N Y
## 3 7
## Removing 0 low-count genes (8394 remaining).
## Setting 46 low elements to zero.
## transform_counts: Found 46 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## Y_vs_N
## limma_vs_deseq 0.9407
## limma_vs_edger 0.9408
## limma_vs_ebseq 0.7777
## limma_vs_basic 0.8808
## limma_vs_noiseq -0.7817
## deseq_vs_edger 0.9985
## deseq_vs_ebseq 0.7486
## deseq_vs_basic 0.8271
## deseq_vs_noiseq -0.7593
## edger_vs_ebseq 0.7602
## edger_vs_basic 0.8283
## edger_vs_noiseq -0.7602
## ebseq_vs_basic 0.9144
## ebseq_vs_noiseq -0.9143
## basic_vs_noiseq -0.9003
persistence_neutrophil_table_sva <- combine_de_tables(
persistence_neutrophil_de_sva,
excel = glue("{xlsx_prefix}/DE_Persistence/persistence_neutrophil_de_sva-v{ver}.xlsx"))
persistence_neutrophil_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup
## 1 Y_vs_N 26 49 17 35 0
## limma_sigdown
## 1 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
## There are insufficient samples (1) in the 'N' category.
##persistence_eosinophil_de_sva <- all_pairwise(persistence_eosinophil, filter = TRUE, model_batch = "svaseq")
##persistence_eosinophil_de_sva
##persistence_eosinophil_table_sva <- combine_de_tables(
## persistence_eosinophil_de_sva,
## excel = glue("{xlsx_prefix}/DE_Persistence/persistence_eosinophil_de_sva-v{ver}.xlsx"))
##
## 3 2 1
## 34 35 40
## Removing 0 low-count genes (11910 remaining).
## Setting 9636 low elements to zero.
## transform_counts: Found 9636 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
t_visit_all_table_sva <- combine_de_tables(
t_visit_all_de_sva, keepers = visit_contrasts,
excel = glue("{xlsx_prefix}/DE_Visits/t_all_visit_tables_sva-v{ver}.xlsx"))
t_visit_all_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup
## 1 c2_vs_c1 25 9 20 10 19
## 2 c3_vs_c1 20 20 18 16 21
## 3 c3_vs_c2 0 2 0 2 0
## limma_sigdown
## 1 7
## 2 7
## 3 0
## Plot describing unique/shared genes in a differential expression table.
t_visit_all_sig_sva <- extract_significant_genes(
t_visit_all_table_sva,
excel = glue("{xlsx_prefix}/DE_Visits/t_all_visit_sig_sva-v{ver}.xlsx"))
t_visit_all_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## v2v1 19 7 20 10 25 9 0
## v3v1 21 7 18 16 20 20 0
## v3v2 0 0 0 2 0 2 0
## ebseq_down basic_up basic_down
## v2v1 0 0 0
## v3v1 0 0 0
## v3v2 0 0 0
## The numbers of samples by condition are:
##
## 3 2 1
## 13 13 16
##
## 3 2 1
## 13 13 16
## Removing 0 low-count genes (10862 remaining).
## Setting 658 low elements to zero.
## transform_counts: Found 658 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
t_visit_monocyte_table_sva <- combine_de_tables(
t_visit_monocyte_de_sva, keepers = visit_contrasts,
excel = glue("{xlsx_prefix}/DE_Visits/Monocytes/t_monocyte_visit_tables_sva-v{ver}.xlsx"))
t_visit_monocyte_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup
## 1 c2_vs_c1 1 2 1 1 0
## 2 c3_vs_c1 2 1 1 1 0
## 3 c3_vs_c2 0 0 0 0 0
## limma_sigdown
## 1 0
## 2 0
## 3 0
## `geom_line()`: Each group consists of only one observation.
## i Do you need to adjust the group aesthetic?
## Plot describing unique/shared genes in a differential expression table.
t_visit_monocyte_sig_sva <- extract_significant_genes(
t_visit_monocyte_table_sva,
excel = glue("{xlsx_prefix}/DE_Visits/Monocytes/t_monocyte_visit_sig_sva-v{ver}.xlsx"))
t_visit_monocyte_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## v2v1 0 0 1 1 1 2 0
## v3v1 0 0 1 1 2 1 0
## v3v2 0 0 0 0 0 0 0
## ebseq_down basic_up basic_down
## v2v1 1 0 0
## v3v1 0 0 0
## v3v2 1 0 0
## The numbers of samples by condition are:
##
## 3 2 1
## 12 13 16
t_visit_neutrophil_de_sva <- all_pairwise(t_visit_neutrophils, filter = TRUE, model_batch = "svaseq")
##
## 3 2 1
## 12 13 16
## Removing 0 low-count genes (9101 remaining).
## Setting 593 low elements to zero.
## transform_counts: Found 593 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
t_visit_neutrophil_table_sva <- combine_de_tables(
t_visit_neutrophil_de_sva, keepers = visit_contrasts,
excel = glue("{xlsx_prefix}/DE_Visits/Neutrophils/t_neutrophil_visit_table_sva-v{ver}.xlsx"))
t_visit_neutrophil_table_sva
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup
## 1 c2_vs_c1 111 88 111 88 116
## 2 c3_vs_c1 127 45 122 44 93
## 3 c3_vs_c2 1 0 0 0 0
## limma_sigdown
## 1 52
## 2 67
## 3 0
## Plot describing unique/shared genes in a differential expression table.
t_visit_neutrophil_sig_sva <- extract_significant_genes(
t_visit_neutrophil_table_sva,
excel = glue("{xlsx_prefix}/DE_Visits/Neutrophils/t_neutrophil_visit_sig_sva-v{ver}.xlsx"))
t_visit_neutrophil_sig_sva
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down ebseq_up
## v2v1 116 52 111 88 111 88 64
## v3v1 93 67 122 44 127 45 36
## v3v2 0 0 0 0 1 0 1
## ebseq_down basic_up basic_down
## v2v1 20 83 35
## v3v1 7 52 17
## v3v2 0 0 0
## The numbers of samples by condition are:
##
## 3 2 1
## 9 9 8
##
## 3 2 1
## 9 9 8
## Removing 0 low-count genes (10532 remaining).
## Setting 271 low elements to zero.
## transform_counts: Found 271 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
t_visit_eosinophil_table <- combine_de_tables(
t_visit_eosinophil_de, keepers = visit_contrasts,
excel = glue("{xlsx_prefix}/DE_Visits/Eosinophils/t_eosinophil_visit_table_sva-v{ver}.xlsx"))
t_visit_eosinophil_table
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown limma_sigup
## 1 c2_vs_c1 0 0 0 0 0
## 2 c3_vs_c1 0 0 0 0 0
## 3 c3_vs_c2 0 0 0 0 0
## limma_sigdown
## 1 0
## 2 0
## 3 0
## Only has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
Alejandro showed some ROC curves for eosinophil data showing sensitivity vs. specificity of a couple genes which were observed in v1 eosinophils vs. all-times eosinophils across cure/fail. I am curious to better understand how this was done and what utility it might have in other contexts.
To that end, I want to try something similar myself. In order to properly perform the analysis with these various tools, I need to reconfigure the data in a pretty specific format:
If I intend to use this for our tx data, I will likely need a utility function to create the properly formatted input df.
For the purposes of my playing, I will choose three genes from the eosinophil C/F table, one which is significant, one which is not, and an arbitrary.
The input genes will therefore be chosen from the data structure: t_cf_eosinophil_tables_sva:
ENSG00000198178, ENSG00000179344, ENSG00000182628
## There appear to be 5355 genes without a length.
This paper is DOI:10.1126/scitranslmed.aax4204
Variable gene expression and parasite load predict treatment outcome in cutaneous leishmaniasis.
One query from Maria Adelaida is to see how this data fits with ours. I have read this paper a couple of times now and I get confused on a couple of points every time, which I will explain in a moment. The expermental design is key to my confusion and key to what I think is being missed in our interpretation of the results:
##
external_norm <- normalize_expt(external_cf, filter = TRUE, norm = "quant",
convert = "cpm", transform = "log2")
## Removing 7327 low-count genes (14154 remaining).
## The result of performing a fast_svd dimension reduction.
## The x-axis is PC1 and the y-axis is PC2
## Colors are defined by cure, failure
## Shapes are defined by female, male.
external_nb <- normalize_expt(external_cf, filter = TRUE, batch = "svaseq",
convert = "cpm", transform = "log2")
## Removing 7327 low-count genes (14154 remaining).
## Setting 171 low elements to zero.
## transform_counts: Found 171 values equal to 0, adding 1 to the matrix.
## The result of performing a fast_svd dimension reduction.
## The x-axis is PC1 and the y-axis is PC2
## Colors are defined by cure, failure
## Shapes are defined by female, male.
##
## cure failure
## 14 7
## Removing 0 low-count genes (14154 remaining).
## Setting 171 low elements to zero.
## transform_counts: Found 171 values equal to 0, adding 1 to the matrix.
## A pairwise differential expression with results from: basic, deseq, ebseq, edger, limma, noiseq.
## This used a surrogate/batch estimate from: svaseq.
## The primary analysis performed 15 comparisons.
## The logFC agreement among the methods follows:
## falr_vs_cr
## limma_vs_deseq 0.8487
## limma_vs_edger 0.8497
## limma_vs_ebseq 0.3577
## limma_vs_basic 0.4180
## limma_vs_noiseq -0.3286
## deseq_vs_edger 0.9997
## deseq_vs_ebseq 0.4149
## deseq_vs_basic 0.3908
## deseq_vs_noiseq -0.3756
## edger_vs_ebseq 0.4177
## edger_vs_basic 0.3914
## edger_vs_noiseq -0.3768
## ebseq_vs_basic 0.9027
## ebseq_vs_noiseq -0.8917
## basic_vs_noiseq -0.9338
## A set of combined differential expression results.
## table deseq_sigup deseq_sigdown edger_sigup edger_sigdown
## 1 failure_vs_cure 0 0 0 0
## limma_sigup limma_sigdown
## 1 0 0
## Only has information, cannot create an UpSet.
## Plot describing unique/shared genes in a differential expression table.
## NULL
external_sig <- extract_significant_genes(external_table, excel = "excel/scott_sig.xlsx")
external_sig
## A set of genes deemed significant according to limma, edger, deseq, ebseq, basic.
## The parameters defining significant were:
## LFC cutoff: 1 adj P cutoff: 0.05
## limma_up limma_down edger_up edger_down deseq_up deseq_down
## failure_vs_cure 0 0 0 0 0 0
## ebseq_up ebseq_down basic_up basic_down
## failure_vs_cure 0 0 0 0
I think I am getting a significantly different result from Scott, so I am going to do an explicit side-by-side comparison of our results at each step. In order to do this, I am using the capsule they kindly provided with their publication.
I am copy/pasting material from their publication with some modification which I will note as I go.
Here is their block ‘r packages’
Note/Spoiler alert: It actually turns out our results are basically relatively similar, I just didn’t understand what comparisons are actually in paper vs those I have primary interest. In addition, we handled gene IDs differently (gene card vs. EnsemblID) which has a surprisingly big effect.
Oh, I just realized that when I did these analyses, I did them in a completely separate tree and compared the results post-facto. This assumption remains in this document and therefore is unlikely to work properly in the containerized environment I am attempting to create. Given that the primary goal of this section is to show to myself that I compared the two datasets as thoroughly as I could, perhaps I should just disable them for the container and allow the reader to perform the exercise de-novo.
library(tidyverse)
library(ggthemes)
library(reshape2)
library(edgeR)
library(patchwork)
library(vegan)
library(DT)
library(tximport)
library(gplots)
library(FinCal)
library(ggrepel)
library(gt)
library(ggExtra)
library(EnsDb.Hsapiens.v86)
library(stringr)
library(cowplot)
library(ggpubr)
I have a separate tree in which I copied the capsule and data. I performed exactly their steps kallisto quant steps within it and put the output data into the same place within it. I did change the commands slightly because I downloaded the files from SRA and so don’t have them with names like ‘host_CL01’, but instead ‘PRJNA…’. But the samples are in the same order, so I sent the output files to the same final filenames. Here is an example from the first sample:
cd preprocessing
module add kallisto
kallisto index -i Homo_sapiens.GRCh38.cdna.all.Index Homo_sapiens.GRCh38.cdna.all.fa
# Map reads to the indexed reference transcriptome for HOST
# first the healthy subjects (HS)
export LESS = '--buffers 0 -B'
kallisto quant -i Homo_sapiens.GRCh38.cdna.all.Index -o host_HS01 -t 24 -b 60 \
--single -l 250 -s 30 <(less SRR8668755/*-trimmed.fastq.xz) 2>host_HS01.log 1>&2 &
I am going to change the path very slightly in the following block simply because I put the capsule in a separate directory and do not want to copy it here. Otherwise it is unmodified. Also, the function gt::tab_header() annoys the crap out of me.
import <- read_tsv("../scott_2019/capsule-6534016/data/studydesign.txt")
import %>% dplyr::filter(disease == "cutaneous") %>%
dplyr::select(-2) %>% gt() %>%
tab_header(title = md("Clinical metadata from patients with cutaneous leishmaniasis (CL)"),
subtitle = md("`(n=21)`")) %>% cols_align(align = "center", columns = TRUE)
targets.lesion <- import
targets.onlypatients <- targets.lesion[8:28,] # only CL lesions (n=21)
# Making factors that will be used for pairwise comparisons:
# HS vs. CL lesions as a factor:
disease.lesion <- factor(targets.lesion$disease)
# Cure vs. Failure lesions as a factor:
treatment.lesion <- factor(targets.onlypatients$treatment_outcome)
They did use a slightly different annotation set, Ensembl revision 86. Once again I am modifying the paths slightly to reflect where I put the capsule.
# capturing Ensembl transcript IDs (tx) and gene symbols ("gene_name") from
# EnsDb.Hsapiens.v86 annotation package
Tx <- as.data.frame(transcripts(EnsDb.Hsapiens.v86,
columns=c(listColumns(EnsDb.Hsapiens.v86, "tx"),
"gene_name")))
Tx <- dplyr::rename(Tx, target_id = tx_id)
row.names(Tx) <- NULL
Tx <- Tx[,c(6,12)]
# getting file paths for Kallisto outputs
paths.all <- file.path("../scott_2019/capsule-6534016/data/readMapping/human", targets.lesion$sample, "abundance.h5")
paths.patients <- file.path("../scott_2019/capsule-6534016/data/readMapping/human", targets.onlypatients$sample, "abundance.h5")
# importing .h5 Kallisto data and collapsing transcript-level data to genes
Txi.lesion.coding <- tximport(paths.all,
type = "kallisto",
tx2gene = Tx,
txOut = FALSE,
ignoreTxVersion = TRUE,
countsFromAbundance = "lengthScaledTPM")
# importing againg, but this time just the CL patients
Txi.lesion.coding.onlypatients <- tximport(paths.patients,
type = "kallisto",
tx2gene = Tx,
txOut = FALSE,
ignoreTxVersion = TRUE,
countsFromAbundance = "lengthScaledTPM")
The block ‘visualizationDatasets’ follows unchanged. In the next block I will add another plot or perhaps 2
# First make a DGEList from the counts:
Txi.lesion.coding.DGEList <- DGEList(Txi.lesion.coding$counts)
colnames(Txi.lesion.coding.DGEList$counts) <- targets.lesion$sample
colnames(Txi.lesion.coding$counts) <- targets.lesion$sample
Txi.lesion.coding.DGEList.OP <- DGEList(Txi.lesion.coding.onlypatients$counts)
colnames(Txi.lesion.coding.DGEList.OP) <- targets.onlypatients$sample
# Convert to counts per million:
Txi.lesion.coding.DGEList.cpm <- edgeR::cpm(Txi.lesion.coding.DGEList, log = TRUE)
Txi.lesion.coding.DGEList.OP.cpm <- edgeR::cpm(Txi.lesion.coding.DGEList.OP, log = TRUE)
keepers.coding <- rowSums(Txi.lesion.coding.DGEList.cpm>1)>=7
keepers.coding.OP <- rowSums(Txi.lesion.coding.DGEList.OP.cpm>1)>=7
Txi.lesion.coding.DGEList.filtered <- Txi.lesion.coding.DGEList[keepers.coding,]
Txi.lesion.coding.DGEList.OP.filtered <- Txi.lesion.coding.DGEList.OP[keepers.coding.OP,]
# convert back to cpm:
Txi.lesion.coding.DGEList.LogCPM.filtered <- edgeR::cpm(Txi.lesion.coding.DGEList.filtered,
log=TRUE)
Txi.lesion.coding.DGEList.LogCPM.OP.filtered <- edgeR::cpm(Txi.lesion.coding.DGEList.OP.filtered,
log=TRUE)
# Normalizing data:
calcNorm1 <- calcNormFactors(Txi.lesion.coding.DGEList.filtered, method = "TMM")
calcNorm2 <- calcNormFactors(Txi.lesion.coding.DGEList.OP.filtered, method = "TMM")
Txi.lesion.coding.DGEList.LogCPM.filtered.norm <- edgeR::cpm(calcNorm1, log=TRUE)
colnames(Txi.lesion.coding.DGEList.LogCPM.filtered.norm) <- targets.lesion$sample
Txi.lesion.coding.DGEList.OP.LogCPM.filtered.norm <- edgeR::cpm(calcNorm2, log=TRUE)
colnames(Txi.lesion.coding.DGEList.OP.LogCPM.filtered.norm) <- targets.onlypatients$sample
# Raw dataset:
V1 <- as.data.frame(Txi.lesion.coding.DGEList.cpm)
colnames(V1) <- targets.lesion$sample
V1 <- melt(V1)
colnames(V1) <- c("sample","expression")
# Filtered dataset:
V1.1 <- as.data.frame(Txi.lesion.coding.DGEList.LogCPM.filtered)
colnames(V1.1) <- targets.lesion$sample
V1.1 <- melt(V1.1)
colnames(V1.1) <- c("sample","expression")
# Filtered-normalized dataset:
V1.1.1 <- as.data.frame(Txi.lesion.coding.DGEList.LogCPM.filtered.norm)
colnames(V1.1.1) <- targets.lesion$sample
V1.1.1 <- melt(V1.1.1)
colnames(V1.1.1) <- c("sample","expression")
# plotting:
ggplot(V1, aes(x=sample, y=expression, fill=sample)) +
geom_violin(trim = TRUE, show.legend = TRUE) +
stat_summary(fun.y = "median", geom = "point", shape = 95, size = 10, color = "black") +
theme_bw() +
theme(legend.position = "none", axis.title=element_text(size=7),
axis.title.x=element_blank(), axis.text=element_text(size=5),
axis.text.x = element_text(angle = 90, hjust = 1),
plot.title = element_text(size = 7)) +
ggtitle("Raw dataset") +
ggplot(V1.1, aes(x=sample, y=expression, fill=sample)) +
geom_violin(trim = TRUE, show.legend = TRUE) +
stat_summary(fun.y = "median", geom = "point", shape = 95, size = 10, color = "black") +
theme_bw() +
theme(legend.position = "none", axis.title=element_text(size=7),
axis.title.x=element_blank(), axis.text=element_text(size=5),
axis.text.x = element_text(angle = 90, hjust = 1),
plot.title = element_text(size = 7)) +
ggtitle("Filtered dataset") +
ggplot(V1.1.1, aes(x=sample, y=expression, fill=sample)) +
geom_violin(trim = TRUE, show.legend = TRUE) +
stat_summary(fun.y = "median", geom = "point", shape = 95, size = 10, color = "black") +
theme_bw() +
theme(legend.position = "none", axis.title=element_text(size=7),
axis.title.x=element_blank(), axis.text=element_text(size=5),
axis.text.x = element_text(angle = 90, hjust = 1),
plot.title = element_text(size = 7)) +
ggtitle("Filtered and normalized dataset")
The following block in their dataset recreated the matrix without filtering and will use that for differential expression. It is a little hard to follow for me because they subset based on the sample numbers (8 to 28, which if I am not mistaken just drops the healthy samples?).
DataNotFiltered_Norm_OP <- calcNormFactors(Txi.lesion.coding.DGEList[,8:28],
method = "TMM")
DataNotFiltered_Norm_log2CPM_OP <- edgeR::cpm(DataNotFiltered_Norm_OP, log=TRUE)
colnames(DataNotFiltered_Norm_log2CPM_OP) <- targets.onlypatients$sample
CPM_normData_notfiltered_OP <- 2^(DataNotFiltered_Norm_log2CPM_OP)
#uncomment the next line to produce raw data that was uploaded to the Gene Expression Omnibus (GEO) for publication.
#write.table(Txi.lesion.coding$counts, file = "Amorim_GEO_raw.txt", sep = "\t", quote = FALSE)
# Including all the individuals (HS and CL patients) for public domain submission:
DataNotFiltered_Norm <- calcNormFactors(Txi.lesion.coding.DGEList, method = "TMM")
DataNotFiltered_Norm_log2CPM <- edgeR::cpm(DataNotFiltered_Norm, log=TRUE)
colnames(DataNotFiltered_Norm_log2CPM) <- targets.lesion$sample
CPM_normData_notfiltered <- 2^(DataNotFiltered_Norm_log2CPM)
#uncomment the next line to produce the normalized data file that was uploaded to the Gene Expression Omnibus (GEO) for publication.
#write.table(DataNotFiltered_Norm_log2CPM, "Amorim_GEO_normalized.txt", sep = "\t", quote = FALSE)
The following block generated a couple of the figures in the paper and comprise a pretty straightforward PCA. I am going to make a following block containing the same image with the cure/fail visualization using the same method/data.
pca.res <- prcomp(t(Txi.lesion.coding.DGEList.LogCPM.filtered.norm), scale.=F, retx=T)
pc.var <- pca.res$sdev^2
pc.per <- round(pc.var/sum(pc.var)*100, 1)
data.frame <- as.data.frame(pca.res$x)
# Calculate distance between samples by permanova:
allsamples.dist <- vegdist(t(2^Txi.lesion.coding.DGEList.LogCPM.filtered.norm),
method = "bray")
vegan <- adonis2(allsamples.dist~targets.lesion$disease,
data=targets.lesion,
permutations = 999, method="bray")
targets.lesion$disease
ggplot(data.frame, aes(x=PC1, y=PC2, color=factor(targets.lesion$disease))) +
geom_point(size=5, shape=20) +
theme_calc() +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
axis.text.x = element_text(size = 15, vjust = 0.5),
axis.text.y = element_text(size = 15), axis.title = element_text(size = 15),
legend.position="none") +
scale_color_manual(values = c("#073F80","#EB512C")) +
annotate("text", x=-50, y=80, label=paste("Permanova Pr(>F) =",
vegan[1,5]), size=3, fontface="bold") +
xlab(paste("PC1 -",pc.per[1],"%")) +
ylab(paste("PC2 -",pc.per[2],"%")) +
xlim(-200,110)
## Removing 7327 low-count genes (14154 remaining).
## transform_counts: Found 165 values equal to 0, adding 1 to the matrix.
## The result of performing a fast_svd dimension reduction.
## The x-axis is PC1 and the y-axis is PC2
## Colors are defined by cure, failure
## Shapes are defined by female, male.
I am just copy/pasting their code again, but changing the color factor so that cure is purple, failure is red, and na(uninfected) is black.
The following plot should be the first direct comparison point between the two analysis pipelines. Thus, if you look back a few block at my invocation of plot_pca(external_norm), you will see a green/orange plot which is functionally identical if you note:
With those caveats in mind, it is trivial to find the same relationshipes in the samples. E.g. the bottom red/purple individual samples are in the same relative position as my top orange/green pair. the same 4 samples are relative x-axis outliers (my right green, their left purple). The last 6 samples (my orange, their red) are all in the relative orientation.
I think I can further prove the similarity of our inputs via a direct comparison of the datastructures: Txi.lesion.coding.DGEList.LogCPM.filtered.norm (ugh what a name) vs. external_cf. In order to make that comparison, I need to rename my rows to the genecard IDs and the columns.
their_norm_exprs <- Txi.lesion.coding.DGEList.LogCPM.filtered.norm
my_hgnc_ids <- make.names(fData(external_cf)[["hgnc_symbol"]], unique = TRUE)
my_renamed <- set_expt_genenames(external_cf, ids = my_hgnc_ids)
my_norm <- normalize_expt(my_renamed, filter = TRUE, transform = "log2", convert = "cpm")
my_norm_exprs <- as.data.frame(exprs(my_norm))
our_exprs <- merge(their_norm_exprs, my_norm_exprs, by = "row.names")
rownames(our_exprs) <- our_exprs[["Row.names"]]
our_exprs[["Row.names"]] <- NULL
dim(our_exprs)
## I fully expected a correlation heatmap of the combined
## data to show a set of paired samples across the board.
## That is absolutely not true.
correlations <- plot_corheat(our_exprs)
correlations$plot
color_fact <- factor(targets.lesion$treatment_outcome)
levels(color_fact)
## Added by atb to see cure/fail on the same dataset
ggplot(data.frame, aes(x=PC1, y=PC2, color=color_fact)) +
geom_point(size=5, shape=20) +
theme_calc() +
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),
axis.text.x = element_text(size = 15, vjust = 0.5),
axis.text.y = element_text(size = 15), axis.title = element_text(size = 15),
legend.position="none") +
scale_color_manual(values = c("purple", "red","black")) +
annotate("text", x=-50, y=80, label=paste("Permanova Pr(>F) =",
vegan[1,5]), size=3, fontface="bold") +
xlab(paste("PC1 -",pc.per[1],"%")) +
ylab(paste("PC2 -",pc.per[2],"%")) +
xlim(-200,110)
The following is their comparison of healthy tissue vs. CL lesion and Failure vs. Cure. I am going to follow it with my analagous examination using limma. Note, each of the pairs of variables created in the following block is xxx followed by xxx.treat; the former is healthy vs lesion and the latter is the fail vs cure set.
# Model matrices:
# CL lesions vs. HS:
design.lesion <- model.matrix(~0 + disease.lesion)
colnames(design.lesion) <- levels(disease.lesion)
# Failure vs. Cure:
design.lesion.treatment <- model.matrix(~0 + treatment.lesion)
colnames(design.lesion.treatment) <- levels(treatment.lesion)
myDGEList.lesion.coding <- DGEList(calcNorm1$counts)
myDGEList.OP.NotFil <- DGEList(CPM_normData_notfiltered_OP)
# Model mean-variance trend and fit linear model to data.
# Use VOOM function from Limma package to model the mean-variance relationship
normData.lesion.coding <- voom(myDGEList.lesion.coding, design.lesion)
normData.OP.NotFil <- voom(myDGEList.OP.NotFil, design.lesion.treatment)
colnames(normData.lesion.coding) <- targets.lesion$sample
colnames(normData.OP.NotFil) <- targets.onlypatients$sample
# fit a linear model to your data
fit.lesion.coding <- lmFit(normData.lesion.coding, design.lesion)
fit.lesion.coding.treatment <- lmFit(normData.OP.NotFil, design.lesion.treatment)
# contrast matrix
contrast.matrix.lesion <- makeContrasts(CL.vs.CON = cutaneous - control,
levels=design.lesion)
contrast.matrix.lesion.treat <- makeContrasts(failure.vs.cure = failure - cure,
levels=design.lesion.treatment)
# extract the linear model fit
fits.lesion.coding <- contrasts.fit(fit.lesion.coding,
contrast.matrix.lesion)
fits.lesion.coding.treat <- contrasts.fit(fit.lesion.coding.treatment,
contrast.matrix.lesion.treat)
# get bayesian stats for your linear model fit
ebFit.lesion.coding <- eBayes(fits.lesion.coding)
ebFit.lesion.coding.treat <- eBayes(fits.lesion.coding.treat)
# TopTable ----
allHits.lesion.coding <- topTable(ebFit.lesion.coding,
adjust ="BH", coef=1,
number=34935, sort.by="logFC")
allHits.lesion.coding.treat <- topTable(ebFit.lesion.coding.treat,
adjust ="BH", coef=1,
number=34776, sort.by="logFC")
myTopHits <- rownames_to_column(allHits.lesion.coding, "geneID")
myTopHits.treat <- rownames_to_column(allHits.lesion.coding.treat, "geneID")
# mutate the format of numeric values:
myTopHits <- mutate(myTopHits, log10Pval = round(-log10(adj.P.Val),2),
adj.P.Val = round(adj.P.Val, 2),
B = round(B, 2),
AveExpr = round(AveExpr, 2),
t = round(t, 2),
logFC = round(logFC, 2),
geneID = geneID)
myTopHits.treat <- mutate(myTopHits.treat, log10Pval = round(-log10(adj.P.Val),2),
adj.P.Val = round(adj.P.Val, 2),
B = round(B, 2),
AveExpr = round(AveExpr, 2),
t = round(t, 2),
logFC = round(logFC, 2),
geneID = geneID)
#save(myTopHits, file = "myTopHits")
#save(myTopHits.treat, file = "myTopHits.treat")
limma_cf <- limma_pairwise(my_renamed, model_batch = FALSE)
my_table <- limma_cf[["all_tables"]][["failure_vs_cure"]]
their_table <- myTopHits.treat
dim(my_table)
dim(myTopHits.treat)
our_table <- merge(my_table, myTopHits.treat, by.x = "row.names", by.y = "geneID")
dim(our_table)
comparison <- plot_linear_scatter(our_table[, c("logFC.x", "logFC.y")])
comparison$scatter
comparison$correlation
comparison$lm_model
Ok, so there is a constituitive difference in our results, and it is significant. What does that mean for the set of genes observed?
Let us look at the top/bottom 100 genes of these two datasets and see if they have any similarities.
Note to self, set up s4 dispatch on compare_de_tables!
compared <- compare_de_tables(only_tmrc3_table, external_table, first_table = 1, second_table = 1)
compared$scatter
##
## Pearson's product-moment correlation
##
## data: df[[xcol]] and df[[ycol]]
## t = 14, df = 13240, p-value <2e-16
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.1033 0.1369
## sample estimates:
## cor
## 0.1201