scripts/export/genomes/genome_fetch.py
def rdf_accession_search(ref_prot_acc, sub_str):
    """
    Parses rdf url and returns a list of ENA accessions

    rdf_url: The url to a Uniprot's reference proteome rdf url
    sub_str: A sub string to look for in the rdf file
    """

    accessions = []
    rdf_graph = Graph()
    rdf_url = PROTEOME_URL % ref_prot_acc

    response = requests.get(rdf_url).status_code

    if response == httplib.OK:

        rdf_graph.load(rdf_url)

        for s, p, o in rdf_graph:
            if string.find(o, sub_str) != -1:
                accessions.append(os.path.split(o)[1])
    else:
        # return http status code
        # return response.status_code
        pass

    return accessions

    Parses rdf url and returns a list of ENA accessions

    rdf_url: The url to a Uniprot's reference proteome rdf url
    sub_str: A sub string to look for in the rdf file
    
Parses rdf url and returns a list of ENA accessions
rdf_url: The url to a Uniprot's reference proteome rdf url
sub_str: A sub string to look for in the rdf file
Parses rdf url and returns a list of ENA accessions rdf_url : The url to a Uniprot ' s reference proteome rdf url sub_str : A sub string to look for in the rdf file
def rdf_accession_search(ref_prot_acc, sub_str):
    accessions = []
    rdf_graph = Graph()
    rdf_url = PROTEOME_URL % ref_prot_acc
    response = requests.get(rdf_url).status_code
    if response == httplib.OK:
        rdf_graph.load(rdf_url)
        for s, p, o in rdf_graph:
            if string.find(o, sub_str) != -1:
                accessions.append(os.path.split(o)[1])
    else:
        pass
    return accessions
def rdf_accession_search ( ref_prot_acc , sub_str ) : accessions = [ ] rdf_graph = Graph ( ) rdf_url = PROTEOME_URL % ref_prot_acc response = requests . get ( rdf_url ) . status_code if response == httplib . OK : rdf_graph . load ( rdf_url ) for s , p , o in rdf_graph : if string . find ( o , sub_str ) != - 1 : accessions . append ( os . path . split ( o ) [ 1 ] ) else : pass return accessions
Parses rdf url and returns a list of ENA accessions
rdf_url: The url to a Uniprot's reference proteome rdf url
sub_str: A sub string to look for in the rdf file
Parses rdf url and returns a list of ENA accessions rdf_url : The url to a Uniprot ' s reference proteome rdf url sub_str : A sub string to look for in the rdf file
"""
    Parses rdf url and returns a list of ENA accessions

    rdf_url: The url to a Uniprot's reference proteome rdf url
    sub_str: A sub string to look for in the rdf file
    """ # return http status code # return response.status_code
ref_prot_acc
sub_str