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

modeling_create_smoment_model cannot handle 'NoneType' objects #1

Closed
handancetin opened this issue Feb 3, 2020 · 2 comments
Closed

Comments

@handancetin
Copy link

Hello,

This might be a bit early to report an issue, however I am really interested in the construction of an enzyme constrained model for yeast using autopacmen. Even though I am not very familiar with the python environment, I was able to follow your manual up to some point (thank you for the clear explanations!), unfortunately I've encountered several small errors that you might want to fix since you consider the autopacmen as an extension for cobrapy:

(skip bullets for the main question)

  • All scripts with data_parse_ in their names (except data_parse_bigg_metabolites_file) require an output file to be in the path beforehand. They overwrite the file, but throw an error about the path if file is not there in the first place.
  • In the manual, part usage: data_parse_brenda_textfile.py example uses a different script data_parse_bigg_metabolites_file. This is probably a copy/paste typo.
  • The argument type_of_kcat_selection is missing in the function get_reactions_kcat_mapping() in the script modeling_get_reactions_kcat_mapping. I was able to add the parameter and continue without a problem.
  • data_create_combined_kcat_database asks for a "BRENDA path" input instead of an "output path" if you run the python script without parameters in the terminal.
  • Similar to previous one, modeling_create_smoment_model, asks an input for "SBML name" for a second time, instead of "excluded reactions".

This was the point that I could not continue further because I got several errors in modeling_create_smoment_model. As you can see from the title, it throws an error for my model:

File "~/autopacmen/autopacmen/submodules/helper_general.py", line 243, in get_float_cell_value
    cell_value = cell_value.replace(",", ".")
AttributeError: 'NoneType' object has no attribute 'replace'

I have obtained this error using Python 3.7.5 on Linux (Ubuntu 18.04.4 LTS). I have tried to modify get_float_cell_value to bypass replace for NoneType objects, unfortunately my solutions failed in the downstream (mostly in the function add_prot_pool_reaction). As I mentioned before, I am not good at Python programming, so my solutions can be considered weak. There are several metabolites and enzymes in my model that no information available in the databases (retrival scripts showed NA's and warnings for them). I believe these should not cause a problem, therefore I am asking for a solution.

Sorry if I am not clear or went wrong. I hope these small problems I reported above help you to enhance autopacmen and you can provide a generalized solution for my problem soon.

Thank you in advance,
Handan

Paulocracy pushed a commit that referenced this issue Feb 4, 2020
@Paulocracy
Copy link
Member

Hello Handan \o/

Thank you for reporting the helpful issue :D

Regarding the minor bullet point issues:

  1. The data_parse_ scripts should only throw an error if the given output file path contains a non-existing folder (please correct me if the scripts show a different behavior). I just didn't think of mentioning it as it is typical Python file operation behavior, and I just added the information to the manual.
  2. That's indeed a typo, I corrected it in the manual and the associated code documentation.
  3. That's indeed a mistake in the code, I added the corresponding argument.
  4. & 5. I just corrected these typos in the code, too.

All these changes can be found in today's new autopacmen release.

Regarding the major issue:

The error arises when at least one value in missing in one of the given model-associated XLSX files. In order to see where the error occurs, it would be helpful if you could report the full error stack trace, i.e. all other error lines before the one that you included in the issue.

Kind regards :-)
P.S.B.

Paulocracy pushed a commit that referenced this issue Nov 23, 2020
Merge upstream changes in autopacmen to this branch
@Paulocracy
Copy link
Member

Paulocracy commented Mar 23, 2022

Closing due to inactivity (of which I'm also guilty of :3) and since the remaining issue was probably related to an already fixed faulty generation of initial spreadsheets.

Paulocracy pushed a commit that referenced this issue Jul 13, 2022
Merge updates from klamt-lab
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

2 participants