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

NameError: name 'atom2mass' is not defined #2

Open
MarcIsak opened this issue Jul 26, 2022 · 2 comments
Open

NameError: name 'atom2mass' is not defined #2

MarcIsak opened this issue Jul 26, 2022 · 2 comments

Comments

@MarcIsak
Copy link

MarcIsak commented Jul 26, 2022

Hi,

I am using Python 3.6.15 in Ubuntu 20.04 (Running inside a Docker container). The packages that I use are listed in the attached text file
packages_python.txt

I want to generate evidence/msms/peptide files from a Prosit spectral library that I have. However, when I run the following command:

python3.6 postprocess/main.py prosit postprocess/parameters.json

I get the error NameError: name 'atom2mass' is not defined. The full error log:

Using TensorFlow backend.
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:521: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
File "postprocess/main.py", line 175, in
class Spectrum:
File "postprocess/main.py", line 219, in Spectrum
for aa, formula in aa2formula.items()}
File "postprocess/main.py", line 219, in
for aa, formula in aa2formula.items()}
File "postprocess/main.py", line 218, in
aa2mass = {aa: (sum([atom2mass[atom] * cnt for atom, cnt in formula.items()]) - 2 * atom2mass['H'] - atom2mass['O'])
NameError: name 'atom2mass' is not defined

Any idea what could be wrong here?

Best,

Marc

@AnStaes
Copy link

AnStaes commented Feb 14, 2023

Hi,
I have the same problem. Any solution for this?

Thank you!
An

@temaia
Copy link

temaia commented Feb 16, 2023

We ended up solving the error by adding a pre-calculated aa2mass object to the script and commenting out the original list comprehension line used to calculate aa2mass.

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

3 participants