dmcskim / kinconform Goto Github PK
View Code? Open in Web Editor NEWMachine learning approach to classifying kinase crystal structure conformations.
Machine learning approach to classifying kinase crystal structure conformations.
Hello,
I'm trying to run your tool on an extensive collection of PK domains.
However, loading the model via pickle.load
I'm having an issue. Below is the code reproducing the problem.
In [1]: path = './model/imputer_and_model.p'
In [2]: from pickle import load
In [3]: with open(path, 'r') as f:
...: model = load(f)
...:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-8d499f3e1102> in <module>()
1 with open(path, 'r') as f:
----> 2 model = load(f)
3
/home/edik/miniconda3/envs/test/lib/python2.7/pickle.pyc in load(file)
1382
1383 def load(file):
-> 1384 return Unpickler(file).load()
1385
1386 def loads(str):
/home/edik/miniconda3/envs/test/lib/python2.7/pickle.pyc in load(self)
862 while 1:
863 key = read(1)
--> 864 dispatch[key](self)
865 except _Stop, stopinst:
866 return stopinst.value
/home/edik/miniconda3/envs/test/lib/python2.7/pickle.pyc in load_global(self)
1094 module = self.readline()[:-1]
1095 name = self.readline()[:-1]
-> 1096 klass = self.find_class(module, name)
1097 self.append(klass)
1098 dispatch[GLOBAL] = load_global
/home/edik/miniconda3/envs/test/lib/python2.7/pickle.pyc in find_class(self, module, name)
1128 def find_class(self, module, name):
1129 # Subclasses may override this
-> 1130 __import__(module)
1131 mod = sys.modules[module]
1132 klass = getattr(mod, name)
ImportError: No module named sklearn.preprocessing.imputation
Note that scikit-learn
isn't specified as a kinconform
dependency.
I'm not familiar with how pickle
works internally. Maybe the problem arises due to me not installing the package? I'm trying to set up external IO management while using the imported do_one
function for (potentially parallel) high-throughput inference.
Any help will be appreciated.
EDIT:
So I've managed to solve this problem by just installing an older version of scikit-learn
. Currently, I'm on version 0.17.1
(the oldest one available on conda-forge). However, some parameters were changed, which, again, doesn't allow loading the model. I'm attaching the traceback below.
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-3-d171d5e53113> in <module>()
----> 1 do_one(args=ARGS(['./kinconform/test/2gs2.pdb', './kinconform/test/4afj.pdb'], './kinconform/'))
/home/edik/Projects/composing_the_dataset/kinconform/kinconform.py in do_one(args)
172
173 #load models
--> 174 imp,model = pickle.load(open(basedir+'model/imputer_and_model.p','rb'), encoding='bytes')
175 scaler = pickle.load(open(basedir+'model/scaler.p','rb'))
176
sklearn/tree/_tree.pyx in sklearn.tree._tree.Tree.__setstate__ (sklearn/tree/_tree.c:7343)()
KeyError: 'node_count'
I tried other versions of the scikit-learn
(0.19, 0.18, 0.20), but similar problems arise. Thus, it would be helpful to know which version did you use. Thanks.
Hi dmcskim
We are still getting errors when running the kinconform make test
makefile.
$ make all
python ../kinconform 2gs2.pdb 4afj.pdb --base ../ > test.out
Traceback (most recent call last):
File "../kinconform", line 180, in <module>
results = do_one(args)
File "../kinconform", line 151, in do_one
mapping = align_and_map_fasta('pdbs.fasta', positions, basedir)
File "../kinconform", line 84, in align_and_map_fasta
mapping = make_mapfile(fasta+'_aln.cma',positions)
File "../kinconform", line 31, in make_mapfile
posn = positions[sequence['id']]
KeyError: '4afj.pdb'
Makefile:14: recipe for target 'test' failed
make: *** [test] Error 1
It appears that the source of the error has something to do with conflicting names of the sequences in the file pdbs.fasta_aln.cma, which are "2gs2.pdb" and "4afj.pdb", while the dictionary keys include both the filename and chain information: ['2gs2.pdb_<Residue ILE, 994>', '4afj.pdb_<Residue SER, 222>']
Hi,
I am interested by your tools, but unfortunately when a want to use it against the structure 1atp (rename here test1atp.pdb) I get the following error:
kinconform test1atp.pdb
Traceback (most recent call last):
File "/bin/kinconform", line 169, in <module>
results = do_one(args)
File "/bin/kinconform", line 133, in do_one
temp,posn = get_sequence(x)
File "/bin/kinconform", line 55, in get_sequence
chains = [x.name for x in prot.segments]
File "/usr/lib64/python2.7/site-packages/MDAnalysis/core/groups.py", line 2709, in __getattr__
"".format(cls=self.__class__.__name__, attr=attr))
AttributeError: Segment has no attribute name
Any idea ? could you provide the exact version of each dependencies ? I suspect an issue with version of MDAnalysis.
For your intention I have install the last MDAnalysis version using pip
pip install --upgrade MDAnalysis
Collecting MDAnalysis
Downloading MDAnalysis-0.16.2.tar.gz (2.6MB)
100% |████████████████████████████████| 2.6MB 285kB/s
Sincerely
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.