-
Notifications
You must be signed in to change notification settings - Fork 5
Description
def contextualize_with_riptide(model, transcript_abundances):
"""
Use RIPTiDe to create a context-specific metabolic model based on transcriptomics.
"""
if transcript_abundances==transcript_abundances_1_bname:
riptide_object = riptide.contextualize(model=model, transcriptome=transcript_abundances)
riptide.save_output(riptide_obj=riptide_object, path='example_riptide_output_1')
else:
riptide_object = riptide.contextualize(model=model, transcriptome=transcript_abundances)
riptide.save_output(riptide_obj=riptide_object, path='example_riptide_output_2')
context_specific_model = riptide_object.model # Contextualized model
flux_samples = riptide_object.flux_samples # Flux samples
flux_variability = riptide_object.flux_variability # FVA results
return context_specific_model, flux_samples, flux_variability
{
"name": "AttributeError",
"message": "'riptideClass' object has no attribute 'flux_variability'",
"stack": "---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[28], line 162
159 transcriptome_2 = transcript_abundances_2_bname # Dictionary for interior region
161 # Run the analysis
--> 162 results = run_analysis_with_riptide(model_file, transcriptome_1, transcriptome_2)
164 # Print results
165 print(f"Convergence achieved: {results['converged']}")
Cell In[28], line 126, in run_analysis_with_riptide(model_file, transcriptome_1, transcriptome_2)
123 base_model = cobra.io.load_model(model_file)
125 # Generate context-specific models using RIPTiDe
--> 126 exterior_model, ext_flux_samples, ext_flux_variability = contextualize_with_riptide(base_model, transcriptome_1)
127 interior_model, int_flux_samples, int_flux_variability = contextualize_with_riptide(base_model, transcriptome_2)
129 # Configure medium conditions
Cell In[28], line 20, in contextualize_with_riptide(model, transcript_abundances)
18 context_specific_model = riptide_object.model # Contextualized model
19 flux_samples = riptide_object.flux_samples # Flux samples
---> 20 flux_variability = riptide_object.flux_variability # FVA results
21 return context_specific_model, flux_samples, flux_variability
AttributeError: 'riptideClass' object has no attribute 'flux_variability'"
}