예제 #1
0
def download_gaf(name):
    """
    Download gaf file
    """
    dest = get_fname(name)
    url = const.ASSOCIATION_MAP.get(name)

    utils.download(url=url, dest_name=dest)

    return
예제 #2
0
def download_prebuilt():
    """
    Downloads prebuild databases.
    """
    url = "http://data.biostarhandbook.com/bio/"

    url_sqlite = f"{url}/taxdb.sqlite"
    url_json = f"{url}/taxdb.json"

    utils.download(url=url_sqlite, dest_name=SQLITE_DB_NAME, cache=True)
    utils.download(url=url_json, dest_name=JSON_DB_NAME, cache=True)
예제 #3
0
파일: ncbi.py 프로젝트: 1010shane/Biof_395
def fetch_genbank(acc, dest_name):
    """
    Returns a genbank file.
    """
    try:
        db = 'nuccore'

        rettype, retmode = "gbwithparts", "text"

        params = dict(db=db, rettype=rettype, id=acc, retmode=retmode)

        utils.download(EFETCH_URL, params=params, dest_name=dest_name)

    except Exception as exc:
        utils.error(exc)
예제 #4
0
파일: ncbi.py 프로젝트: 1010shane/Biof_395
def download_file(url, dest):
    # Split the urls
    (scheme, loc, path, query, frag) = urlsplit(url)

    # Last member of the path is the prefix for each file.
    prefix = path.split("/")[-1]

    # Remote file name.
    file_name = f"{prefix}_genomic.gbff.gz"

    # Remote file path.
    file_path = f"{path}/{file_name}"

    # Genbank url.
    file_url = urlunsplit((scheme, loc, file_path, '', ''))

    # Download the file.
    utils.download(url=file_url, dest_name=dest)

    return
예제 #5
0
def update_taxdump(url=TAXDB_URL, dest_name=TAXDB_NAME):
    """
    Downloads taxdump file.
    """
    utils.download(url=url, dest_name=dest_name)
예제 #6
0
파일: ncbi.py 프로젝트: 1010shane/Biof_395
def download_assembly(url=ASSEMBLY_URL, dest_name=ASSEMBLY_FILE_NAME):
    """
    Downloads the assembly data.
    """
    utils.download(url=url, dest_name=dest_name)
예제 #7
0
def download_terms():

    utils.download(url=GO_URL, dest_name=GO_FILE)
    utils.download(url=SO_URL, dest_name=SO_FILE)

    return