Closed adamdingliang closed 4 years ago
75 key = hub_id + "--" + tokens[index] # Creating a key for the edge
The cause of the bug is the "--" added to the key. Unexpected, that would split hg19-RP11-453F18--B.1 into two tokens.
Fixed by changing "--" to "----" @Xinhuang1989
nodecn205 rprod bin$ ./create_consensus_network.py -a /research/projects/yu3grp/solidTumor_JY/yu3grp/CSTN/result/RMS/sc_sn/0manuscript/1AnandClustering/1.malignant.SCT.RMS/SJARACNE/ARMSMesoderm_11219_11219_1019/sig/SJARACNE_ARMSMesoderm_11219_11219_1019/SJARACNE_out/ -p 0.01 -e /research/projects/yu3grp/solidTumor_JY/yu3grp/CSTN/result/RMS/sc_sn/0manuscript/1AnandClustering/1.malignant.SCT.RMS/SJARACNE/ARMSMesoderm_11219_11219_1019/ARMSMesoderm_11219_11219_1019.exp -o /research/projects/yu3grp/solidTumor_JY/yu3grp/CSTN/result/RMS/sc_sn/0manuscript/1AnandClustering/1.malignant.SCT.RMS/SJARACNE/ARMSMesoderm_11219_11219_1019/sig/SJARACNE_ARMSMesoderm_11219_11219_1019/SJARACNE_out.final/ INFO:root:Create an initial consensus network ... INFO:root:Done INFO:root:Create an enhanced consensus network ... Traceback (most recent call last): File "/home/lding/.conda/envs/py361_test/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2890, in get_loc return self._engine.get_loc(key) File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'hg19-RP11-453F18'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "./create_consensus_network.py", line 251, in
main()
File "./create_consensus_network.py", line 35, in main
create_enhanced_consensus_network(args.exp_mat, network, args.out_dir, args.subnet)
File "./create_consensus_network.py", line 207, in create_enhanced_consensus_network
exp_symbol_values2 = exp.loc[node2].values
File "/home/lding/.conda/envs/py361_test/lib/python3.6/site-packages/pandas/core/indexing.py", line 1410, in getitem
return self._getitem_axis(maybe_callable, axis=axis)
File "/home/lding/.conda/envs/py361_test/lib/python3.6/site-packages/pandas/core/indexing.py", line 1825, in _getitem_axis
return self._get_label(key, axis=axis)
File "/home/lding/.conda/envs/py361_test/lib/python3.6/site-packages/pandas/core/indexing.py", line 157, in _get_label
return self.obj._xs(label, axis=axis)
File "/home/lding/.conda/envs/py361_test/lib/python3.6/site-packages/pandas/core/generic.py", line 3738, in xs
loc = self.index.get_loc(key)
File "/home/lding/.conda/envs/py361_test/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2892, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 107, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 131, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1607, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1614, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'hg19-RP11-453F18'