Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in tutorial_iJO1366.py #12

Open
bigsuicideparty opened this issue Apr 25, 2022 · 1 comment
Open

Error in tutorial_iJO1366.py #12

bigsuicideparty opened this issue Apr 25, 2022 · 1 comment

Comments

@bigsuicideparty
Copy link

bigsuicideparty commented Apr 25, 2022

Having problems to resolve the following error in the tutorial code:

rib = Ribosome(id='rib', 
               name='Ribosome', 
               kribo=12 * 3600, 
               kdeg=0.001,
               )

Output:

TypeError                                 Traceback (most recent call last)
/Users/bsp/unix/etfl/tutorials/tutorial_iJO1366.ipynb Cell 17' in <cell line: 38>()
     33 rpeptide_genes = pd.read_csv(pjoin(data_dir,'ribosomal_proteins_ecoli.tsv'),
     34                              delimiter='\t',
     35                              header=None)[0]
     36 rpeptide_genes = rpeptide_genes.str.split(':').apply(lambda x:x[1])
---> 38 rib = Ribosome(id='rib', 
     39                name='Ribosome', 
     40               
     41                kribo=12 * 3600, 
     42                kdeg=0.001,
     43                )
     45 rnap = RNAPolymerase(id='rnap',
     46                      name='RNA Polymerase',
     47                      ktrans = 1000*3600,
     48                      composition=composition,
     49                      kdeg = 0.2
     50                      )

File ~/unix/etfl/etfl/core/enzyme.py:123, in Ribosome.__init__(self, id, kribo, kdeg, composition, rrna, *args, **kwargs)
    121 def __init__(self, id=None, kribo=None, kdeg=None, composition=None, rrna=None,
    122              *args, **kwargs):
--> 123     Enzyme.__init__(self, id = id, kdeg=kdeg, kcat = kribo, composition=composition,
    124                     *args, **kwargs)
    126     self.rrna_composition = {k: 1 for k in rrna}

File ~/unix/etfl/etfl/core/enzyme.py:41, in Enzyme.__init__(self, id, kcat, kcat_fwd, kcat_bwd, kdeg, composition, *args, **kwargs)
     39     self.composition = {k:1 for k in composition}
     40 else:
---> 41     raise TypeError('Composition should be of type dict() or iterable')
     43 self.complexation = None

TypeError: Composition should be of type dict() or iterable
@bigsuicideparty
Copy link
Author

Related to this. A number of your scripts refer to .json files in the /model directory that don't exist (e.g. ecoli = load_json_model('models/RelaxedModel iJO1366_T1E1N1_350_enz_256_bins__20180830_121200.json') in iJO1366_plot_growth_regions.py). Is that intended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant