Skip to content

Instantly share code, notes, and snippets.

@reece
Created March 12, 2016 18:58
Show Gist options
  • Save reece/9db77d7f43af7c4fb8fc to your computer and use it in GitHub Desktop.
Save reece/9db77d7f43af7c4fb8fc to your computer and use it in GitHub Desktop.
Demonstrate unexpected behavior of effect filters with searchVariantAnnotations
#!/usr/bin/env python2
# This script returns for me:
# ga4gh version: 0.1.dev616+ncbb0131b36d2
# AssertionError: reversing filter order changes number of results (697!=56)
# using server test data as described here:
# https://github.com/ga4gh/server/pull/930
import ga4gh.client
print("ga4gh version: " + ga4gh.__version__)
gc = ga4gh.client.HttpClient("http://localhost:8000")
vas_id = "YnJjYTE6T1I0Rjp2YXJpYW50YW5ub3RhdGlvbnM"
effect_filters = ['{"id":"SO:0000605"}', '{"id":"SO:0001632"}']
r1 = list(gc.searchVariantAnnotations(vas_id, referenceName="1", start=0, end=1000000, effects=effect_filters))
r2 = list(gc.searchVariantAnnotations(vas_id, referenceName="1", start=0, end=1000000, effects=reversed(effect_filters)))
assert len(r1)==len(r2), "reversing filter order changes number of results ({l1}!={l2})".format(l1=len(r1), l2=len(r2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment