[BioC] Incremental operator. Annotate Package

Adaikalavan Ramasamy ramasamy at cancer.org.uk
Thu Aug 19 12:29:55 CEST 2004


See comments below. 

On Wed, 2004-08-18 at 22:06, S Peri wrote:
> Hi group, 
>  I am trying to get the LocusID numbers from my affy
> expression matrix.  
> 
> I instantiated rownames function to get an object with
> all the probe IDs.
> 
> > where.affy.at <- rownames(gliexp)
> 
> Now I wanted to get another object with the LocusIDs
> in it like the following.  However, I get the
> following error. How come i = i +1 is not considered
> as incrementation here. I know there is some trouble
> in defining. I come from Python background so I am
> stuck. Could any one help me please. 
> 
> 
> >for (i in where.affy.at){
          ^^^^^^^^^^^^^^^^

Here i is the _name_ of the each id which is a character mode.
For example i = "100_g_at".

> +   gene.locusid.affy <- get(i,env= hgu95av2LOCUSID)
> + i = i + 1

Here you are trying to do 
    i = "100_g_at" + 1
which does not make sense and hence the error

I do not know python but I presume it might give some sort of error
when you try to add a numeric to character as opposed to perl which
quietly converts the character to 0 and adds 1 ?

In future, try putting a print(i) or something similar after every 
line to narrow down where the problem is.

This is a not very clever way of debugging but it is simple.

> + gene.locusid.affy
> + }
> Error in i + 1 : non-numeric argument to binary
> operator
> 
> 
> Thank you. 
> PS
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
>



More information about the Bioconductor mailing list