In [1]:
import ga4gh_client.client as client
c = client.HttpClient("http://1kgenomes.ga4gh.org")
In [2]:
for feature_sets in c.search_feature_sets(dataset_id="WyIxa2dlbm9tZXMiXQ"):
print feature_sets
In [3]:
feature_set = c.get_feature_set(feature_set_id=feature_sets.id)
print feature_set
In [4]:
counter = 0
for features in c.search_features(feature_set_id=feature_set.id):
if counter > 5:
break
counter += 1
print"Id: {},".format(features.id)
print" Name: {},".format(features.name)
print" Gene Symbol: {},".format(features.gene_symbol)
print" Parent Id: {},".format(features.parent_id)
if features.child_ids:
for i in features.child_ids:
print" Child Ids: {}".format(i)
print" Feature Set Id: {},".format(features.feature_set_id)
print" Reference Name: {},".format(features.reference_name)
print" Start: {},\tEnd: {},".format(features.start, features.end)
print" Strand: {},".format(features.strand)
print" Feature Type Id: {},".format(features.feature_type.id)
print" Feature Type Term: {},".format(features.feature_type.term)
print" Feature Type Sorce Name: {},".format(features.feature_type.source_name)
print" Feature Type Source Version: {}\n".format(features.feature_type.source_version)
In [5]:
feature = c.get_feature(feature_id=features.id)
print"Id: {},".format(feature.id)
print" Name: {},".format(feature.name)
print" Gene Symbol: {},".format(feature.gene_symbol)
print" Parent Id: {},".format(feature.parent_id)
if feature.child_ids:
for i in feature.child_ids:
print" Child Ids: {}".format(i)
print" Feature Set Id: {},".format(feature.feature_set_id)
print" Reference Name: {},".format(feature.reference_name)
print" Start: {},\tEnd: {},".format(feature.start, feature.end)
print" Strand: {},".format(feature.strand)
print" Feature Type Id: {},".format(feature.feature_type.id)
print" Feature Type Term: {},".format(feature.feature_type.term)
print" Feature Type Sorce Name: {},".format(feature.feature_type.source_name)
print" Feature Type Source Version: {}\n".format(feature.feature_type.source_version)
for vals in feature.attributes.vals:
print"{}: {}".format(vals, feature.attributes.vals[vals].values[0].string_value)
https://ga4gh-schemas.readthedocs.io/en/latest/schemas/allele_annotation_service.proto.html