[BioC] simLL method in GOstats

Robert Gentleman rgentlem at fhcrc.org
Sun May 1 00:28:00 CEST 2005


Hi Maria,
   You have not told us about the operating system you are using, nor  
about versions of packages.
I have found the source of the problem. For
  simLL("10554","10486")
the problem is that the gene with GeneID 10486 has no MF GO  
annotations. And hence we cannot
compute a GO graph for MF (I hope you know that is what you are doing  
for comparison). I have
modified the code so that NA is returned in this case. The fix (you can  
try to fix the R code on your computer) is below or I can provide a new  
version of the package - but only for Unix; for windows you will need  
to wait until Monday or Tuesday.

   Best wishes,
    Robert

ps the fix - in R, for example - but you must do it every time you load  
the library
go:
   fix(simLL)
then in your favorite editor add the lines with +'s shown below

    g1 = GOGraph(ll1GO, dataenv)
     g2 = GOGraph(ll2GO, dataenv)
+    if( length(g1) == 0 || length(g2) == 0 )
+      return(NA)
     sm = match.arg(measure, c("LP", "UI"))

On Apr 30, 2005, at 10:49 AM, Maria Persico wrote:

> Dear Seth, dear Robert,
>
> thanks for your answers.
>
> I have still problems because I couldn't reinitialize goanal(sorry,  
> I'm a
> beginner):
> indeed....
>> goanal
> [1] "Error: invalid subscript type\n"
> attr(,"class")
> [1] "try-error"
>
>> str(goanal)
> Class 'try-error'  chr "Error: invalid subscript type
> "
>
>
> this is the code that doesn't work:
>> distances<-numeric(100)
>>  for (i in 1:100){
> +   goanal <-
> try(simLL(as.character(hmapr$V1[i]),as.character(hmapr$V2[i]),"MF"))
> +   if (inherits("gonal", "try-error")) {
> +       goanal <- as.list()
> +       #goanal[["sim"]] <- NA
> +    #print(goanal$sim)
> +   distances[i]<-NA#goanal$sim
> +
> +   }
> +  else{
> +   
> goanal<- 
> simLL(as.character(hmapr$V1[i]),as.character(hmapr$V2[i]),"MF")
> +   print(goanal$sim)
> +   distances[i]<-goanal$sim
> +
> +   }
> +
> +  }
>
>
> Some example where the function fails:
> (I'm working with human genes)
> The last pair for which I have a distance is simLL("2935","8894")
> The pair where simLL fails:
>> simLL("10554","10486")
> Error: invalid subscript type
>
> another examples of failures:
>> simLL("81608","55339")
> Error: invalid subscript type
>> simLL("50999","10972")
> Error: invalid subscript type
>> simLL("50999","10972")
> Error: invalid subscript type
>
> Thanks,
>
> Maria
>
> Maria Persico
> MINT database, Cesareni Group
> Universita' di Tor Vergata, via della Ricerca Scientifica
> 00133 Roma, Italy
> Tel: +39 0672594315
> FAX: +39 0672594766
> e-mail: maria at cbm.bio.uniroma2.it
>
>
> On Sat, 30 Apr 2005, Robert Gentleman wrote:
>
>> Hi,
>>    As Seth said you can use try (or some of the other features of the
>> exception handling system).
>> Would it be possible to supply me with an example where it fails - it
>> might be better to fix the code so that it handles these cases more
>> gracefully,
>>
>> thanks,
>>    Robert
>>
>> On Apr 30, 2005, at 4:14 AM, Maria Persico wrote:
>>
>>> Dear bioconductor mailing list,
>>>
>>> I have some pairs of genes and I would like to measure their
>>> "distances"
>>> on the GO molecular function graph.
>>>
>>> So I wrote this lines of code:
>>>
>>> distances<-numeric(100)
>>> for (i in 1:100){
>>>
>>> goanal<-
>>> simLL(as.character(hmapr$V1[i]),as.character(hmapr$V2[i]),"MF")
>>>  print(goanal$sim)
>>>  distances[i]<-goanal$sim
>>>  rm(goanal)
>>>  }
>>>
>>> where hmapr$V1 and hmapr$V2 are the vectors in which I have the locus
>>> link
>>> identifiers of my genes.
>>>
>>> When I run the script, in a few time I obtain
>>> "Error: invalid subscript type".
>>>
>>> I noticed that there are problems with the pair of llID where the
>>> script
>>> stops.
>>>
>>>  Is there a way to bypass the problem, to jump to the next pair
>>> of genes after putting NaN in the distances vector?
>>>
>>> Thanks a lot,
>>>
>>> Maria
>>>
>>>
>>>
>>>
>>>
>>> Maria Persico
>>> MINT database, Cesareni Group
>>> Universita' di Tor Vergata, via della Ricerca Scientifica
>>> 00133 Roma, Italy
>>> Tel: +39 0672594315
>>> FAX: +39 0672594766
>>> e-mail: maria at cbm.bio.uniroma2.it
>>>
>>> _______________________________________________
>>> Bioconductor mailing list
>>> Bioconductor at stat.math.ethz.ch
>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>
>>>
>> +--------------------------------------------------------------------- 
>> --
>> ----------------+
>> | Robert Gentleman              phone: (206) 667-7700
>>           |
>> | Head, Program in Computational Biology   fax:  (206) 667-1319   |
>> | Division of Public Health Sciences       office: M2-B865
>>        |
>> | Fred Hutchinson Cancer Research Center
>>           |
>> | email: rgentlem at fhcrc.org
>>                           |
>> +--------------------------------------------------------------------- 
>> --
>> ----------------+
>>
>>
>
>
+----------------------------------------------------------------------- 
----------------+
| Robert Gentleman              phone: (206) 667-7700                    
          |
| Head, Program in Computational Biology   fax:  (206) 667-1319   |
| Division of Public Health Sciences       office: M2-B865               
       |
| Fred Hutchinson Cancer Research Center                                 
          |
| email: rgentlem at fhcrc.org                                              
                          |
+----------------------------------------------------------------------- 
----------------+



More information about the Bioconductor mailing list