I. Preliminaries

Loading libraries

library("tidyverse")
library("tibble")
library("msigdbr")
library("ggplot2")
library("TCGAbiolinks")
library("RNAseqQC")
library("DESeq2")
library("ensembldb")
library("purrr")
library("magrittr")
library("vsn")
library("matrixStats")
library("dplyr")
library("grex")
library("survminer")
library("survival")

II. Downloading the TCGA gene expression data

Create a function for downloading TCGA gene expression data.

For more detailed documentation, refer to 2. Differential Gene Expression Analysis - TCGA.Rmd.

query_and_filter_samples <- function(project) {
  query_tumor <- GDCquery(
    project = project,
    data.category = "Transcriptome Profiling",
    data.type = "Gene Expression Quantification",
    experimental.strategy = "RNA-Seq",
    workflow.type = "STAR - Counts",
    access = "open",
    sample.type = "Primary Tumor"
  )
  tumor <- getResults(query_tumor)

  query_normal <- GDCquery(
    project = project,
    data.category = "Transcriptome Profiling",
    data.type = "Gene Expression Quantification",
    experimental.strategy = "RNA-Seq",
    workflow.type = "STAR - Counts",
    access = "open",
    sample.type = "Solid Tissue Normal"
  )
  normal <- getResults(query_normal)

  submitter_ids <- inner_join(tumor, normal, by = "cases.submitter_id") %>%
    dplyr::select(cases.submitter_id)
  tumor <- tumor %>%
    dplyr::filter(cases.submitter_id %in% submitter_ids$cases.submitter_id)
  normal <- normal %>%
    dplyr::filter(cases.submitter_id %in% submitter_ids$cases.submitter_id)

  samples <- rbind(tumor, normal)
  unique(samples$sample_type)

  query_project <- GDCquery(
    project = project,
    data.category = "Transcriptome Profiling",
    data.type = "Gene Expression Quantification",
    experimental.strategy = "RNA-Seq",
    workflow.type = "STAR - Counts",
    access = "open",
    sample.type = c("Solid Tissue Normal", "Primary Tumor"),
    barcode = as.list(samples$sample.submitter_id)
  )

  # If this is your first time running this notebook (i.e., you have not yet downloaded the results of the query in the previous block),
  # uncomment the line below

  # GDCdownload(query_project)

  return(list(samples = samples, query_project = query_project))
}

Download the TCGA gene expression data for colorectal cancer (TCGA-COAD).

projects <- c("TCGA-COAD")

with_results_projects <- c()

samples <- list()
project_data <- list()

for (project in projects) {
  result <- tryCatch(
    {
      result <- query_and_filter_samples(project)
      samples[[project]] <- result$samples
      project_data[[project]] <- result$query_project

      with_results_projects <- c(with_results_projects, project)
    },
    error = function(e) {

    }
  )
}

Running the code block above should generate and populate a directory named GDCdata.

III. Data preprocessing

Construct the RNA-seq count matrix for each cancer type.

tcga_data <- list()
tcga_matrix <- list()

projects <- with_results_projects
for (project in projects) {
  tcga_data[[project]] <- GDCprepare(project_data[[project]], summarizedExperiment = TRUE)
}
for (project in projects) {
  count_matrix <- assay(tcga_data[[project]], "unstranded")

  # Remove duplicate entries
  count_matrix_df <- data.frame(count_matrix)
  count_matrix_df <- count_matrix_df[!duplicated(count_matrix_df), ]
  count_matrix <- data.matrix(count_matrix_df)
  rownames(count_matrix) <- cleanid(rownames(count_matrix))
  count_matrix <- count_matrix[!(duplicated(rownames(count_matrix)) | duplicated(rownames(count_matrix), fromLast = TRUE)), ]

  tcga_matrix[[project]] <- count_matrix
}

Format the samples table so that it can be fed as input to DESeq2.

for (project in projects) {
  rownames(samples[[project]]) <- samples[[project]]$cases
  samples[[project]] <- samples[[project]] %>%
    dplyr::select(case = "cases.submitter_id", type = "sample_type")
  samples[[project]]$type <- str_replace(samples[[project]]$type, "Solid Tissue Normal", "normal")
  samples[[project]]$type <- str_replace(samples[[project]]$type, "Primary Tumor", "tumor")
}

DESeq2 requires the row names of samples should be identical to the column names of count_matrix.

for (project in projects) {
  colnames(tcga_matrix[[project]]) <- gsub(x = colnames(tcga_matrix[[project]]), pattern = "\\.", replacement = "-")
  tcga_matrix[[project]] <- tcga_matrix[[project]][, rownames(samples[[project]])]

  # Sanity check
  print(all(colnames(tcga_matrix[[project]]) == rownames(samples[[project]])))
}

IV. Differential gene expression analysis

For more detailed documentation on obtaining the gene set, refer to 7. Differential Gene Expression Analysis - TCGA - Pan-cancer - Unique Genes.Rmd.

RCDdb <- "temp/unique_genes/necroptosis_ferroptosis_pyroptosis/"

Write utility functions for filtering the gene sets, performing differential gene expression analysis, plotting the results, and performing variance-stabilizing transformation.

filter_gene_set_and_perform_dgea <- function(genes) {
  tcga_rcd <- list()

  for (project in projects) {
    rownames(genes) <- genes$gene_id
    tcga_rcd[[project]] <- tcga_matrix[[project]][rownames(tcga_matrix[[project]]) %in% genes$gene_id, ]
    tcga_rcd[[project]] <- tcga_rcd[[project]][, rownames(samples[[project]])]
  }

  dds_rcd <- list()
  res_rcd <- list()

  for (project in projects) {
    print(project)
    print("=============")
    dds <- DESeqDataSetFromMatrix(
      countData = tcga_rcd[[project]],
      colData = samples[[project]],
      design = ~type
    )
    dds <- filter_genes(dds, min_count = 10)
    dds$type <- relevel(dds$type, ref = "normal")
    dds_rcd[[project]] <- DESeq(dds)
    res_rcd[[project]] <- results(dds_rcd[[project]])
  }

  deseq.bbl.data <- list()

  for (project in projects) {
    deseq.results <- res_rcd[[project]]
    deseq.bbl.data[[project]] <- data.frame(
      row.names = rownames(deseq.results),
      baseMean = deseq.results$baseMean,
      log2FoldChange = deseq.results$log2FoldChange,
      lfcSE = deseq.results$lfcSE,
      stat = deseq.results$stat,
      pvalue = deseq.results$pvalue,
      padj = deseq.results$padj,
      cancer_type = project,
      gene_symbol = genes[rownames(deseq.results), "gene"]
    )
  }

  deseq.bbl.data.combined <- bind_rows(deseq.bbl.data)
  deseq.bbl.data.combined <- dplyr::filter(deseq.bbl.data.combined, abs(log2FoldChange) >= 1.5 & padj < 0.05)

  return(deseq.bbl.data.combined)
}
plot_dgea <- function(deseq.bbl.data.combined) {
  sizes <- c("<10^-15" = 4, "10^-10" = 3, "10^-5" = 2, "0.05" = 1)

  deseq.bbl.data.combined <- deseq.bbl.data.combined %>%
    mutate(fdr_category = cut(padj,
      breaks = c(-Inf, 1e-15, 1e-10, 1e-5, 0.05),
      labels = c("<10^-15", "10^-10", "10^-5", "0.05"),
      right = FALSE
    ))

  top_genes <- deseq.bbl.data.combined %>%
    group_by(cancer_type) %>%
    mutate(rank = rank(-abs(log2FoldChange))) %>%
    dplyr::filter(rank <= 10) %>%
    ungroup()

  ggplot(top_genes, aes(y = cancer_type, x = gene_symbol, size = fdr_category, fill = log2FoldChange)) +
    geom_point(alpha = 0.5, shape = 21, color = "black") +
    scale_size_manual(values = sizes) +
    scale_fill_gradient2(low = "blue", mid = "white", high = "red", limits = c(min(deseq.bbl.data.combined$log2FoldChange), max(deseq.bbl.data.combined$log2FoldChange))) +
    theme_minimal() +
    theme(
      axis.text.x = element_text(size = 9, angle = 90, hjust = 1)
    ) +
    theme(legend.position = "bottom") +
    theme(legend.position = "bottom") +
    labs(size = "Adjusted p-value", fill = "log2 FC", y = "Cancer type", x = "Gene")
}
perform_vsd <- function(genes) {
  tcga_rcd <- list()

  for (project in projects) {
    rownames(genes) <- genes$gene_id
    tcga_rcd[[project]] <- tcga_matrix[[project]][rownames(tcga_matrix[[project]]) %in% genes$gene_id, ]
    tcga_rcd[[project]] <- tcga_rcd[[project]][, rownames(samples[[project]])]
  }

  vsd_rcd <- list()

  for (project in projects) {
    print(project)
    print("=============")
    dds <- DESeqDataSetFromMatrix(
      countData = tcga_rcd[[project]],
      colData = samples[[project]],
      design = ~type
    )
    dds <- filter_genes(dds, min_count = 10)

    # Perform variance stabilization
    dds <- estimateSizeFactors(dds)
    nsub <- sum(rowMeans(counts(dds, normalized = TRUE)) > 10)
    vsd <- vst(dds, nsub = nsub)
    vsd_rcd[[project]] <- assay(vsd)
  }

  return(vsd_rcd)
}

Necroptosis

Fetch the gene set of interest.

genes <- read.csv(paste0(RCDdb, "Necroptosis.csv"))
print(genes)
genes$gene_id <- cleanid(genes$gene_id)
genes <- distinct(genes, gene_id, .keep_all = TRUE)
genes <- subset(genes, gene_id != "")
genes

Filter the genes to include only those in the gene set of interest, and then perform differential gene expression analysis.

deseq.bbl.data.combined <- filter_gene_set_and_perform_dgea(genes)
[1] "TCGA-COAD"
[1] "============="
Warning: some variables in design formula are characters, converting to factorsestimating size factors
estimating dispersions
gene-wise dispersion estimates
mean-dispersion relationship
final dispersion estimates
fitting model and testing
-- replacing outliers and refitting for 1 genes
-- DESeq argument 'minReplicatesForReplace' = 7 
-- original counts are preserved in counts(dds)
estimating dispersions
fitting model and testing
deseq.bbl.data.combined

Plot the results.

plot_dgea(deseq.bbl.data.combined)

Perform variance-stabilizing transformation for further downstream analysis (i.e., for survival analysis).

vsd <- perform_vsd(genes)
[1] "TCGA-COAD"
[1] "============="

V. Downloading the clinical data

Download clinical data from TCGA, and perform some preprocessing: - The deceased column should be FALSE if the patient is alive and TRUE otherwise - The overall_survival column should reflect the follow-up time if the patient is alive and the days to death otherwise

download_clinical_data <- function(project) {
  clinical_data <- GDCquery_clinic(project)
  clinical_data$deceased <- ifelse(clinical_data$vital_status == "Alive", FALSE, TRUE)
  clinical_data$overall_survival <- ifelse(clinical_data$vital_status == "Alive",
    clinical_data$days_to_last_follow_up,
    clinical_data$days_to_death
  )

  return(clinical_data)
}
tcga_clinical <- list()
for (project in projects) {
  tcga_clinical[[project]] <- download_clinical_data(project)
}

VI. Performing survival analysis

Write utility functions for performing survival analysis.

construct_gene_df <- function(gene_of_interest, project) {
  gene_df <- vsd[[project]] %>%
    as.data.frame() %>%
    rownames_to_column(var = "gene_id") %>%
    gather(key = "case_id", value = "counts", -gene_id) %>%
    left_join(., genes, by = "gene_id") %>%
    dplyr::filter(gene == gene_of_interest) %>%
    dplyr::filter(case_id %in% rownames(samples[[project]] %>% dplyr::filter(type == "tumor")))

  q1 <- quantile(gene_df$counts, probs = 0.25)
  q3 <- quantile(gene_df$counts, probs = 0.75)
  gene_df$strata <- ifelse(gene_df$counts >= q3, "HIGH", ifelse(gene_df$counts <= q1, "LOW", "MIDDLE"))
  gene_df <- gene_df %>% dplyr::filter(strata %in% c("LOW", "HIGH"))
  gene_df$case_id <- paste0(sapply(strsplit(as.character(gene_df$case_id), "-"), `[`, 1), '-',
                          sapply(strsplit(as.character(gene_df$case_id), "-"), `[`, 2), '-', 
                          sapply(strsplit(as.character(gene_df$case_id), "-"), `[`, 3))
  gene_df <- merge(gene_df, tcga_clinical[[project]], by.x = "case_id", by.y = "submitter_id")
  
  return(gene_df)
}
compute_surival_fit <- function(gene_df) {
  return (survfit(Surv(overall_survival, deceased) ~ strata, data = gene_df))
}
compute_cox <- function(gene_df) {
  return (coxph(Surv(overall_survival, deceased) ~ strata, data=gene_df))
}
plot_survival <- function(fit) {
  return(ggsurvplot(fit,
    data = gene_df,
    pval = T,
    risk.table = T,
    risk.table.height = 0.3
  ))
}
compute_survival_diff <- function(gene_df) {
  return(survdiff(Surv(overall_survival, deceased) ~ strata, data = gene_df))
}

Perform survival analysis by testing for the difference in the Kaplan-Meier curves using the G-rho family of Harrington and Fleming tests: https://rdrr.io/cran/survival/man/survdiff.html

MLKL is the primary executor of necroptosis.

significant_projects <- c()
significant_genes <- c()

ctr <- 1
for (project in projects) {
  for (gene in c("MLKL", genes$gene)) {
    cat(project, gene, "\n\n")
    tryCatch (
      {
        gene_df <- construct_gene_df(gene, project)
      },
      error = function(e) {
      }
    )

    if (nrow(gene_df) > 0) {
      fit <- compute_surival_fit(gene_df)
      tryCatch (
        {
          survival <- compute_survival_diff(gene_df)
          cox <- compute_cox(gene_df)
          print(ctr)
          ctr <- ctr + 1
          print(survival)
          cat("\n")
          print(cox)
          print(plot_survival(fit))
          if (pchisq(survival$chisq, length(survival$n)-1, lower.tail = FALSE) < 0.05) {
            significant_projects <- c(significant_projects, project)
            significant_genes <- c(significant_genes, gene)
          }
        },
        error = function(e) {
        }
      )
      
    }
    
    cat("\n\n============================\n\n")
  }
}
TCGA-COAD MLKL 

[1] 1
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        5     3.46     0.682      1.69
strata=LOW  12        2     3.54     0.668      1.69

 Chisq= 1.7  on 1 degrees of freedom, p= 0.2 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -1.0980    0.3335   0.8831 -1.243 0.214

Likelihood ratio test=1.66  on 1 df, p=0.1972
n= 24, number of events= 7 


============================

TCGA-COAD RBCK1 

[1] 2
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     2.56    0.0753     0.158
strata=LOW  12        2     2.44    0.0790     0.158

 Chisq= 0.2  on 1 degrees of freedom, p= 0.7 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.3653    0.6940   0.9231 -0.396 0.692

Likelihood ratio test=0.16  on 1 df, p=0.6897
n= 24, number of events= 5 


============================

TCGA-COAD JAK2 

[1] 3
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2      2.8     0.230     0.665
strata=LOW  12        3      2.2     0.294     0.665

 Chisq= 0.7  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z    p
strataLOW 0.9168    2.5013   1.1622 0.789 0.43

Likelihood ratio test=0.7  on 1 df, p=0.4015
n= 24, number of events= 5 


============================

TCGA-COAD ZBP1 

[1] 4
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        5     5.63    0.0703     0.198
strata=LOW  12        4     3.37    0.1174     0.198

 Chisq= 0.2  on 1 degrees of freedom, p= 0.7 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.3068    1.3591   0.6916 0.444 0.657

Likelihood ratio test=0.19  on 1 df, p=0.6592
n= 24, number of events= 9 


============================

TCGA-COAD RNF31 

[1] 5
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.23    0.0246    0.0567
strata=LOW  12        3     2.77    0.0199    0.0567

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.2397    1.2709   1.0088 0.238 0.812

Likelihood ratio test=0.06  on 1 df, p=0.8124
n= 24, number of events= 5 


============================

TCGA-COAD IFNB1 

[1] 6
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.23    0.0246    0.0567
strata=LOW  12        3     2.77    0.0199    0.0567

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.2397    1.2709   1.0088 0.238 0.812

Likelihood ratio test=0.06  on 1 df, p=0.8124
n= 24, number of events= 5 


============================

TCGA-COAD TRAF5 

[1] 7
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     3.31    0.0295    0.0572
strata=LOW  12        5     4.69    0.0209    0.0572

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.1843    1.2023   0.7712 0.239 0.811

Likelihood ratio test=0.06  on 1 df, p=0.8105
n= 24, number of events= 8 


============================

TCGA-COAD BIRC2 

[1] 8
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     1.68    0.0614      0.14
strata=LOW  12        3     3.32    0.0310      0.14

 Chisq= 0.1  on 1 degrees of freedom, p= 0.7 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z    p
strataLOW -0.4567    0.6333   1.2290 -0.372 0.71

Likelihood ratio test=0.14  on 1 df, p=0.7042
n= 24, number of events= 5 


============================

TCGA-COAD TRAF2 

[1] 9
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4     4.05   0.00073   0.00301
strata=LOW  12        2     1.95   0.00152   0.00301

 Chisq= 0  on 1 degrees of freedom, p= 1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW 0.05532   1.05688  1.00841 0.055 0.956

Likelihood ratio test=0  on 1 df, p=0.9563
n= 24, number of events= 6 


============================

TCGA-COAD BCL2 

[1] 10
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        5     3.51     0.633      1.27
strata=LOW  12        2     3.49     0.637      1.27

 Chisq= 1.3  on 1 degrees of freedom, p= 0.3 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW -0.9122    0.4016   0.8371 -1.09 0.276

Likelihood ratio test=1.31  on 1 df, p=0.2516
n= 24, number of events= 7 


============================

TCGA-COAD STAT4 

[1] 11
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     2.47    0.1134     0.224
strata=LOW  12        3     3.53    0.0794     0.224

 Chisq= 0.2  on 1 degrees of freedom, p= 0.6 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW -0.4292    0.6510   0.9131 -0.47 0.638

Likelihood ratio test=0.23  on 1 df, p=0.6347
n= 24, number of events= 6 


============================

TCGA-COAD BIRC3 

[1] 12
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4     4.97     0.190     0.565
strata=LOW  12        4     3.03     0.312     0.565

 Chisq= 0.6  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.5737    1.7748   0.7730 0.742 0.458

Likelihood ratio test=0.56  on 1 df, p=0.4552
n= 24, number of events= 8 


============================

TCGA-COAD STAT1 

[1] 13
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     4.08     0.285     0.776
strata=LOW  12        4     2.92     0.397     0.776

 Chisq= 0.8  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.7463    2.1091   0.8668 0.861 0.389

Likelihood ratio test=0.79  on 1 df, p=0.3746
n= 24, number of events= 7 


============================

TCGA-COAD STAT2 

[1] 14
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        5     4.94  0.000797   0.00242
strata=LOW  12        3     3.06  0.001285   0.00242

 Chisq= 0  on 1 degrees of freedom, p= 1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)      z     p
strataLOW -0.03864   0.96210  0.78546 -0.049 0.961

Likelihood ratio test=0  on 1 df, p=0.9607
n= 24, number of events= 8 


============================

TCGA-COAD TNFSF10 

[1] 15
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2      2.2    0.0182    0.0412
strata=LOW  12        2      1.8    0.0222    0.0412

 Chisq= 0  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.2047    1.2271   1.0101 0.203 0.839

Likelihood ratio test=0.04  on 1 df, p=0.8395
n= 24, number of events= 4 


============================

TCGA-COAD TYK2 

[1] 16
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     2.32     0.202     0.635
strata=LOW  12        1     1.68     0.278     0.635

 Chisq= 0.6  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.9410    0.3902   1.2251 -0.768 0.442

Likelihood ratio test=0.63  on 1 df, p=0.4262
n= 24, number of events= 4 


============================

TCGA-COAD PPIA 

[1] 17
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     3.27    0.0219    0.0483
strata=LOW  12        4     3.73    0.0192    0.0483

 Chisq= 0  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.1794    1.1965   0.8177 0.219 0.826

Likelihood ratio test=0.05  on 1 df, p=0.8265
n= 24, number of events= 7 


============================

TCGA-COAD TNFRSF1A 

[1] 18
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4     2.31     1.239      2.31
strata=LOW  12        2     3.69     0.775      2.31

 Chisq= 2.3  on 1 degrees of freedom, p= 0.1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -1.5455    0.2132   1.1195 -1.381 0.167

Likelihood ratio test=2.43  on 1 df, p=0.1193
n= 24, number of events= 6 


============================

TCGA-COAD CAPN2 

[1] 19
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.99     0.329     0.871
strata=LOW  12        3     2.01     0.491     0.871

 Chisq= 0.9  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)    z     p
strataLOW 0.8613    2.3663   0.9462 0.91 0.363

Likelihood ratio test=0.85  on 1 df, p=0.3556
n= 24, number of events= 5 


============================

TCGA-COAD FAS 

[1] 20
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3      3.8     0.169     0.326
strata=LOW  12        5      4.2     0.153     0.326

 Chisq= 0.3  on 1 degrees of freedom, p= 0.6 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.4163    1.5164   0.7343 0.567 0.571

Likelihood ratio test=0.33  on 1 df, p=0.5655
n= 24, number of events= 8 


============================

TCGA-COAD PGAM5 

[1] 21
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4     4.07   0.00108    0.0027
strata=LOW  12        3     2.93   0.00150    0.0027

 Chisq= 0  on 1 degrees of freedom, p= 1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW 0.04065   1.04149  0.78216 0.052 0.959

Likelihood ratio test=0  on 1 df, p=0.9586
n= 24, number of events= 7 


============================

TCGA-COAD MLKL 

[1] 22
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        5     3.46     0.682      1.69
strata=LOW  12        2     3.54     0.668      1.69

 Chisq= 1.7  on 1 degrees of freedom, p= 0.2 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -1.0980    0.3335   0.8831 -1.243 0.214

Likelihood ratio test=1.66  on 1 df, p=0.1972
n= 24, number of events= 7 


============================

TCGA-COAD FADD 

[1] 23
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        1    0.971  0.000891   0.00173
strata=LOW  12        2    2.029  0.000426   0.00173

 Chisq= 0  on 1 degrees of freedom, p= 1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)      z     p
strataLOW -0.05889   0.94281  1.41483 -0.042 0.967

Likelihood ratio test=0  on 1 df, p=0.9668
n= 24, number of events= 3 


============================

TCGA-COAD TRPM7 

[1] 24
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        1     2.73      1.09      2.53
strata=LOW  12        4     2.27      1.31      2.53

 Chisq= 2.5  on 1 degrees of freedom, p= 0.1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

           coef exp(coef) se(coef)     z    p
strataLOW 1.627     5.090    1.131 1.439 0.15

Likelihood ratio test=2.62  on 1 df, p=0.1054
n= 24, number of events= 5 


============================

TCGA-COAD FASLG 

[1] 25
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        5     4.86   0.00429    0.0127
strata=LOW  12        3     3.14   0.00662    0.0127

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)      z    p
strataLOW -0.08847   0.91533  0.78465 -0.113 0.91

Likelihood ratio test=0.01  on 1 df, p=0.9101
n= 24, number of events= 8 


============================

TCGA-COAD TNFRSF10B 

[1] 26
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     1.74    0.0399     0.063
strata=LOW  12        3     3.26    0.0212     0.063

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.2325    0.7925   0.9281 -0.251 0.802

Likelihood ratio test=0.06  on 1 df, p=0.8037
n= 24, number of events= 5 


============================

TCGA-COAD VPS4A 

[1] 27
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        1     2.46     0.865      1.72
strata=LOW  12        5     3.54     0.600      1.72

 Chisq= 1.7  on 1 degrees of freedom, p= 0.2 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

           coef exp(coef) se(coef)     z     p
strataLOW 1.365     3.917    1.122 1.217 0.224

Likelihood ratio test=1.85  on 1 df, p=0.1741
n= 24, number of events= 6 


============================

TCGA-COAD TNFRSF10A 

[1] 28
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4     2.53     0.848      1.54
strata=LOW  12        3     4.47     0.481      1.54

 Chisq= 1.5  on 1 degrees of freedom, p= 0.2 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -1.0651    0.3447   0.8931 -1.193 0.233

Likelihood ratio test=1.53  on 1 df, p=0.2156
n= 24, number of events= 7 


============================

TCGA-COAD GLUD1 

[1] 29
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.31    0.0428    0.0836
strata=LOW  12        4     3.69    0.0269    0.0836

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.2688    1.3084   0.9323 0.288 0.773

Likelihood ratio test=0.08  on 1 df, p=0.7717
n= 24, number of events= 6 


============================

TCGA-COAD EIF2AK2 

[1] 30
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        0     2.17      2.17      4.75
strata=LOW  12        4     1.83      2.56      4.75

 Chisq= 4.8  on 1 degrees of freedom, p= 0.03 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

               coef exp(coef)  se(coef)     z     p
strataLOW 2.140e+01 1.959e+09 2.025e+04 0.001 0.999

Likelihood ratio test=6.27  on 1 df, p=0.0123
n= 24, number of events= 4 


============================

TCGA-COAD CYLD 

[1] 31
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.67     0.169     0.363
strata=LOW  12        4     3.33     0.135     0.363

 Chisq= 0.4  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.5438    1.7226   0.9138 0.595 0.552

Likelihood ratio test=0.36  on 1 df, p=0.5469
n= 24, number of events= 6 


============================

TCGA-COAD SPATA2 

[1] 32
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     1.42     0.242     0.459
strata=LOW  12        1     1.58     0.216     0.459

 Chisq= 0.5  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z    p
strataLOW -0.8082    0.4457   1.2259 -0.659 0.51

Likelihood ratio test=0.46  on 1 df, p=0.4959
n= 24, number of events= 3 


============================

TCGA-COAD DNM1L 

[1] 33
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        1     1.88     0.411     0.832
strata=LOW  12        3     2.12     0.364     0.832

 Chisq= 0.8  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

           coef exp(coef) se(coef)     z    p
strataLOW 1.033     2.811    1.178 0.877 0.38

Likelihood ratio test=0.87  on 1 df, p=0.3509
n= 24, number of events= 4 


============================

TCGA-COAD CFLAR 

[1] 34
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        1     1.48    0.1584      0.32
strata=LOW  12        3     2.52    0.0935      0.32

 Chisq= 0.3  on 1 degrees of freedom, p= 0.6 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.6849    1.9836   1.2344 0.555 0.579

Likelihood ratio test=0.33  on 1 df, p=0.5681
n= 24, number of events= 4 


============================

TCGA-COAD TICAM1 

[1] 35
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4     4.03  0.000172  0.000693
strata=LOW  12        2     1.97  0.000351  0.000693

 Chisq= 0  on 1 degrees of freedom, p= 1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW 0.02633   1.02668  1.00026 0.026 0.979

Likelihood ratio test=0  on 1 df, p=0.979
n= 24, number of events= 6 


============================

TCGA-COAD HSP90AA1 

[1] 36
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3      3.8     0.170     0.673
strata=LOW  12        3      2.2     0.294     0.673

 Chisq= 0.7  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.9297    2.5339   1.1708 0.794 0.427

Likelihood ratio test=0.71  on 1 df, p=0.3984
n= 24, number of events= 6 


============================

TCGA-COAD IL33 

[1] 37
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3      3.5    0.0720     0.149
strata=LOW  12        5      4.5    0.0561     0.149

 Chisq= 0.1  on 1 degrees of freedom, p= 0.7 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 0.2975    1.3465   0.7745 0.384 0.701

Likelihood ratio test=0.15  on 1 df, p=0.6995
n= 24, number of events= 8 


============================

TCGA-COAD IRF9 

[1] 38
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        0    0.444     0.444       0.8
strata=LOW  12        2    1.556     0.127       0.8

 Chisq= 0.8  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

               coef exp(coef)  se(coef)     z p
strataLOW 2.100e+01 1.317e+09 4.057e+04 0.001 1

Likelihood ratio test=1.18  on 1 df, p=0.2783
n= 24, number of events= 2 


============================

TCGA-COAD SHARPIN 

[1] 39
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     2.87   0.00606    0.0175
strata=LOW  12        2     2.13   0.00816    0.0175

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.1323    0.8761   1.0010 -0.132 0.895

Likelihood ratio test=0.02  on 1 df, p=0.8949
n= 24, number of events= 5 


============================

TCGA-COAD IFNAR1 

[1] 40
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.66     0.165     0.611
strata=LOW  12        2     1.34     0.329     0.611

 Chisq= 0.6  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z    p
strataLOW 0.9385    2.5560   1.2414 0.756 0.45

Likelihood ratio test=0.61  on 1 df, p=0.4341
n= 24, number of events= 4 


============================

TCGA-COAD XIAP 

[1] 41
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     4.32     0.403      1.58
strata=LOW  12        3     1.68     1.036      1.58

 Chisq= 1.6  on 1 degrees of freedom, p= 0.2 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z     p
strataLOW 1.0994    3.0023   0.9186 1.197 0.231

Likelihood ratio test=1.47  on 1 df, p=0.2257
n= 24, number of events= 6 


============================

TCGA-COAD VDAC3 

[1] 42
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     4.83     0.694      2.25
strata=LOW  12        5     3.17     1.059      2.25

 Chisq= 2.2  on 1 degrees of freedom, p= 0.1 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

           coef exp(coef) se(coef)     z     p
strataLOW 1.499     4.479    1.096 1.368 0.171

Likelihood ratio test=2.48  on 1 df, p=0.1149
n= 24, number of events= 8 


============================

TCGA-COAD CAMK2A 

[1] 43
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.65     0.161     0.344
strata=LOW  12        4     3.35     0.128     0.344

 Chisq= 0.3  on 1 degrees of freedom, p= 0.6 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)    z     p
strataLOW 0.5298    1.6986   0.9135 0.58 0.562

Likelihood ratio test=0.34  on 1 df, p=0.5573
n= 24, number of events= 6 


============================

TCGA-COAD VDAC1 

[1] 44
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        1        3      1.33         4
strata=LOW  12        4        2      2.00         4

 Chisq= 4  on 1 degrees of freedom, p= 0.05 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

               coef exp(coef)  se(coef)     z     p
strataLOW 2.120e+01 1.615e+09 2.010e+04 0.001 0.999

Likelihood ratio test=5.55  on 1 df, p=0.01853
n= 24, number of events= 5 


============================

TCGA-COAD RIPK3 

[1] 45
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     3.09     0.383     0.793
strata=LOW  12        5     3.91     0.302     0.793

 Chisq= 0.8  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)    z     p
strataLOW 0.7554    2.1284   0.8681 0.87 0.384

Likelihood ratio test=0.81  on 1 df, p=0.3694
n= 24, number of events= 7 


============================

TCGA-COAD CAPN1 

[1] 46
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     3.29    0.0259    0.0581
strata=LOW  12        3     2.71    0.0315    0.0581

 Chisq= 0.1  on 1 degrees of freedom, p= 0.8 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)     z    p
strataLOW 0.1979    1.2188   0.8221 0.241 0.81

Likelihood ratio test=0.06  on 1 df, p=0.8099
n= 24, number of events= 6 


============================

TCGA-COAD USP21 

[1] 47
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4     3.18     0.211       0.4
strata=LOW  12        3     3.82     0.176       0.4

 Chisq= 0.4  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -0.4853    0.6155   0.7744 -0.627 0.531

Likelihood ratio test=0.4  on 1 df, p=0.5285
n= 24, number of events= 7 


============================

TCGA-COAD AIFM1 

[1] 48
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        3     3.52    0.0765     0.187
strata=LOW  12        4     3.48    0.0773     0.187

 Chisq= 0.2  on 1 degrees of freedom, p= 0.7 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

            coef exp(coef) se(coef)    z     p
strataLOW 0.3524    1.4225   0.8201 0.43 0.667

Likelihood ratio test=0.18  on 1 df, p=0.6682
n= 24, number of events= 7 


============================

TCGA-COAD TRADD 

[1] 49
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4     2.45     0.979      1.96
strata=LOW  12        1     2.55     0.941      1.96

 Chisq= 2  on 1 degrees of freedom, p= 0.2 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z     p
strataLOW -1.4467    0.2354   1.1235 -1.288 0.198

Likelihood ratio test=2.08  on 1 df, p=0.1492
n= 24, number of events= 5 


============================

TCGA-COAD OPTN 

[1] 50
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     1.43     0.231     0.445
strata=LOW  12        2     2.57     0.128     0.445

 Chisq= 0.4  on 1 degrees of freedom, p= 0.5 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW -0.8009    0.4489   1.2316 -0.65 0.515

Likelihood ratio test=0.45  on 1 df, p=0.502
n= 24, number of events= 4 


============================

TCGA-COAD PPID 

[1] 51
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4      3.2     0.201     0.666
strata=LOW  12        1      1.8     0.357     0.666

 Chisq= 0.7  on 1 degrees of freedom, p= 0.4 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)      z    p
strataLOW -0.9194    0.3988   1.1646 -0.789 0.43

Likelihood ratio test=0.7  on 1 df, p=0.4012
n= 24, number of events= 5 


============================

TCGA-COAD RIPK1 

[1] 52
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        0     1.63     1.630      2.82
strata=LOW  12        5     3.37     0.789      2.82

 Chisq= 2.8  on 1 degrees of freedom, p= 0.09 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

               coef exp(coef)  se(coef)     z     p
strataLOW 2.094e+01 1.239e+09 2.079e+04 0.001 0.999

Likelihood ratio test=4.26  on 1 df, p=0.0391
n= 24, number of events= 5 


============================

TCGA-COAD TLR3 

[1] 53
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     2.08   0.00342   0.00608
strata=LOW  12        3     2.92   0.00244   0.00608

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

             coef exp(coef) se(coef)     z     p
strataLOW 0.07243   1.07512  0.92922 0.078 0.938

Likelihood ratio test=0.01  on 1 df, p=0.9377
n= 24, number of events= 5 


============================

TCGA-COAD FAF1 

[1] 54
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        4     3.91   0.00221   0.00514
strata=LOW  12        4     4.09   0.00211   0.00514

 Chisq= 0  on 1 degrees of freedom, p= 0.9 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

              coef exp(coef) se(coef)      z     p
strataLOW -0.05552   0.94599  0.77455 -0.072 0.943

Likelihood ratio test=0.01  on 1 df, p=0.9428
n= 24, number of events= 8 


============================

TCGA-COAD JAK1 

[1] 55
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        2     4.21      1.16      3.27
strata=LOW  12        5     2.79      1.74      3.27

 Chisq= 3.3  on 1 degrees of freedom, p= 0.07 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

           coef exp(coef) se(coef)     z    p
strataLOW 1.754     5.780    1.097 1.599 0.11

Likelihood ratio test=3.51  on 1 df, p=0.06118
n= 24, number of events= 7 


============================

Display the results only for genes where a significant difference in survival has been reported.

significant_genes
[1] "EIF2AK2" "VDAC1"  
num_significant_genes <- length(significant_genes)

if (num_significant_genes > 0) {
  for (i in 1 : num_significant_genes) {
    project <- significant_projects[[i]]
    gene <- significant_genes[[i]]
    
    cat(project, gene, "\n\n")
    gene_df <- construct_gene_df(gene, project)
    
    fit <- compute_surival_fit(gene_df)
    survival <- compute_survival_diff(gene_df)
    cox <- compute_cox(gene_df)
    print(survival)
    cat("\n")
    print(cox)
    print(plot_survival(fit))
    
    cat("\n\n============================\n\n")
  } 
}
TCGA-COAD EIF2AK2 
Warning: Loglik converged before variable  1 ; coefficient may be infinite. 
Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        0     2.17      2.17      4.75
strata=LOW  12        4     1.83      2.56      4.75

 Chisq= 4.8  on 1 degrees of freedom, p= 0.03 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

               coef exp(coef)  se(coef)     z     p
strataLOW 2.140e+01 1.959e+09 2.025e+04 0.001 0.999

Likelihood ratio test=6.27  on 1 df, p=0.0123
n= 24, number of events= 4 


============================

TCGA-COAD VDAC1 

Call:
survdiff(formula = Surv(overall_survival, deceased) ~ strata, 
    data = gene_df)

             N Observed Expected (O-E)^2/E (O-E)^2/V
strata=HIGH 12        1        3      1.33         4
strata=LOW  12        4        2      2.00         4

 Chisq= 4  on 1 degrees of freedom, p= 0.05 

Call:
coxph(formula = Surv(overall_survival, deceased) ~ strata, data = gene_df)

               coef exp(coef)  se(coef)     z     p
strataLOW 2.120e+01 1.615e+09 2.010e+04 0.001 0.999

Likelihood ratio test=5.55  on 1 df, p=0.01853
n= 24, number of events= 5 


============================


  1. De La Salle University, Manila, Philippines, ↩︎

  2. De La Salle University, Manila, Philippines, ↩︎

LS0tDQp0aXRsZTogIlN1cnZpdmFsIEFuYWx5c2lzIg0Kc3VidGl0bGU6ICJDb2xvcmVjdGFsIENhbmNlciB8IE5lY3JvcHRvc2lzIHwgVW5pcXVlIEdlbmVzIHBlciBSQ0QgVHlwZSB8IEdlbmUgRXhwcmVzc2lvbiBvZiBUdW1vciBTYW1wbGVzIg0KYXV0aG9yOiANCiAgLSBNYXJrIEVkd2FyZCBNLiBH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pbWFyeSBleGVjdXRvciBvZiBuZWNyb3B0b3Npcy4NCg0KYGBge3J9DQpzaWduaWZpY2FudF9wcm9qZWN0cyA8LSBjKCkNCnNpZ25pZmljYW50X2dlbmVzIDwtIGMoKQ0KDQpjdHIgPC0gMQ0KZm9yIChwcm9qZWN0IGluIHByb2plY3RzKSB7DQogIGZvciAoZ2VuZSBpbiBjKCJNTEtMIiwgZ2VuZXMkZ2VuZSkpIHsNCiAgICBjYXQocHJvamVjdCwgZ2VuZSwgIlxuXG4iKQ0KICAgIGNhdChwcm9qZWN0LCBnZW5lLCAiXG5cbiIpDQogICAgZXJyb3IgPC0gdHJ5Q2F0Y2ggKA0KICAgICAgew0KICAgICAgICBnZW5lX2RmIDwtIGNvbnN0cnVjdF9nZW5lX2RmKGdlbmUsIHByb2plY3QpDQogICAgICB9LA0KICAgICAgZXJyb3IgPSBmdW5jdGlvbihlKSB7DQogICAgICAgIGNhdCgiXG5cbj09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuIikNCiAgICAgICAgZQ0KICAgICAgfQ0KICAgICkNCiAgICANCiAgICBpZihpbmhlcml0cyhlcnJvciwgImVycm9yIikpIG5leHQNCg0KICAgIGlmIChucm93KGdlbmVfZGYpID4gMCkgew0KICAgICAgZml0IDwtIGNvbXB1dGVfc3VyaXZhbF9maXQoZ2VuZV9kZikNCiAgICAgIHRyeUNhdGNoICgNCiAgICAgICAgew0KICAgICAgICAgIHN1cnZpdmFsIDwtIGNvbXB1dGVfc3Vydml2YWxfZGlmZihnZW5lX2RmKQ0KICAgICAgICAgIGNveCA8LSBjb21wdXRlX2NveChnZW5lX2RmKQ0KICAgICAgICAgIHByaW50KGN0cikNCiAgICAgICAgICBjdHIgPC0gY3RyICsgMQ0KICAgICAgICAgIHByaW50KHN1cnZpdmFsKQ0KICAgICAgICAgIGNhdCgiXG4iKQ0KICAgICAgICAgIHByaW50KGNveCkNCiAgICAgICAgICBwcmludChwbG90X3N1cnZpdmFsKGZpdCkpDQogIC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