Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the vignette returns a matrix | array, real data returns a list #21

Open
AGordonRobertson opened this issue Mar 18, 2021 · 1 comment
Open

Comments

@AGordonRobertson
Copy link

I've resolved the issue, but will post this brief note anyway on the chance that it might be helpful.

In R v4.0.3, with sva v3.36.0, if I run the ComBat_seq example, it outputs a 50 x 8 "matrix" "array" -
adjusted_counts <- ComBat_seq(count_matrix, batch=batch, group=NULL, full_mod=FALSE)
...
class(adjusted_counts)

"matrix" "array"

dim(adjusted_counts)

50 8

If I run real read-count data consisting of 2103 genes x 270 samples, with two batches (156 and 114 samples), but input a data.frame, I get a list whose length is the product of 2103 * 270.

But if I follow the help docs and make the input data.frame into a matrix, then I get a "matrix" "array" out.
system.time(
adjusted_counts.old.new <- ComBat_seq(
as.matrix(input),
batch = batch,
group = NULL,
full_mod = FALSE # Boolean, if TRUE include condition of interest in model
)
)

@AleksZakirov
Copy link

Thanks for sharing your observation and solution. I upgraded R from v 4.1.1 to 4.2.3 and encountered the same issue - the function was outputting a list rather a matrix. Explicitly converting the read count table to matrix resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants