ModelSEEDpy icon indicating copy to clipboard operation
ModelSEEDpy copied to clipboard

reproducing a reconstruction from the ModelSEED platform

Open hariszaf opened this issue 2 years ago • 0 comments

Hi!

Using the attached .faa file and through the ModelSEED platform I built the also attached .sbml growing model. I am now trying to reproduce that through the CLI and here is what I have done so far:

# modelseedpy
from modelseedpy import KBaseMediaPkg
from modelseedpy import MSBuilder, MSGenome

# cobrakbase 
import cobrakbase

genome = MSGenome.from_fasta('data/genomes/s_infantis/s_inf_all_contigs_default.faa')

kbase_api    = cobrakbase.KBaseAPI()
kb_template = kbase_api.get_from_ws("GramNegModelTemplateV4","NewKBaseModelTemplates")

model = MSBuilder.build_metabolic_model('salmonella infantis', genome, template = kb_template, allow_all_non_grp_reactions = True)

#Pulling a KBase media to specify an environment for gapfilling
media = kbase_api.get_from_ws("Complete","KBaseMedia")

#Gapfilling the model in the specified media
model = MSBuilder.gapfill_model(model, "bio1", kb_template, media)

#Applying the same media to the resulting model
kmp = KBaseMediaPkg(model)
kmp.build_package(media)

However, my media is just empty and therefore, my new model is not growing.

print(media.data)
{'source_id': 'Complete',
 'isMinimal': 0,
 'name': 'Complete',
 'type': 'unknown',
 'id': 'kb|media.626',
 'mediacompounds': [],
 'isDefined': 1,
 '__VERSION__': 1,
 'exclude_dict': set(),
 'data_keys': {'source_id': str,
  'isMinimal': int,
  'name': str,
  'type': str,
  'id': str,
  'mediacompounds': list,
  'isDefined': int,
  '__VERSION__': int},
 'info': <cobrakbase.kbase_object_info.KBaseObjectInfo at 0x7f210d4ab220>,
 'data': {...},
 'provenance': [{'time': '2013-06-20T17:04:46+0000',
   'epoch': 1371747886000,
   'service': 'KBaseFBAModeling',
   'service_ver': '0',
   'method': 'load_media_from_bio',
   'method_params': [],
   'input_ws_objects': [],
   'resolved_ws_objects': [],
   'intermediate_incoming': [],
   'intermediate_outgoing': [],
   'external_data': [],
   'subactions': [],
   'custom': {}}],
 'path': ['262/34/1'],
 'creator': 'chenry',
 'orig_wsid': None,
 'created': '2014-01-18T09:09:51+0000',
 'epoch': 1390036191265,
 'refs': [],
 'copied': None,
 'copy_source_inaccessible': 0}

I would like to ask you:

  • is my approach valid in order to reproduce the platform workflow or am i missing something?
  • how could I use the complete medium like the default case on the modelseed web platform?

Thank you very much for your time and help!

p.s. I have a .txt suffix on the files so GitHub allows them as attached

s_inf_all_contigs_default.faa.txt

s_inf_from_modelseed.sbml.txt

hariszaf avatar Jan 30 '23 18:01 hariszaf