Giter VIP home page Giter VIP logo

kinconform's People

Contributors

esbg avatar

Watchers

 avatar  avatar

kinconform's Issues

ImportError while trying to load the model

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.

make test gives "KeyError: '4afj.pdb'"

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>']

AttributeError: Segment has no attribute name

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.