Progenetix API and R

With the ability to access the status matrix directly, one easily can import the data into an R data frame:

pgframe <- read.table(url(""), header=T, sep="\t", na="NA")

For the segment file, the same applies with "output=segments":

segtable <- read.table(url(""), header=T, sep="\t", na="NA")

For the construction of the queries, please refer to query parameters output options: text/data

pgDataLoader To facilitate R integration of Progenetix/arrayMap data, we have developed a simple access function "pgDataLoader" which can currently be accessed trough GitHub:

R Example - survival

One can use this example to search for MYCN gain related survival bias in an ICD entity (here "9500/3" - change acc. to your interest). Other modifications are possible. Please be install pgDataLoader first ...

rm(list = ls())
icdm <-c("9500/3")
gene <- "MYCN"
survData <- pgDataLoader(pg.server="", api_out="samples", icdm_m=icdm, db="arraymap", genes_m=paste(gene, "$", sep=""))
geneColumn <- paste('GENE_', gene, sep="")
genePos   <- grep(geneColumn, colnames(survData), perl="T")
plot(survfit(Surv(survData$FOLLOWUP, survData$DEATH) ~ 1,, main=paste("Overall survival"), xlab="months", ylab="survival", cex=1.2)  
gainNo <- nrow(subset(survData, survData[genePos] == 1))   
plot(survfit(Surv(survData$FOLLOWUP, survData$DEATH) ~ survData[genePos] == 1,, col=c("black","blue"), main=paste("Survival and gene ", gene, " (ICD-O ", icdm, ")", sep=""), xlab="months", ylab="survival", cex=1.2)  
sdf <- survdiff(Surv(survData$FOLLOWUP, survData$DEATH) ~ survData[genePos] == 1) 
pcsq <- round(pchisq(sdf$chisq, df=1, lower=FALSE), digits=5)
legend("bottomright", c("no gain", paste(gene, ' gain (', gainNo, '/', nrow(survData), ')', sep="")), fill=c("black","blue"), inset=c(0.02,0.02), bg="azure1", cex=0.8)  
legend("bottomleft", c(paste("p:", pcsq)), inset=c(0.02,0.02), bty="n", cex=1)
Topic revision: r1 - 10 Dec 2015, MichaelBaudis
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Progenetixwiki? Send feedback