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: 'DataFrame' objects are mutable, thus they cannot be hashed #2

Open
DlisKeepOnGoing opened this issue Apr 28, 2018 · 3 comments

Comments

@DlisKeepOnGoing
Copy link

When I run the pyNBS in my pc, some problem occurred in the file of network_propagation.py. It says "TypeError: 'DataFrame' objects are mutable, thus they cannot be hashed". I figure out the problem in the code "binary_matrix_filt = np.array(binary_matrix.T.ix[subgraph_nodes].fillna(0).T)", can you tell why?

@justinkhuang
Copy link
Collaborator

What version of NetworkX do you have installed? I believe that this may be an issue if you are using NetworkX v2.0+. In this case, you may want to try to explicitly change the lines setting subgraph_nodes to return a list similarly to how the subgraph nodelists are defined in the network_kernel_propagation() function

@DlisKeepOnGoing
Copy link
Author

Thank you so much! I've already changed subgraph_nodes to a list type. Then the problem has been solved. But there is another question,it seems that there is no mapping file in the pyNBS different from the matlab code. It means that the mutation_files must be processed in advance. For example, one line of the OV_sm_data.txt,'TCGA-04-1331 ABHD13', we need to change it to 'TCGA-04-1331 ENSG0000000xxxx'.Otherwise it will report an error "ValueError: No mutations found in network nodes. Gene names may be mismatched.".So it is not feasible to run pyNBS directly with the files you provide.

@justinkhuang
Copy link
Collaborator

Hi Dailu,
Sorry for the very delayed reply on this issue. Unfortunately, as you suggested this is the case if you would like to use your own network or mutation data. We did not want to make any decisions for the user in this case if the user has any particular preferences. If you need some scripts helping with converting gene name symbols, I have some helper functions that you may be able to hack together/borrow code from in the gene_conversion_tools module.

Gene names across different naming systems often are not mapped one-to-one, making automatic conversion between gene symbol types a non-trivial task, so we left much of that decision making to the user in this case.

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