<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 GA4GH 1000 Genomes Sequence Annotations Example
This example illustrates how to access the sequence annotations for a given set of ....
Initialize Client
In this step we create a client object which will be used to communicate with the server. It is initialized using the URL.
Step1:  Search Feature Sets
Feature sets are the logical containers for genomic features that might be defined in a GFF3, or other file that describes features in genomic coordinates. They are mapped to a single reference set, and belong to specific datasets.
Step2:  Get Feature Set by ID
With the identifier to a specific Feature Set, one can retrieve that feature set by ID.
Step3:  Search Features
With a Feature Set ID, it becomes possible to construct a Search Features Request. In this request, we can find genomic features by position, type, or name. In this request we simply return all features in the Feature Set.
Step4:  Note
<ASSISTANT_TASK:>
Python Code:
from ga4gh.client import client
c = client.HttpClient("http://1kgenomes.ga4gh.org")
#Obtain dataSet id REF: -> `1kg_metadata_service`
dataset = c.search_datasets().next() 
Explanation: GA4GH 1000 Genomes Sequence Annotations Example
This example illustrates how to access the sequence annotations for a given set of ....
Initialize Client
In this step we create a client object which will be used to communicate with the server. It is initialized using the URL.
End of explanation
for feature_set in c.search_feature_sets(dataset_id=dataset.id):
    print feature_set
    if feature_set.name == "gencode_v24lift37":
        gencode = feature_set
Explanation: Search Feature Sets
Feature sets are the logical containers for genomic features that might be defined in a GFF3, or other file that describes features in genomic coordinates. They are mapped to a single reference set, and belong to specific datasets.
End of explanation
feature_set = c.get_feature_set(feature_set_id=gencode.id)
print feature_set
Explanation: Get Feature Set by ID
With the identifier to a specific Feature Set, one can retrieve that feature set by ID.
End of explanation
counter = 0
for features in c.search_features(feature_set_id=feature_set.id):
    if counter > 3:
        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)
Explanation: Search Features
With a Feature Set ID, it becomes possible to construct a Search Features Request. In this request, we can find genomic features by position, type, or name. In this request we simply return all features in the Feature Set.
End of explanation
for feature in c.search_features(feature_set_id=feature_set.id, reference_name="chr17", start=42000000, end=42001000):
    print feature.name, feature.start, feature.end
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)
Explanation: Note: Not all of the elements returned in the response are present in the example. All of the parameters will be shown in the get by id method.
We can perform a similar search, this time restricting to a specific genomic region.
End of explanation
<END_TASK>