scripts/export/genomes/genome_fetch.py
def download_fasta_from_ncbi(accession, dest_dir):
    """
    Download fasta sequences from NCBI. In case of ENA obsolete sequences use
    this function to download the relevant files

    accession: A genome accession to download
    dest_dir: Destination directory to save the file to

    return: True on success, otherwise False
    """
    seq_url = None
    file_path = None

    seq_url = NCBI_SEQ_URL % (accession)
    file_path = os.path.join(dest_dir, accession + '.fa')

    urllib.urlretrieve(seq_url, file_path)

    if os.path.exists(file_path):
        return True

    return False

    Download fasta sequences from NCBI. In case of ENA obsolete sequences use
    this function to download the relevant files

    accession: A genome accession to download
    dest_dir: Destination directory to save the file to

    return: True on success, otherwise False
    
Download fasta sequences from NCBI. In case of ENA obsolete sequences use
this function to download the relevant files

A genome accession to download
dest_dir: Destination directory to save the file to

True on success, otherwise False
Download fasta sequences from NCBI . In case of ENA obsolete sequences use this function to download the relevant files A genome accession to download dest_dir : Destination directory to save the file to True on success otherwise False
def download_fasta_from_ncbi(accession, dest_dir):
    seq_url = None
    file_path = None
    seq_url = NCBI_SEQ_URL % (accession)
    file_path = os.path.join(dest_dir, accession + '.fa')
    urllib.urlretrieve(seq_url, file_path)
    if os.path.exists(file_path):
        return True
    return False
def download_fasta_from_ncbi ( accession , dest_dir ) : seq_url = None file_path = None seq_url = NCBI_SEQ_URL % ( accession ) file_path = os . path . join ( dest_dir , accession + '.fa' ) urllib . urlretrieve ( seq_url , file_path ) if os . path . exists ( file_path ) : return True return False
Download fasta sequences from NCBI.
Download fasta sequences from NCBI .
"""
    Download fasta sequences from NCBI. In case of ENA obsolete sequences use
    this function to download the relevant files

    accession: A genome accession to download
    dest_dir: Destination directory to save the file to

    return: True on success, otherwise False
    """
accession
dest_dir