NCBI-get-GCFIDs_fast.py
import requests
import os
import re
def download_genome_first(gcf_id):
# 构建FTP下载路径
base_url = "https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/"
# 提取GCF号的数字部分并按三位分割
parts = gcf_id.split('_')[1] # 提取数字部分
path_parts = [parts[i:i + 3] for i in range(0, len(parts), 3)]
path_parts.pop()
ftp_path = base_url + "/".join(path_parts)