MD-Anderson-Bioinformatics / NGCHM-R

An R package for creating Next-Generation Clustered Heat Maps (NG-CHM)
http://bioinformatics.mdanderson.org/main/NG-CHM-V2:Overview
8 stars 3 forks source link

Bug fix for chmAddPCA #68

Closed marohrdanz closed 1 month ago

marohrdanz commented 1 month ago

This pull request is a bug fix for issue #67.

Some additional checking of input arguments was also added--for example to check that the third argument is a prcomp object and has prcomp$x.

Additionally, the existing error checking messages were tweaked to hopefully be slightly easier for users to quickly understand. Example:

If first argument to chmAddPCA is not an NG-CHM, the original code gave this error:

Error in chmAddPCA();
    is(hm, "ngchmVersion2") is not TRUE

I tweaked this slightly to give message:

Error in chmAddPCA():
    First argument (hm) must be an ngchmVersion2 object.
ChrisWakefield commented 1 month ago

Is the 'ndim' argument supposed to be the required number of dimensions, as this change implies, or is it the max number desired, in which case the functionality should not be changed?

bmbroom commented 1 month ago

Is the 'ndim' argument supposed to be the required number of dimensions, as this change implies, or is it the max number desired, in which case the functionality should not be changed?

It should be the max number desired. If the user specifies 5 dims but there are only 2, we go with 2.

marohrdanz commented 1 month ago

My instinct on ndim is that if the user requested more than available in the prc input data, then probably they made an error somewere and we should let them know. Is that too much handholding?

ChrisWakefield commented 1 month ago

Imagine instead that the arg was named 'maxdim' rather than 'ndim'. I think that is as bmbroom described it.

marohrdanz commented 1 month ago

I pushed three additional commits to address the issues mentioned above:

I'm hoping there's time at today's meeting to discuss these further, and additional changes requested.

bmbroom commented 1 month ago

Sounds good to me.

I am still on PTO so cannot be there today. Go ahead and merge if everyone else is okay with it.

Bradley

On Tue, Oct 15, 2024, 10:32 AM Mary Rohrdanz @.***> wrote:

I pushed three additional commits to address the issues mentioned above:

I'm hoping there's time at today's meeting to discuss these further, and additional changes requested.

— Reply to this email directly, view it on GitHub https://github.com/MD-Anderson-Bioinformatics/NGCHM-R/pull/68#issuecomment-2414104503, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI76BRF2MODEUHM32FEUNTZ3URQBAVCNFSM6AAAAABPXUEFQ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJUGEYDINJQGM . You are receiving this because your review was requested.Message ID: @.***>