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
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)
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)
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
def update_taxdump(url=TAXDB_URL, dest_name=TAXDB_NAME): """ Downloads taxdump file. """ utils.download(url=url, dest_name=dest_name)
def download_assembly(url=ASSEMBLY_URL, dest_name=ASSEMBLY_FILE_NAME): """ Downloads the assembly data. """ utils.download(url=url, dest_name=dest_name)
def download_terms(): utils.download(url=GO_URL, dest_name=GO_FILE) utils.download(url=SO_URL, dest_name=SO_FILE) return