scripts/export/genomes/genome_fetch.py
def check_accession_availability(accession):
    """
    Check whether a specific accession is available from ENA

    accession: sequence accession
    return: True if accession is available, False otherwise
    """

    # we can expand this by adding a db option (e.g. ena, uniprot, ncbi)
    response = requests.get(ENA_XML_URL % accession)

    if response.status_code == httplib.OK:
        xml_root = ET.fromstring(response.content)

        # If the entry exists, there should be an entry node in the xml file
        entry_node = None
        entry_node = xml_root.find("entry")

        if entry_node is None:
            return False

    return True

    Check whether a specific accession is available from ENA

    accession: sequence accession
    return: True if accession is available, False otherwise
    
Check whether a specific accession is available from ENA
accession: sequence accession
return: True if accession is available, False otherwise
Check whether a specific accession is available from ENA accession : sequence accession return : True if accession is available False otherwise
def check_accession_availability(accession):
    response = requests.get(ENA_XML_URL % accession)
    if response.status_code == httplib.OK:
        xml_root = ET.fromstring(response.content)
        entry_node = None
        entry_node = xml_root.find("entry")
        if entry_node is None:
            return False
    return True
def check_accession_availability ( accession ) : response = requests . get ( ENA_XML_URL % accession ) if response . status_code == httplib . OK : xml_root = ET . fromstring ( response . content ) entry_node = None entry_node = xml_root . find ( "entry" ) if entry_node is None : return False return True
Check whether a specific accession is available from ENA
accession: sequence accession
return: True if accession is available, False otherwise
Check whether a specific accession is available from ENA accession : sequence accession return : True if accession is available False otherwise
"""
    Check whether a specific accession is available from ENA

    accession: sequence accession
    return: True if accession is available, False otherwise
    """ # we can expand this by adding a db option (e.g. ena, uniprot, ncbi) # If the entry exists, there should be an entry node in the xml file
accession