2.4 Primary queries
There is a series of initial questions which make some sense to me, but these do not necessarily match the set of questions which are most pressing. I am hoping to pull both of these sets of queries in one.
Before extracting these groups of queries, let us invoke the all_pairwise() function and get all of the likely contrasts along with one or more extras that might prove useful (the ‘extra’ argument).
The structure of these blocks will all basically be identical:
- Perform a set of pairwise contrasts of all the conditions against each other. Optionally use sva.
- Given that result, dump it in its entirety to an xlsx file in the analyses/ directory.
- Given those combined tables, extract from them the set deemed ‘significant’ by whatever criteria we want to try. (Usually |lfc| >= 1.0, adjusted p <= 0.05; but potentially also expression >= x and sometimes a set of less stringent values (|lfc| >= 0.6))
- Given one or more gene sets deemed ‘significant’ pass them to gProfiler2 and see what pops out.
2.4.1 Combined U937 and Macrophages: Compare drug effects
When we have the u937 cells in the same dataset as the macrophages, that provides an interesting opportunity to see if we can observe drug-dependant effects which are shared across both cell types.
Note to self: given the changes to hpgltools I may need to specify the statistical model string when I am using svaseq for some/many/all of these comparisons.
## Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'pData': object 'all_human' not found
## Error: object 'drug_de' not found
drug_table <- combine_de_tables(
drug_de, keepers = tmrc2_drug_keepers,
excel = glue("analyses/macrophage_de/de_tables/macrophage_drug_comparison-v{ver}.xlsx"))## Error in h(simpleError(msg, call)): error in evaluating the argument 'table' in selecting a method for function '%in%': object 'drug_de' not found
## Error: object 'drug_table' not found
#combined_to_tsv(drug_table, celltype = "all")
drug_sig <- extract_significant_genes(
drug_table,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_drug_sig-v{ver}.xlsx"))## Error: object 'drug_table' not found
## Error: object 'drug_sig' not found
drug_highsig <- extract_significant_genes(
drug_table, min_mean_exprs = high_expression, exprs_column = high_expression_column,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_drug_highsig-v{ver}.xlsx"))## Error: object 'drug_table' not found
## Error: object 'drug_highsig' not found
drug_lesssig <- extract_significant_genes(
drug_table, lfc = 0.6,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_drug_lesssig-v{ver}.xlsx"))## Error: object 'drug_table' not found
## Error: object 'drug_lesssig' not found
2.4.1.1 gProfiler2 results of the significant drug genes
## Error: object 'drug_sig' not found
## Error: object 'all_drug_gp' not found
## Error: object 'all_drug_gp' not found
## Error: object 'drug_lesssig' not found
## Error: object 'all_drug_lesssig' not found
2.4.2 Combined U937 and Macrophages: compare cell types
There are a couple of ways one might want to directly compare the two cell types.
- Given that the variance between the two celltypes is so huge, just compare all samples.
- One might want to compare them with the interaction effects of drug/zymodeme.
## Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'pData': object 'all_human_types' not found
## Error: object 'type_de' not found
type_table <- combine_de_tables(
type_de, keepers = tmrc2_type_keepers,
excel = glue("analyses/macrophage_de/de_tables/macrophage_type_comparison-v{ver}.xlsx"))## Error in h(simpleError(msg, call)): error in evaluating the argument 'table' in selecting a method for function '%in%': object 'type_de' not found
## Error: object 'type_table' not found
#combined_to_tsv(type_table, celltype = "all")
type_sig <- extract_significant_genes(
type_table,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_type_sig-v{ver}.xlsx"))## Error: object 'type_table' not found
## Error: object 'type_sig' not found
type_highsig <- extract_significant_genes(
type_table, min_mean_exprs = high_expression, exprs_column = high_expression_column,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_type_highsig-v{ver}.xlsx"))## Error: object 'type_table' not found
## Error: object 'type_highsig' not found
type_lesssig <- extract_significant_genes(
type_table, lfc = 0.6,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_type_lesssig-v{ver}.xlsx"))## Error: object 'type_table' not found
## Error: object 'type_sig' not found
2.4.2.1 Combined factors of interest: celltype+zymodeme
Given the above explicit comparison of all samples comprising the two cell types, now let us look at the drug treatment+zymodeme status with all samples, macrophages and U937.
type_zymo_de <- all_pairwise(type_zymo, filter = TRUE, model_svs = "svaseq",
do_noiseq = FALSE,
extra_contrasts = type_zymo_extra)## Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'pData': object 'type_zymo' not found
## Error: object 'type_zymo_de' not found
type_zymo_table <- combine_de_tables(
type_zymo_de, keepers = tmrc2_typezymo_keepers,
excel = glue("analyses/macrophage_de/de_tables/macrophage_type_zymo_comparison-v{ver}.xlsx"))## Error in h(simpleError(msg, call)): error in evaluating the argument 'table' in selecting a method for function '%in%': object 'type_zymo_de' not found
#combined_to_tsv(type_zymo_table, celltype = "all")
type_zymo_sig <- extract_significant_genes(
type_zymo_table,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_type_zymo_sig-v{ver}.xlsx"))## Error: object 'type_zymo_table' not found
## Error: object 'type_zymo_sig' not found
type_zymo_highsig <- extract_significant_genes(
type_zymo_table, min_mean_exprs = high_expression, exprs_column = high_expression_column,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_type_zymo_highsig-v{ver}.xlsx"))## Error: object 'type_zymo_table' not found
type_zymo_lesssig <- extract_significant_genes(
type_zymo_table, lfc = 0.6,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_type_zymo_lesssig-v{ver}.xlsx"))## Error: object 'type_zymo_table' not found
## Error: object 'type_zymo_lesssig' not found
2.4.2.2 Combined factors of interest: celltype+drug
The ‘type_drug’ datastructure is the same as above, but the condition is created from the concatenation of the cell type and drug treatment.
type_drug_de <- all_pairwise(type_drug, filter = TRUE, model_svs = "svaseq",
model_fstring = "~ 0 + condition")## Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'pData': object 'type_drug' not found
## Error: object 'type_drug_de' not found
type_drug_table <- combine_de_tables(
type_drug_de, keepers = tmrc2_typedrug_keepers,
excel = glue("analyses/macrophage_de/de_tables/macrophage_type_drug_comparison-v{ver}.xlsx"))## Error in h(simpleError(msg, call)): error in evaluating the argument 'table' in selecting a method for function '%in%': object 'type_drug_de' not found
## Error: object 'type_drug_table' not found
#combined_to_tsv(type_drug_table, celltype = "all")
type_drug_sig <- extract_significant_genes(
type_drug_table,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_type_drug_sig-v{ver}.xlsx"))## Error: object 'type_drug_table' not found
## Error: object 'type_drug_sig' not found
type_drug_highsig <- extract_significant_genes(
type_drug_table, min_mean_exprs = high_expression, exprs_column = high_expression_column,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_type_drug_highsig-v{ver}.xlsx"))## Error: object 'type_drug_table' not found
## Error: object 'type_drug_highsig' not found
type_drug_lesssig <- extract_significant_genes(
type_drug_table, lfc = 0.6,
excel = glue("analyses/macrophage_de/sig_tables/macrophage_type_drug_lesssig-v{ver}.xlsx"))## Error: object 'type_drug_table' not found
## Error: object 'type_drug_lesssig' not found