[BioC] simLL method in GOstats

Maria Persico maria at cbm.bio.uniroma2.it
Sat Apr 30 19:49:05 CEST 2005


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
>                           |
> +-----------------------------------------------------------------------
> ----------------+
>
>



More information about the Bioconductor mailing list