Nianhua:

Sorry to bother you again! I tried to fix my local AnnBuilder source code as
you said. But the problem is the code is not as you said
I pasted them underneath: how can I get it worked.

This is your suggestion:

Now the problem has been solved. You can either get the up-to-date
AnnBuilder (v 1.11.6) from svn or wait still Saturday noon to download
it using biocLite or from website. You can also modify your local source
AnnBuilder/R/ABPkgBuilder.R if you are in a hurry:
===================================================================
--- ABPkgBuilder.R      (v1.11.5 or before)
+++ ABPkgBuilder.R      (v1.11.6)

# Map GO ids to probe ids that are directly associated with the GO ids
 mapGO2Probe <- function(eg, baseMapType){
-     if(baseMapType == "ll"){
-            parser(eg) <- file.path(.path.package("AnnBuilder"),
-                                    "scripts", "GO2ProbeParser4LL")
-        }else{
-            parser(eg) <- file.path(.path.package("AnnBuilder"),
+        parser(eg) <- file.path(.path.package("AnnBuilder"),
                                    "scripts", "GO2ProbeParser")
-        }
        options(show.error.messages = FALSE)
        go2Probe <- try(parseData(eg, eg@go, ncol = 3))  I changed to
ncol=3, but it didn't work??
        options(show.error.messages = TRUE)
====================================================================


This is the code I srcatch from AnnBuilder 1.11.5 ABPkgBuilder.R

# Map GO ids to probe ids that are directly associated with the GO ids
mapGO2Probe <- function(eg, baseMapType){
     if(baseMapType == "ll"){
            parser(eg) <- file.path(.path.package("AnnBuilder"),
                                    "scripts", "GO2ProbeParser4LL")
        }else{
            parser(eg) <- file.path(.path.package("AnnBuilder"),
                                    "scripts", "GO2ProbeParser")
        }
        options(show.error.messages = FALSE)
        go2Probe <- try(parseData(eg, eg@go, ncol = 3))
        options(show.error.messages = TRUE)
        if(inherits(go2Probe, "try-error")){
            stop(paste("Failed to parse LocusLink data because of:\n\n",
                       go2Probe))
        }
        if(is.null(go2Probe)){
            warning("No mappings between GO and probe ids found")
        }else if(nrow(go2Probe) == 1){
            go2Probe <- matrix(go2Probe[1:2], nrow = 1)
            colnames(go2Probe) <- c("GO", "GO2PROBE")
        }else{
            colnames(go2Probe) <- c("GO", "GO2PROBE", "COUNTS")
            # Drop column counts for now. Will get ride of the extra column
            go2Probe <- go2Probe[, c("GO", "GO2PROBE")]
            # Remove "" for GO id resulting from mapping probe ids to NA GO
id
            go2Probe <- go2Probe[go2Probe[,1] != "", ]
        }
     return(go2Probe)
}


On 7/27/06, Nianhua Li <nli@fhcrc.org> wrote:
>
> Hi, Shiliang,
>
> You were right that AnnBuilder did have a bug. Thanks for the report!
>
> The bug is related to Weijun's question:
>
> http://thread.gmane.org/gmane.science.biology.informatics.conductor/9227/focus=9232
> When baseType is "ll", the baseFile can't be parsed correctly because
> some parsers assume Entrez Gene is at the 3rd column of the base file.
> Thanks for John's patch, AnnBuilder just quietly converts the base file
> into three columns when baseType is "ll". So, weijun's problem got
> solved. Unfortunately, the parser used for "go2probe" mapping assumes a
> two-column setting for baseType "ll", therefore can't work correctly
> with the patch.
>
> Now the problem has been solved. You can either get the up-to-date
> AnnBuilder (v 1.11.6) from svn or wait still Saturday noon to download
> it using biocLite or from website. You can also modify your local source
> AnnBuilder/R/ABPkgBuilder.R if you are in a hurry:
> ===================================================================
> --- ABPkgBuilder.R      (v1.11.5 or before)
> +++ ABPkgBuilder.R      (v1.11.6)
>
> # Map GO ids to probe ids that are directly associated with the GO ids
> mapGO2Probe <- function(eg, baseMapType){
> -     if(baseMapType == "ll"){
> -            parser(eg) <- file.path(.path.package("AnnBuilder"),
> -                                    "scripts", "GO2ProbeParser4LL")
> -        }else{
> -            parser(eg) <- file.path(.path.package("AnnBuilder"),
> +        parser(eg) <- file.path(.path.package("AnnBuilder"),
>                                     "scripts", "GO2ProbeParser")
> -        }
>         options(show.error.messages = FALSE)
>         go2Probe <- try(parseData(eg, eg@go, ncol = 3))
>         options(show.error.messages = TRUE)
> ====================================================================
>
> Also the probe number mismatch is because your base file has duplicated
> probeset identifiers.
>
> help it works this time :)
>
> nianhua
>
>

	[[alternative HTML version deleted]]

