canc1993 / cheshire-gapfilling

MIT License
19 stars 5 forks source link

possible missing file bigg_biomass_reactions.csv #4

Open teisnotte opened 1 year ago

teisnotte commented 1 year ago

Hello there,

It seems line 24 in utils.py is using a file that's missing from the pools, is it the same as bigg_universe? Thanks!

biomass_rxns = np.array(pd.read_csv('./data/pools/bigg_biomass_reactions.csv').bigg_id.to_list())

And it seems I get error from below, and the specified bigg model under ./data/gems/gem.xml is not loaded:

  File "/Users/cheshire-gapfilling/utils.py", line 74, in get_data_from_pool2
    model = get_data(path, sample)[0]
            ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cheshire-gapfilling/utils.py", line 42, in get_data
    model.remove_reactions(model.reactions[remove_rxn_index], remove_orphans=True)
                           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/python3.11/site-packages/cobra/core/dictlist.py", line 464, in __getitem__
    return self.__class__(list.__getitem__(self, i))
                          ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: only integer scalar arrays can be converted to a scalar index
canc1993 commented 1 year ago

Hello,

We have uploaded the file bigg_biomass_reactions.csv, but it is not used in the Zimmermann's dataset. Thanks.

Best, Can

teisnotte commented 1 year ago

Thanks!

It seems the line 41 of utils.py should be

    model.remove_reactions(np.array(model.reactions)[remove_rxn_index], remove_orphans=True)

https://stackoverflow.com/questions/50997928/typeerror-only-integer-scalar-arrays-can-be-converted-to-a-scalar-index-with-1d

canc1993 commented 1 year ago

The code works fine on my end. I guess it is because model.reaction is a dict list. Thanks.

Best, Can

On Thu, Oct 19, 2023 at 4:25 PM teisnotte @.***> wrote:

It seems the line 41 of utils.py should be

model.remove_reactions(np.array(model.reactions)[remove_rxn_index], remove_orphans=True)

https://stackoverflow.com/questions/50997928/typeerror-only-integer-scalar-arrays-can-be-converted-to-a-scalar-index-with-1d

— Reply to this email directly, view it on GitHub https://github.com/canc1993/cheshire-gapfilling/issues/4#issuecomment-1771655929, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALXYM5ZLLBCYZGOECFAVQVLYAGEFHAVCNFSM6AAAAAA6HXLOHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZRGY2TKOJSHE . You are receiving this because you commented.Message ID: @.***>