Skip to content

music2 bug when select.ct = NULL #131

@ErikTheBlacksmith

Description

@ErikTheBlacksmith

Howdy,
I was debugging music_prop2() in the music2.R file and came across an error that occurs when select.ct = NULL
the problem stems from line 91: ncell = length(select.ct). since select.ct = NULL, this results in a length of 0 instead of the actual number of cell types (all of them) and then MOD0 and MOD1 will be the wrong size.

I am not familiar with making pull requests (sorry about that), but this problem should be fixed by replacing that line (91) with something like:

if (isnull(select.ct)) {
  ncell = length(unique(  sc.sce@colData[, clusters]  ))
} else {
  ncell = length(select.ct)
}

I did not test it there, but it appears to also be the case for the other two functions in the file at lines 315 and 542. In addition, there is no default value for select.ct in all of those functions in that file instead of NULL as the documentation states.

I hope this is helpful,
Erik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions