Using an alignment object in automodel
Hello all, I was wondering if there was a trick to using an alignment object produced by alingment.salign() in an automodel. My current method writes the alignment to a file and then re-reads it with automodel. This is extremely clunky but based on the docs it seems the only way to go.
Current Example:
env = environ() aln = alignment(env) mdl = model(env, file = '1OPN') #The pdb model I'm using for this example. aln.append_model(mdl, align_codes = '1OPN', atom_files = '1OPN') aln.append(file = 'hiv.fasta', align_codes = 'all', alignment_format = 'fasta')
aln.salign(gap_function = True)
aln.write('tempfile.ali') #write the file
a = automodel(env, alnfile = 'tempfile.ali', sequence = 'hiv', knowns = '1OPN') #read it back in a.make()
As I expand this using the parrellel toolbox it becomes difficult to manage filenames, etc. If there was a way to just pass in the alignment object to automodel then life would be much easier.
Thanks for the help
Will
On 02/15/2010 09:56 AM, Will Dampier wrote: > I was wondering if there was a trick to using an alignment object > produced by alingment.salign() in an automodel. > My current method writes the alignment to a file and then re-reads it > with automodel. This is extremely clunky but based on the docs it > seems the only way to go.
Yes, unfortunately that is currently the only way to do it. There are various parts of the automodel code that read in part or all of the alignment file (e.g. auto_align, final_malign3d). It wouldn't be impossible to make them work with alignment objects instead, but it would be hard to do it without breaking existing code. I'll add it as a wishlist item.
> As I expand this using the parrellel toolbox it becomes difficult to > manage filenames, etc.
True, although you can use Python's tempfile module to handle this for you automatically.
Ben Webb, Modeller Caretaker
participants (2)
-
Modeller Caretaker
-
Will Dampier