Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2018
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 1.37 KB | None | 0 0
  1. library( tidyverse )
  2. library( survival )
  3. library( openxlsx )
  4.  
  5. ## Load the data and ABSOLUTE estimates (syn3582761)
  6. X <- read.xlsx("TCGA_MEASUREMENTS.xlsx")
  7. P <- read.xlsx("Purity_Ploidy_All_Samples_4-17-15.xlsx") %>%
  8.     rename( ID = individual_id ) %>% mutate_at( "purity", as.numeric )
  9. XP <- inner_join( X, P, by="ID" )
  10.  
  11. ## Compute correlations to establish internal consistency
  12. with( X, cor.test( CAF_SCORE, percent_stromal_cells ) )    # cor = 0.20, p-value < 0.001
  13. with( XP, cor.test( CAF_SCORE, purity ) )                  # cor = -0.54, p-value < 0.001
  14. with( XP, cor.test( percent_stromal_cells, purity ) )      # cor = -0.12, p-value = 0.007
  15.  
  16. ## Compute correlations with VGG19 predictions
  17. with( X, cor.test( CAF_SCORE, STR ) )                      # cor = 0.26, p-value < 0.001
  18. with( XP, cor.test( TUM, purity ) )                        # cor = 0.069, p-value = 0.14
  19.  
  20. ## Compute an unbiased estimate of non-tumor components
  21. X2 <- X %>% mutate( DeepScore = ADI + DEB + LYM + MUS + STR,
  22.                    OS_event = vital_status, days_to_event = days_to_event/365.25 )
  23.  
  24. ## Determine if there's any relationship between the unbiased score and survival
  25. ## Compare it to a similar analysis for the stromal component STR only
  26. coxph( Surv(days_to_event, OS_event) ~ DeepScore, data = X2 )  # p = 0.01
  27. coxph( Surv(days_to_event, OS_event) ~ STR, data = X2 )        # p = 0.85
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement