Getting Started with Filter Development

The devkit is designed to be used in NOAO’s DataLab Jupyter environment, where it has access to the ANTARES databases. Steps to get started:

  1. Sign up for DataLab.

  2. Log in to the Jupyter server.

  3. Create a new notebook using the “Python 3 (ANTARES 0.4)” kernel.

  4. Paste in the following code:

import antares.devkit as dk

Run that code block, and you should see a success message. Now you’re ready to create and test ANTARES filters.

Let’s make a simple HelloWorld filter which tags all Loci 'hello_world':

class HelloWorld(dk.Filter):
            'name': 'hello_world',
            'description': 'hello!',

    def run(self, locus):
        print('Hello Locus ', locus.locus_id)

Let’s run the filter on a randomly chosen real Locus from the database:

# Fetch 1 random Locus ID from the test dataset
locus_id = dk.get_locus_ids(1)[0]

# Execute HelloWorld filter on the locus
report = dk.run_filter(HelloWorld, locus=locus_id)

# `run_filter()` returns a report of what the filter did. Take a look at it:

Next Steps

Now that you’ve seen a HelloWorld Filter, read on:

For examples of real filters, check out the filters which are currently running in the ANTARES Pipeline.