Skip to content

Instantly share code, notes, and snippets.

@lwaldron
Created December 19, 2018 20:14
Show Gist options
  • Save lwaldron/9d77ce85030b9d1ec24474c1b2c0a99b to your computer and use it in GitHub Desktop.
Save lwaldron/9d77ce85030b9d1ec24474c1b2c0a99b to your computer and use it in GitHub Desktop.
GMQL use case (from Masseroli et al 2018, Bioinformatics bty688)
# Masseroli et al 2018, https://doi.org/10.1093/bioinformatics/bty688
# "In TCGA data of BRCA patients, find the DNA somatic mutations
# within the first 2000 bp outside of the genes that are both
# expressed with FPKM > 3 and have at least a methylation in the same patient
# biospecimen, and extract these mutations of the top 5% patients
# with the highest number of such mutations."
library(curatedTCGAData)
system.time(mae <- curatedTCGAData("ACC", c("Mutation", "RNASeq2GeneNorm", "Methylation"), dry.run = FALSE))
library(TCGAutils)
system.time(mae <- symbolsToRanges(mae))
rangedMethylation <- function(SE){
SEranged <- SE[!is.na(rowData(SE)$Chromosome), ]
rd <- rowData(SEranged)
rowRanges(SEranged) <- GRanges(rd$Chromosome, rd$Genomic_Coordinate)
genome(SEranged)
return(SEranged)
}
system.time(mae[[1]] <- rangedMethylation(mae[[1]]))
system.time(mae <- intersectColumns(mae))
@LiNk-NY
Copy link

LiNk-NY commented Jan 15, 2019

Hi Levi, @lwaldron
I've added the rowRanges<- replace method for this function to work in Bioc-devel.
-MR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment