Skip to content

Commit

Permalink
Update compute_gsva.R gene_id column
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellosalvi authored Jul 27, 2023
1 parent 644254b commit 3fca8c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/compute_gsva.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mapped_df <- data.frame(
"entrez_id" = mapIds(
# Replace with annotation package for the organism relevant to your data
org.Hs.eg.db,
keys = counts$ensembl_id,
keys = counts$gene_id,
# Replace with the type of gene identifiers in your data
keytype = "ENSEMBL",
# Replace with the type of gene identifiers you would like to map to
Expand All @@ -50,7 +50,7 @@ mapped_df <- data.frame(
# Make an `Ensembl` column to store the row names
tibble::rownames_to_column("Ensembl") %>%
# Now let's join the rest of the expression data
dplyr::inner_join(counts, by = c("Ensembl" = "ensembl_id"))
dplyr::inner_join(counts, by = c("Ensembl" = "gene_id"))

gene_means <- rowMeans(mapped_df %>% dplyr::select(-Ensembl, -entrez_id))

Expand Down

0 comments on commit 3fca8c7

Please sign in to comment.