biocore / redbiom

Sample search by metadata and features
Other
45 stars 20 forks source link

fetch specific metadata categories #56

Closed wasade closed 5 years ago

wasade commented 6 years ago

It would be nice to, for a given set of samples and possibly a context, fetch specific metadata categories. Right now, the approach is to either take all columns in common (intersection) with a set of samples, or all columns possible (union) for a set of samples. I think the necessary API change would be to allow for providing a kwarg like specific_categories which is an iterable. The method should appropriately set null when a sample does not have a category. This method would need to operate either exclusively or in conjunction with the current set operations. One possible CLI example would be:

$ cat sample.ids | redbiom fetch sample-metadata --context $ctx --specific-categories sample_type,empo_1 --output foo.txt