biocore / redbiom

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

Add API method to obtain the loaded tags #83

Closed wasade closed 1 year ago

wasade commented 5 years ago

A possible implementation can look like the below, but probably can be done more efficiently than by relying on an indirects call to summarize.contexts and samples_in_context.

def loaded_tags():
    loaded_tags = set()
    contexts = redbiom.summarize.contexts()
    for context in contexts['ContextName']:
        samples = redbiom.fetch.samples_in_context(context, unambiguous=True)
        loaded_tags.update({s.split('_'. 1)[0] for s in samples})
    return loaded_tags
wasade commented 1 year ago

We haven't actually needed this so closing it out.