Bug in documentation: automodel.get_model_filename() takes five arguments
Hi!
In the documentation https://salilab.org/modeller/9.15/manual/node75.html the signature for automodel.get_model_filename() is declared as
get_model_filename(sequence, id1, id2, file_ext)
But I got the following error: Traceback (most recent call last): File "d:/data/modeller/poly_modeller/ppmod/make_homology_model.py", line 97, in <module> a.make() File "c:\bin\Modeller\modlib\modeller\automodel\automodel.py", line 121, in make self.multiple_models(atmsel) File "c:\bin\Modeller\modlib\modeller\automodel\automodel.py", line 225, in multiple_models self.outputs.append(self.single_model(atmsel, num)) File "c:\bin\Modeller\modlib\modeller\automodel\automodel.py", line 308, in single_model self.pdb_ext) TypeError: get_model_filename() takes exactly 4 arguments (5 given)
Of course one must include self as well, so the following works:
def get_model_filename(self, sequence, id1, id2, file_ext):
Perhaps in the documentation the self could be included as well? It's obvious in hindsight, but still took me 15 minutes to figure out.
Or maybe a quick example could be added: How to move the pdb files into subfolder outdir
class MyModel(automodel): def get_model_filename(self, sequence, id1, id2, file_ext): print self, sequence, id1, id2, file_ext
return "outdir/test-prefix-{id1:02}-{id2:02}{file_ext}".format( id1=id1, id2=id2, file_ext=file_ext)
PS: Is there some way to move all the generated files (including traces and sch and rsr files) into a subfolder? Scanning the sourcecode I see that redefining modfile.default could work.
Thanks & All the best, Ajasja
Regarding the PS: I solved the issue by a well placed os.chdir and some other minor tweaks.
Best, Ajasja
On 23 October 2015 at 16:07, Ajasja Ljubetič ajasja.ljubetic@gmail.com wrote:
> Hi! > > In the documentation > https://salilab.org/modeller/9.15/manual/node75.html the signature for > automodel.get_model_filename() is declared as > > get_model_filename(sequence, id1, id2, file_ext) > > > But I got the following error: > Traceback (most recent call last): > File "d:/data/modeller/poly_modeller/ppmod/make_homology_model.py", line > 97, in <module> > a.make() > File "c:\bin\Modeller\modlib\modeller\automodel\automodel.py", line 121, > in make > self.multiple_models(atmsel) > File "c:\bin\Modeller\modlib\modeller\automodel\automodel.py", line 225, > in multiple_models > self.outputs.append(self.single_model(atmsel, num)) > File "c:\bin\Modeller\modlib\modeller\automodel\automodel.py", line 308, > in single_model > self.pdb_ext) > TypeError: get_model_filename() takes exactly 4 arguments (5 given) > > > Of course one must include self as well, so the following works: > > def get_model_filename(self, sequence, id1, id2, file_ext): > > Perhaps in the documentation the self could be included as well? It's > obvious in hindsight, but still took me 15 minutes to figure out. > > Or maybe a quick example could be added: How to move the pdb files into > subfolder outdir > > class MyModel(automodel): > def get_model_filename(self, sequence, id1, id2, file_ext): > print self, sequence, id1, id2, file_ext > > return "outdir/test-prefix-{id1:02}-{id2:02}{file_ext}".format( > id1=id1, id2=id2, file_ext=file_ext) > > > PS: > Is there some way to move all the generated files (including traces and > sch and rsr files) into a subfolder? Scanning the sourcecode I see that > redefining modfile.default could work. > > > Thanks & All the best, > Ajasja >
On 10/23/2015 07:07 AM, Ajasja Ljubetič wrote: > In the documentation > https://salilab.org/modeller/9.15/manual/node75.html the signature for > automodel.get_model_filename() is declared as > > get_model_filename(sequence, id1, id2, file_ext)
We don't include 'self' in the parameter list for any of the methods, since it's kind of implicit.
> Or maybe a quick example could be added: How to move the pdb files into > subfolder outdir
The better way to do this (as you figured out already) is to cd into outdir. Output files are always deposited in the current directory. You can certainly give a full path for any inputs if you don't want to also put them in that directory.
Ben Webb, Modeller Caretaker
participants (2)
-
Ajasja Ljubetič
-
Modeller Caretaker