Mercurial > repos > bimib > cobraxy
comparison COBRAxy/custom_data_generator_beta.py @ 444:06564187fba3 draft
Uploaded
| author | francesco_lapi |
|---|---|
| date | Thu, 11 Sep 2025 09:03:10 +0000 |
| parents | 00a78da611ba |
| children | c3bb75ce07e6 |
comparison
equal
deleted
inserted
replaced
| 443:3d4e10546917 | 444:06564187fba3 |
|---|---|
| 171 # Set medium conditions | 171 # Set medium conditions |
| 172 for reaction, value in medium.items(): | 172 for reaction, value in medium.items(): |
| 173 if value is not None: | 173 if value is not None: |
| 174 model.reactions.get_by_id(reaction).lower_bound = -float(value) | 174 model.reactions.get_by_id(reaction).lower_bound = -float(value) |
| 175 | 175 |
| 176 if ARGS.name == "ENGRO2" and ARGS.gene_format != "Default": | 176 #if ARGS.name == "ENGRO2" and ARGS.gene_format != "Default": |
| 177 # logging.basicConfig(level=logging.INFO) | |
| 178 # logger = logging.getLogger(__name__) | |
| 179 | |
| 180 #model = modelUtils.translate_model_genes( | |
| 181 # model=model, | |
| 182 # mapping_df= pd.read_csv(ARGS.tool_dir + "/local/mappings/genes_human.csv"), dtype={'entrez_id': str}, | |
| 183 # target_nomenclature=ARGS.gene_format.replace("HGNC_", "HGNC "), | |
| 184 # source_nomenclature='HGNC_ID', | |
| 185 # logger=logger | |
| 186 #) | |
| 187 #model = modelUtils.convert_genes(model, ARGS.gene_format.replace("HGNC_", "HGNC ")) | |
| 188 | |
| 189 if (ARGS.name == "Recon" or ARGS.name == "ENGRO2") and ARGS.gene_format != "Default": | |
| 177 logging.basicConfig(level=logging.INFO) | 190 logging.basicConfig(level=logging.INFO) |
| 178 logger = logging.getLogger(__name__) | 191 logger = logging.getLogger(__name__) |
| 179 | 192 |
| 180 model = modelUtils.translate_model_genes( | 193 model = modelUtils.translate_model_genes( |
| 181 model=model, | 194 model=model, |
| 182 mapping_df= pd.read_csv(ARGS.tool_dir + "/local/mappings/genes_human.csv"), | 195 mapping_df= pd.read_csv(ARGS.tool_dir + "/local/mappings/genes_human.csv", dtype={'entrez_id': str}), |
| 183 target_nomenclature=ARGS.gene_format.replace("HGNC_", "HGNC "), | |
| 184 source_nomenclature='HGNC_ID', | |
| 185 logger=logger | |
| 186 ) | |
| 187 #model = modelUtils.convert_genes(model, ARGS.gene_format.replace("HGNC_", "HGNC ")) | |
| 188 | |
| 189 if ARGS.name == "Recon" and ARGS.gene_format != "Default": | |
| 190 logging.basicConfig(level=logging.INFO) | |
| 191 logger = logging.getLogger(__name__) | |
| 192 | |
| 193 model = modelUtils.translate_model_genes( | |
| 194 model=model, | |
| 195 mapping_df= pd.read_csv(ARGS.tool_dir + "/local/mappings/genes_human.csv"), | |
| 196 target_nomenclature=ARGS.gene_format.replace("HGNC_", "HGNC "), | 196 target_nomenclature=ARGS.gene_format.replace("HGNC_", "HGNC "), |
| 197 source_nomenclature='HGNC_symbol', | 197 source_nomenclature='HGNC_symbol', |
| 198 logger=logger | 198 logger=logger |
| 199 ) | 199 ) |
| 200 | 200 |
