alanocallaghan / scater

Clone of the Bioconductor repository for the scater package.
https://bioconductor.org/packages/devel/bioc/html/scater.html
95 stars 40 forks source link

fix wrong index in .subset2index #180

Closed Yunuuuu closed 1 year ago

Yunuuuu commented 2 years ago

As features is a factor, so .subset2index function will always return the first rows of the object

alanocallaghan commented 2 years ago

Another good catch, thanks! You can add yourself as a contributor in DESCRIPTION if you like, eg person("firstname", "secondname", role=c("ctb"))

Yunuuuu commented 1 year ago

Thanks @Alanocallaghan

alanocallaghan commented 1 year ago

Can you provide an example of code where this bug would occur? Just so I can write a test case.

Yunuuuu commented 1 year ago

because factor always subset the head elements, we just test this by indexing someone other than the heading elements image

Yunuuuu commented 1 year ago

It'll be okay after merging this commit but failure in the present code. I just modified the existing test code, can this make sense ? or should I add a new test section ?

alanocallaghan commented 1 year ago

Thanks, that's perfect! I copied this code to #182 as I ended up patching subset2index rather than handling it on the scater end. Thanks again for the great contributions, really appreciated