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

TypeError: 'method' object is not subscriptable #14

Open
stolltho opened this issue Jun 3, 2021 · 0 comments
Open

TypeError: 'method' object is not subscriptable #14

stolltho opened this issue Jun 3, 2021 · 0 comments

Comments

@stolltho
Copy link

stolltho commented Jun 3, 2021

Hi there.
I wanted to run your Jupyter NB w/ your test data, however, executing

annotate_adducts(graphs, db_out, ppm, lib_adducts)
df_out = summary(df, db_out)
print(df_out)

resulted in the following error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-5b48a2fbb04c> in <module>
----> 1 annotate_adducts(graphs, db_out, ppm, lib_adducts)
      2 df_out = summary(df, db_out)
      3 print(df_out)

c:\ProgramData\Anaconda3\lib\site-packages\beamspy\annotation.py in annotate_adducts(source, db_out, ppm, lib, add)
    394     if isinstance(source, list) and len(source) > 0 and isinstance(source[0], nx.classes.digraph.DiGraph):
    395         for i, graph in enumerate(source):
--> 396             for assignment in _annotate_pairs_from_graph(graph, lib_pairs=lib_pairs, ppm=ppm, charge=None):
    397                 cursor.execute("""INSERT OR REPLACE into adduct_pairs (peak_id_a, peak_id_b, 
    398                                label_a, label_b,

c:\ProgramData\Anaconda3\lib\site-packages\beamspy\annotation.py in _annotate_pairs_from_graph(G, ppm, lib_pairs, charge)
    167     for e in G.edges(data=True):
    168 
--> 169         mz_x = G.nodes[e[0]]["mz"]
    170         mz_y = G.nodes[e[1]]["mz"]
    171 

TypeError: 'method' object is not subscriptable

Help is appreciated.

Cheers,
Thomas

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