Closed howardbaek closed 2 months ago
I am seeing a bug in the example for setup_data()
. When I run this line, https://github.com/FredHutch/gimap/blob/19-testing/R/00-setup_data.R#L14, I get this error message:
Error in setup_data(data) :
the number of rows in the sample metadata is not equal to the number of columns in the counts
@cansavvy @kweav I believe this error is caused by this line: https://github.com/FredHutch/gimap/blob/7432345997be23dc735d8d12ffd1db43dc3b2d2d/R/00-setup_data.R#L53
@howardbaek I think it's a combination of the line you've linked above, and this line: https://github.com/FredHutch/gimap/blob/19594160a24d5fb4c0f0bff976cf9444629dd3ab/R/00-setup_data.R#L41
The way I view sample_metadata, it's the metadata for the samples or the columns for the count data. Because the example in the example_data() header isn't providing a sample_metadata, the code creates ones, but it's equal to the number of rows, not the number of columns
The params in the setup_data header match my expectations for those variables (e.g., this line for sample_metadata https://github.com/FredHutch/gimap/blob/7432345997be23dc735d8d12ffd1db43dc3b2d2d/R/00-setup_data.R#L6)
Then, should we fix the example for setup_data()
?
I'll file a PR with a fix for the example to include the required arguments, and fix the line that sets the sample_metadata in case it's null since that one isn't currently required. Thanks for pointing this issue out!
Build unit tests using testthat.
Test
setup_data()
: