Code Monkey home page Code Monkey logo

Comments (1)

zhilongjia avatar zhilongjia commented on July 24, 2024

getGEO cannot use local GPL file directly when GPL is true so far due to a bug in function parseGSEMatrix. In this function, the parameter "destdir=tempdir()" should be "destdir=destdir", which should also be added into other related function parseGEO.

I suggest another parameter should be add. Two files will be reivsed (getGEO.R and parseGEO.R ) with a new parameter GPLfn.
It will look like

getGEO(filename="../GSE31747_series_matrix.txt.gz", GPLfn="../GPL8300.soft")

##################################################################
$git diff getGEO.R
diff --git a/R/getGEO.R b/R/getGEO.R
index 06bde57..912b23c 100644
--- a/R/getGEO.R
+++ b/R/getGEO.R
@@ -3,7 +3,8 @@ getGEO <- function(GEO=NULL,
destdir=tempdir(),
GSElimits=NULL,GSEMatrix=TRUE,
AnnotGPL=FALSE,

  •               getGPL=TRUE) {
    
  •               getGPL=TRUE,
    
  •               GPLfn=NULL) {
    
    con <- NULL
    if(!is.null(GSElimits)) {
    if(length(GSElimits)!=2) {
    @@ -21,6 +22,6 @@ getGEO <- function(GEO=NULL,
    }
    filename <- getGEOfile(GEO,destdir=destdir,AnnotGPL=AnnotGPL)
    }
  • ret <- parseGEO(filename,GSElimits)
  • ret <- parseGEO(filename,GSElimits, GPLfn)
    return(ret)
    }
    ##################################################################

$git diff parseGEO.R

diff --git a/R/parseGEO.R b/R/parseGEO.R
index 813c996..c6b499f 100644
--- a/R/parseGEO.R
+++ b/R/parseGEO.R
@@ -1,4 +1,4 @@
-parseGEO <- function(fname,GSElimits) {
+parseGEO <- function(fname,GSElimits,GPLfn=NULL) {
con <- fileOpen(fname)
first.entity <- findFirstEntity(con)
close(con)
@@ -14,7 +14,7 @@ parseGEO <- function(fname,GSElimits) {
parseGPL(fname)
},
"0" = {

  •                  parseGSEMatrix(fname)$eset
    
  •                  parseGSEMatrix(fname, GPLfn=GPLfn)$eset
               },
               )
    

    return(ret)
    @@ -368,7 +368,7 @@ getAndParseGSEMatrices <- function(GEO,destdir,AnnotGPL,getGPL=TRUE) {

    Function to parse a single GSEMatrix

    file into an ExpressionSet

    -parseGSEMatrix <- function(fname,AnnotGPL=FALSE,destdir=tempdir(),getGPL=TRUE) {
    +parseGSEMatrix <- function(fname,AnnotGPL=FALSE,destdir=tempdir(),getGPL=TRUE, GPLfn=NULL) {
    dat <- readLines(fname)

    get the number of !Series and !Sample lines

    nseries <- sum(grepl("^!Series_", dat))
    @@ -406,7 +406,12 @@ parseGSEMatrix <- function(fname,AnnotGPL=FALSE,destdir=tempdir(),getGPL=TRUE) {

    if getGPL is FALSE, skip this and featureData is then a data.frame with no columns

    fd = new("AnnotatedDataFrame",data=data.frame(row.names=rownames(datamat)))
    if(getGPL) {

  •    gpl <- getGEO(GPL,AnnotGPL=AnnotGPL,destdir=destdir)
    
  •    if (!is.null(GPLfn)) {
    
  •        gpl <- getGEO(filename=GPLfn, AnnotGPL=FALSE,destdir=destdir)
    
  •    } else {
    
  •        gpl <- getGEO(GEO=GPL,AnnotGPL=AnnotGPL,destdir=destdir)
    
  •    }
    
  •  vmd <- Columns(gpl)
     dat <- Table(gpl)
     ## GEO uses "TAG" instead of "ID" for SAGE GSE/GPL entries, but it is apparently
    

    ##################################################################

from geoquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.