[BioC] sorting a list of probe ID's according to length of vectors

Sean Davis seandavi at gmail.com
Fri Jan 22 12:54:54 CET 2010


On Fri, Jan 22, 2010 at 6:45 AM, Assa Yeroslaviz <frymor at gmail.com> wrote:
> Hello everybody,
>
> I have a list of over 9000 EntrezID . each lines contains one or probe-IDs
> as here:
>
>> head(probeSetList)
> $`10`
> [1] "38912_at"
>
> $`100`
> [1] "41654_at" "907_at"
>
> $`1000`
> [1] "2053_at"   "2054_g_at"
>
> $`10000`
> [1] "40781_at"
>
> $`10001`
> [1] "35430_at"   "35431_g_at" "35432_at"
>
> $`10002`
> [1] "31366_at"   "31667_r_at"
>
>
> I would like to sort this list according to the length of the single vectors
> inside it. so to sayat the top are the ENTREZIDs with the largest number of
> probe IDs. (in my example $`10001` with 3, but I have some with more!).
>
> I tried with order and sort command, but that didn't work.
>
> I will be happy to hear some advices on how to do it.

counts = sapply(probeSetList,length)
head(probeSetList[order(counts)])

This is untested but will hopefully give you an idea.

Sean



More information about the Bioconductor mailing list