From: Alexandre Suman de Araujo (asaraujo_at_if.sc.usp.br)
Date: Thu Mar 11 2010 - 12:04:44 CST

Axel Kohlmeyer escreveu:
> On Wed, 2010-03-10 at 09:03 -0300, Alexandre Suman de Araujo wrote:
>
>> Hi Axel
>>
>
> hi alexandre,
>

Hi again Axel :-)

>
>> The second suggestion worked very well.
>>
>
> thanks, that is very good to know. please check carefully.
> since the topotools package is still fairly new and bugs
> tend to surface occasionally. i tried hard to write conservative
> code, but there is always a good chance that somebody tries
> something that i never had throught of before.
>
>
>> But the use of mergestructs package resulted in problems. When I try to
>> use the following command:
>>
>> mergestructs {file1.psf file1.pdb} {file2.psf file2.pdb} file3
>>
>> I have the following error
>>
>> wrong # args: should be "mergestructs"
>>
>>
>> When I try to call mergestructs without parameters, the GUI interface is
>> opened.
>> I tried to find the correct syntax but I have not success.
>> Do you mind what is happening?
>>
>
> yes. this was of course a cunning plan to promote my plugin. ;-)
>
> in reality, it was my fault. i made a mistake when looking up
> the script code for mergestructs. what you have to call is
> ::MergeStructs::mergeMolecules instead of mergestructs
>
> if you look closely at the tcl/tk code for the mergstructs plugin,
> then you'll see that the majority of it is just to generate the GUI.
> the "real" code is just this one function and it is a fairly
> short one. in any case, i think it is good to have multiple
> options.
>
>
> cheers,
> axel.
>
>
Like I said, the code using topotool worked perfectly, but to have a
second option I tried to implement the code using mergestructs package.
I changed the first code you propose to fit to your last message but I'm
having a strange behavior.
When I run the following script:

#Load package
package require mergestructs 1.0
namespace import MergeStructs::*

::MergeStructs::mergeMolecules {caixa_membrana.psf caixa_membrana.pdb}
{colesterol.psf colesterol.pdb} popc_1chol

#Bye
exit

Using "vmd -dispdev text -e merge_strucs.tcl" I have the following error:

invalid command name "psfcontext"

When I run it with "vmd -e merge_strucs.tcl", everything works fine.

I don´t know why this is happening. Maybe it is because when I run vmd
in graphical mode there are packages that are loaded by default and in
text mode not, but this is just a guess.
Do you know what is really happening?

Cheers

>> Cheers
>>
>> **************************************************************
>> Alexandre Suman de Araujo *
>> Faculdade de Ciências Farmacêuticas de Ribeirão Preto *
>> Universidade de São Paulo *
>> Dep. de Física e Química *
>> Grupo de Física Biológica * e-mail: asaraujo_at_fcfrp.usp.br*
>> Av. do Café, s/n° * e-mail: ale.suman_at_gmail.com *
>> CEP: 14040-903 * Phone: +55 (16) 3602-4172 *
>> Ribeirão Preto, SP, Brasil * Phone: +55 (16) 3602-4222 *
>> **************************************************************
>>
>>
>>
>> Axel Kohlmeyer escreveu:
>>
>>> hi alexandre,
>>>
>>> On Tue, Mar 9, 2010 at 1:24 PM, Alexandre Suman de Araujo
>>> <asaraujo_at_if.sc.usp.br> wrote:
>>>
>>>
>>>> Hi all.
>>>>
>>>> Is it possible to use MergeStructs plugin in Tk console or scripts?
>>>>
>>>>
>>> yes.
>>>
>>>
>>>
>>>> If yes, which is the sintax should I use?
>>>>
>>>>
>>> package require megstructs 1.0
>>> namespace import Mergestructs::*
>>>
>>> mergestructs {file1.psf file1.pdb} {file2.psf file2.pdb} file3
>>>
>>> that would require having the two molecules as external files.
>>>
>>> if you want to do this with internal data (perhaps after modifying
>>> bonding or atom types/names/coordinates) you can also try
>>>
>>> package require topotools 1.0
>>> namespace import TopoTools::mergemols
>>>
>>> set newmol [mergemols {0 1 2}]
>>>
>>> animate write psf file3.psf $newmol
>>> animate write pdb file3.pdb $newmol
>>>
>>> there are a few small improvements in the topotools package
>>> since vmd 1.8.7, so if you don't want to update to the latest
>>> VMD alpha version, you can download the updated package
>>> by itself from
>>>
>>> https://sites.google.com/site/akohlmey/software/topotools
>>>
>>> mergestructs uses psfgen and topotools uses the internal
>>> information that VMD has after loading a psf or similar topology
>>> format. so depending on what you are doing one of the two
>>> may be the better solution.
>>>
>>> cheers,
>>> axel.
>>>
>>>
>>>
>>>> Cheers
>>>>
>>>> --
>>>> **************************************************************
>>>> Alexandre Suman de Araujo *
>>>> Faculdade de Ciências Farmacêuticas de Ribeirão Preto *
>>>> Universidade de São Paulo *
>>>> Dep. de Física e Química *
>>>> Grupo de Física Biológica * e-mail: asaraujo_at_fcfrp.usp.br*
>>>> Av. do Café, s/n° * e-mail: ale.suman_at_gmail.com *
>>>> CEP: 14040-903 * Phone: +55 (16) 3602-4172 *
>>>> Ribeirão Preto, SP, Brasil * Phone: +55 (16) 3602-4222 *
>>>> **************************************************************
>>>>
>>>>
>>>>
>>>
>>>
>>>
>
>