@@ -101,7 +101,7 @@ def post_ncbi_request(url, json_data, batch_size=1000, min_batch_size=50):
101101
102102 # Use rate_limit_handler to make the request with proper retry logic
103103 response = rate_limit_handler (
104- lambda : requests .post (url , json = batch_data )
104+ lambda data = batch_data : requests .post (url , json = data )
105105 )
106106
107107 if response .status_code != 200 :
@@ -990,7 +990,7 @@ def fetch_url_data(url, counter=0, counter_limit=2, wait_time=2, num_retry=3):
990990 # BAM files that are labeled as FASTQ.
991991 # For these, we can retrieve S3 links instead.
992992 file_list_data , counter = fetch_url_data (
993- f "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=sra&id=SRR25741043&retmode=xml" ,
993+ "https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=sra&id=SRR25741043&retmode=xml" ,
994994 counter ,
995995 )
996996 srafile_soup = BeautifulSoup (file_list_data .text , "xml" )
@@ -1154,9 +1154,11 @@ def make_qc_report(
11541154 gene_model_urls_text = (
11551155 "N/A"
11561156 if missing_gene_model_urls is None
1157- else "None"
1158- if len (missing_gene_model_urls ) == 0
1159- else "\n " .join ([f"- { accession } " for accession in missing_gene_model_urls ])
1157+ else (
1158+ "None"
1159+ if len (missing_gene_model_urls ) == 0
1160+ else "\n " .join ([f"- { accession } " for accession in missing_gene_model_urls ])
1161+ )
11601162 )
11611163 taxonomy_ids_text = (
11621164 "None"
@@ -1168,13 +1170,15 @@ def make_qc_report(
11681170 ploidy_assemblies_text = (
11691171 "None"
11701172 if missing_ploidy_assemblies is None
1171- else "None"
1172- if len (missing_ploidy_assemblies ) == 0
1173- else "\n " .join (
1174- [
1175- f"- { accession } (speciesTaxonomyId: { tax_id } )"
1176- for accession , tax_id in missing_ploidy_assemblies
1177- ]
1173+ else (
1174+ "None"
1175+ if len (missing_ploidy_assemblies ) == 0
1176+ else "\n " .join (
1177+ [
1178+ f"- { accession } (speciesTaxonomyId: { tax_id } )"
1179+ for accession , tax_id in missing_ploidy_assemblies
1180+ ]
1181+ )
11781182 )
11791183 )
11801184 if missing_outbreak_descendants is None or len (missing_outbreak_descendants ) == 0 :
@@ -1321,7 +1325,7 @@ def build_files(
13211325 ucsc_assemblies_url ,
13221326 tree_output_path ,
13231327 taxonomic_levels_for_tree ,
1324- taxonomic_group_sets = {} ,
1328+ taxonomic_group_sets = None ,
13251329 do_gene_model_urls = True ,
13261330 extract_primary_data = False ,
13271331 primary_output_path = None ,
@@ -1348,6 +1352,8 @@ def build_files(
13481352 outbreaks_path: Path of input outbreaks YAML
13491353 outbreak_taxonomy_mapping_path: Path to save taxonomic information for outbreaks at
13501354 """
1355+ if taxonomic_group_sets is None :
1356+ taxonomic_group_sets = {}
13511357 print ("Building files" )
13521358
13531359 qc_report_params = {}
0 commit comments