No feature/sample/feature metadata/sample metadata ID is used twice
Same amount of ranks per feature
might be easiest to just ensure each feature has a ranking.
Looks like skbio.OrdinationResults.read() handles the feature loading formatting stuff -- so we'd just need to validate the differentials-reading, i.e. in _rank_utils.differentials_to_df().
Each feature given in the input ranks matches up to an entry in the feature metadata/biom table
At least one sample given in the input sample metadata matches up to an entry in the biom table
At least two features
At least one sample
At least one sample metadata field
There are definitely more of these that I'm not thinking of. Each of these assertions should be accompanied by a test (#2) to ensure that they trigger properly in invalid cases.
I imagine a lot of the QIIME 2 niceness will reduce the amount of times we run into these sort of problems, but the more of these we can anticipate the stronger this codebase will be. (Plus we can't rely on Q2 for the code that's shared between the standalone and Q2 versions of rankratioviz.)
Yeah so apparently assert shouldn't be used to check user input? Per here and here. It looks like "optimized" code won't even keep assertions, which is not desirable at all.
So uhhh it's probably best to go replace assertions with if statements that raise user-readable error messages.
No feature/sample/feature metadata/sample metadata ID is used twiceLooks like skbio.OrdinationResults.read() handles the feature loading formatting stuff -- so we'd just need to validate the differentials-reading, i.e. in_rank_utils.differentials_to_df()
.Each feature given in the input ranks matches up to an entry in the feature metadata/biom tableAt least one sample given in the input sample metadata matches up to an entry in the biom tableAt least two featuresAt least one sampleAt least one sample metadata fieldThere are definitely more of these that I'm not thinking of. Each of these assertions should be accompanied by a test (#2) to ensure that they trigger properly in invalid cases.
I imagine a lot of the QIIME 2 niceness will reduce the amount of times we run into these sort of problems, but the more of these we can anticipate the stronger this codebase will be. (Plus we can't rely on Q2 for the code that's shared between the standalone and Q2 versions of rankratioviz.)