[BioC] rbind of MALists

Gordon K Smyth smyth at wehi.EDU.AU
Thu Jun 15 01:49:36 CEST 2006


On Thu, June 15, 2006 12:54 am, Matthew Scholz wrote:
> Gordon,
>
> Thank you for your advice. I'm still having a problem rbinding my
> MALists and have attached below the output of the commands you asked
> me to execute. While you are correct that I missed a "$'" in my
> genesStatus syntax, correcting this does not seem to remedy the
> problem. In addition, I realized that whether I correct this or not I
> have no problem doing:
>
> new = rbind(RGAmodel, RGAmodel)

This won't give an error message with genesStatus in the objects, but the result will still be
incorrect because the genesStatus component doesn't double in length.  You must remove this
component.

> but cannot do:
>
> new = rbind(RGAmodel, RGBmodel)

[snip]

> If it helps, here is the output from the commands you asked me to execute:
>
>> show(RGAmodel)

[snip]

> An object of class "MAList"

> $genes
>   Block Row Column         ID
> 1     1   1      1 MZ00040724
> 2     1   1      2 MZ00040730
> 3     1   1      3 MZ00040748
> 4     1   1      4 MZ00040754
> 5     1   1      5 MZ00040772
> 32443 more rows ...

[snip]

>>  show(RGBmodel)
> An object of class "MAList"

[snip]

> $genes
>   Block Row Column         ID        Name
> 1     1   1      1 MZ00002380  AZM4_14521
> 2     1   1      2 MZ00002386  AZM4_49988
> 3     1   1      3 MZ00002404 AZM4_100937
> 4     1   1      4 MZ00002410 AZM4_135577
> 5     1   1      5 MZ00002428  AZM4_79828
> 32443 more rows ...

The problem is that RGA$genes and RGB$genes have different columns, the latter having an extra
column.  You can't rbind() data.frames with different columns, and hence the rbind() of the larger
MAList objects fails as well.  The reason why rbind() works with B first but not the other way
around is that the first object sets the columns and the second object with fewer columns is
filled out with NAs.  This is the way that rbind() works in R for data.frames and is not under
limma control.

Before rbinding, you need to make your two data objects compatible by giving RGAmodel$genes a
column called "Name", containing perhaps all "" or all NA.

Best wishes
Gordon



More information about the Bioconductor mailing list