gattia / pyfocusr

MIT License
7 stars 0 forks source link

module 'cycpd' has no attribute 'deformable_registration' #1

Closed nuwanarti closed 4 years ago

nuwanarti commented 4 years ago

I have installed cycpd. I'm using macos Catalina. and also I have tried to run this on ubuntu as well, but the same error was there

AttributeError                            Traceback (most recent call last)
<ipython-input-12-796a4f10423b> in <module>
 reg.align_maps()

pyfocusr/examples/pyfocusr/focusr.py in align_maps(self)

            print_header('Non-Rigid (Deformable) Registration Beginning')
            self.register_target_to_source('deformable')

            self.get_initial_correspondences()

pyfocusr/examples/pyfocusr/focusr.py in register_target_to_source(self, reg_type)
        def register_target_to_source(self, reg_type='deformable'):
            if reg_type == 'deformable':
             reg = cycpd.deformable_registration(**{
                    'X': self.source_spectral_coords[
                         self.graph_source.get_list_rand_idxs(self.n_coords_spectral_registration), :],

AttributeError: module 'cycpd' has no attribute 'deformable_registration'
gattia commented 4 years ago

The error is one that is being thrown by cycpd and not pyfocusr.

Im assuming that you installed cycpd from here: https://github.com/gattia/cycpd

One thing to note about cycpd, make sure that cython is installed first before building cycpd. It you dont have cython installed it will install, but wont run properly. Once you've done that, then maybe run one or two of the examples in cycpd to make sure that it is installed and working properly on your system. Even just entering a python shell, importing cycpd and ensuring that you can load it and it has the deformable_registration should be enough. Something like

python 

import cycpd
cycpd.deformable_registration

The above should print out something like:

<class 'cycpd.deformable_registration.deformable_registration'>

If you get that working, then pyfocusr should work(based on this error). If it doesn't, then let me know and I'll try to help debug further.

Last note, I would use the development branch of pyfocusr instead of the master. I made a few changes when things crashed and haven't pushed them to master yet.

Keep me posted on how it goes! I'm actually surprised someone has found and is trying this out. I'm open and interested in any feedback you might have.

gattia commented 4 years ago

Also! I noticed that your file structure from your call-back seems a bit odd. You seem to have the package itself within the examples folder.

pyfocusr/examples/pyfocusr/focusr.py in align_maps(self)

I would have expected something like:

pyfocusr/pyfocusr/focusr.py in align_maps(self)

I could be missing something, but if you don't mind sharing the code you are trying to run or anything custom/different that you may have done as this could be having an effect - though, I doubt it because the problem is with cycpd and not pyfocusr.

nuwanarti commented 4 years ago

Hi Gattia, Thankyou very much for your help. Previously I tried to install cycpd inside the Jupiter kernel. apparently there was some problem, instead of the installed package it had imported cycpd from the directory. This time I installed the package globally instead of installing it inside the kernel. Now all the things working fine. Thankyou very much for your support.

And also I went through the focusr paper. My goal here is to assess the feasibility of adapting this algorithm into Structural bioinformatics, Thankyou for very much for the effort you have put into implementing this

gattia commented 4 years ago

No problem! Happy to help. I dont know much of anything about structural bioinformatics, but glad to see that this is at least of some use to someone.

As I said, I'm open to any insights or feedback, and definitely keep reporting issues. If anything isn't clear, parameters don't make sense, etc. please leave an issue and I will try to address them so that I can improve the package.