Skip to content

TypeError: 'method' object is not subscriptable #14

@stolltho

Description

@stolltho

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions