Last active
September 16, 2024 20:03
-
-
Save AmyOlex/996230ad0b853a1ec631f008b6b1e520 to your computer and use it in GitHub Desktop.
Revisions
-
AmyOlex revised this gist
Feb 2, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,7 @@ tpm <- tpm[,as.character(annot$preferred.sample.name)] stopifnot(all(as.character(annot$preferred.sample.name) == names(tpm))) ## transpose the gene expression matrix ## Rows are now samples, and columns are genes with the Official Gene Symbol as the column name tpm_t <- t(tpm) colnames(tpm_t) <- gene_annot$Gene.Symbol -
AmyOlex renamed this gist
Jan 25, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
AmyOlex renamed this gist
Jan 25, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
AmyOlex created this gist
Jan 25, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ ## Amy Olex ## PAM50 Classification of PDX samples. library(genefu) setwd("~/my/working/folder") ## import expression data tpm <- read.delim("Gene_Expression_Data_TPMvalues.txt") ## import sample annotations annot <- read.delim("Sample_Annotations.txt") gene_annot <- tpm[,c("gene_id","symbol")] names(gene_annot) <- c("Ensemble.ID","Gene.Symbol") ## Reorder so gene matrix and annotations are in same order tpm_filtered <- tpm[,as.character(annot_filtered$preferred.sample.name)] stopifnot(all(as.character(annot_filtered$preferred.sample.name) == names(tpm_filtered))) tpm <- tpm[,as.character(annot$preferred.sample.name)] stopifnot(all(as.character(annot$preferred.sample.name) == names(tpm))) ## transpose the gene expression matrix tpm_t <- t(tpm) colnames(tpm_t) <- gene_annot$Gene.Symbol ## run PAM50 classification pam50_predictions_all <- molecular.subtyping(sbt.model = "pam50", data = tpm_t, annot = gene_annot, do.mapping = FALSE) pam50_predictions_all$subtype.crisp pam50_predictions_all$subtype.proba