[PyMOL] How to read the alignment object

2021-02-23 Thread Pedro Lacerda
Hi,

I aligned my structures with the align command and the object argument. So
I got an alignment object.

But how can I read this data structure?

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] How to edit a volume field?

2020-11-09 Thread Pedro Lacerda
I'm afraid that it isn't the correct answer because I got IndexError (out
of bonds), I fixed by subtracting 1 after rounding.

Anyway these modifications get off-by-1 errors in a high resolution grid,
but the real error is the misalignment between atoms positions and volume
densities.



Em seg., 9 de nov. de 2020 às 05:53, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

> Hi Pedro,
>
> Try these two changes:
>
> # shape - 1
> xinc, yinc, zinc = (
> abs(xmax - xmin) / (field.shape[0] - 1),
> abs(ymax - ymin) / (field.shape[1] - 1),
> abs(zmax - zmin) / (field.shape[2] - 1),
> )
>
> # position rounding by +0.5
> idx = (
> int((at.coord[0] - xmin) / xinc + 0.5),
> int((at.coord[1] - ymin) / yinc + 0.5),
> int((at.coord[2] - zmin) / zinc + 0.5),
> )
>
>
> Cheers,
>   Thomas
>
>
> > On Nov 8, 2020, at 11:20 AM, Pedro Lacerda  wrote:
> >
> > Hi,
> >
> > I'm using `cmd.get_volume_field(copy=0)` to edit maps. Each grid cell
> must increase by 1 each time the condition `atom.text_type in atomtypes` is
> met.
> >
> > But something went wrong and the map mesh didn't align with the atoms.
> >
> > `ensemble.selection` and `obj` spawns atoms in the exact same positions.
> >
> >
> >
> > map_obj = prefix + "." + title
> > pm.map_new(map_obj, type="vdw", selection=ensemble.selection)
> > field = pm.get_volume_field(map_obj, copy=0)
> > if -1 is field:
> > colorprinting.error("Unable to get volume field.")
> > continue
> > xinc, yinc, zinc = (
> > abs(xmax - xmin) / field.shape[0],
> > abs(ymax - ymin) / field.shape[1],
> > abs(zmax - zmin) / field.shape[2],
> > )
> > field[:] = 0
> > for at in pm.get_model(obj).atom:
> > if at.text_type in atomtypes:
> > idx = (
> > int((at.coord[0] - xmin) / xinc)-1,
> > int((at.coord[1] - ymin) / yinc)-1,
> > int((at.coord[2] - zmin) / zinc)-1,
> > )
> > field[idx] += 1
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular / UFBA
> > Mestrando em Ciências Farmácias / UEFS
> >
> > @pslacerda
> > +55 71 9 9981-1856
> > http://lattes.cnpq.br/8338596525330907
> > ___
> > PyMOL-users mailing list
> > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> > Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] How to get the object name from chempy.Atom

2020-11-09 Thread Pedro Lacerda
Thank you, Thomas!

Em seg., 9 de nov. de 2020 às 06:29, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

> Hi Pedro,
>
> chempy.Atom doesn't store model and state. The only option I can think of
> right now is to use a custom property (Incentive PyMOL feature, won't work
> in Open-Source PyMOL):
>
> cmd.alter('all', 'p.model = model')
> print(cmd.get_model('all').atom[0].atom_properties['model'])
>
> Or maybe you can do the same thing with cmd.iterate_state, consider the
> following two approaches to the same problem:
>
> # using get_model
> for state in range(1, cmd.count_states() + 1):
> for at in cmd.get_model("all", state):
> print(at.coord)
> print(at.text_type)
> print(at.atom_properties['model'])
> print(state)
>
> # using iterate or iterate_state
> def callback(x, y, z, text_type, model, state):
> print((x, y, z))
> print(text_type)
> print(model)
> print(state)
> cmd.iterate_state(0, "all", "callback(x,y,z,text_type,model,state)",
>   space={"callback": callback})
>
>
> Hope that helps.
>
> Cheers,
>   Thomas
>
>
> > On Nov 6, 2020, at 6:29 PM, Pedro Lacerda  wrote:
> >
> > Hi,
> >
> > I got an `chempy.Atom` instance via `cmd.get_model().atom`.
> >
> > How to get the state and object name.
> >
> >
> > Thank you!
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular / UFBA
> > Mestrando em Ciências Farmácias / UEFS
> >
> > @pslacerda
> > +55 71 9 9981-1856
> > http://lattes.cnpq.br/8338596525330907
> > ___
> > PyMOL-users mailing list
> > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> > Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] How to edit a volume field?

2020-11-08 Thread Pedro Lacerda
Hi,

I'm using `cmd.get_volume_field(copy=0)` to edit maps. Each grid cell must
increase by 1 each time the condition `atom.text_type in atomtypes` is met.

But something went wrong and the map mesh didn't align with the atoms.

`ensemble.selection` and `obj` spawns atoms in the exact same positions.



map_obj = prefix + "." + title
pm.map_new(map_obj, type="vdw", selection=ensemble.selection)
field = pm.get_volume_field(map_obj, copy=0)
if -1 is field:
colorprinting.error("Unable to get volume field.")
continue
xinc, yinc, zinc = (
abs(xmax - xmin) / field.shape[0],
abs(ymax - ymin) / field.shape[1],
abs(zmax - zmin) / field.shape[2],
)
field[:] = 0
for at in pm.get_model(obj).atom:
if at.text_type in atomtypes:
idx = (
int((at.coord[0] - xmin) / xinc)-1,
int((at.coord[1] - ymin) / yinc)-1,
int((at.coord[2] - zmin) / zinc)-1,
)
field[idx] += 1


-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] How to get the object name from chempy.Atom

2020-11-06 Thread Pedro Lacerda
Hi,

I got an `chempy.Atom` instance via `cmd.get_model().atom`.

How to get the state and object name.


Thank you!

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Detect library mode

2020-11-02 Thread Pedro Lacerda
My plugin fail in library mode because it tries to add a Qt menu. Just an
error message appears.

If there is two init functions, one for GUI and other for CL, would work.

__init_plugin__
__init_gui_plugin__

Em ter, 27 de out de 2020 21:00, Pedro Lacerda 
escreveu:

> Hi,
>
> How to detect if we are in the library mode or on the GUI mode?
>
> --
> Pedro Sousa Lacerda
>
> Laboratório de Bioinformática e Modelagem Molecular / UFBA
> Mestrando em Ciências Farmácias / UEFS
>
> @pslacerda
> +55 71 9 9981-1856
> http://lattes.cnpq.br/8338596525330907
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] Detect library mode

2020-10-27 Thread Pedro Lacerda
Hi,

How to detect if we are in the library mode or on the GUI mode?

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] pref_get() on library mode

2020-10-26 Thread Pedro Lacerda
It worked like a charm, thank you.

Em seg., 26 de out. de 2020 às 04:37, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

> Hi Pedro,
>
> If you call `plugin_load` that will trigger initialization.
>
> pymol.plugins.plugin_load('yourplugin')
> value = pymol.plugins.pref_get('YOUPLUGIN_SOME_KEY')
>
>
> I feel like this plugin API is due for an overhaul, there are no great
> answers to your various questions :-/
>
> Cheers,
>   Thomas
>
>
> > On Oct 26, 2020, at 5:40 AM, Pedro Lacerda  wrote:
> >
> > Hi,
> >
> > How to use pref_get() on library mode.
> >
> > Or even better, how to use pref_get() even before library mode?
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular / UFBA
> > Mestrando em Ciências Farmácias / UEFS
> >
> > @pslacerda
> > +55 71 9 9981-1856
> > http://lattes.cnpq.br/8338596525330907
> > ___
> > PyMOL-users mailing list
> > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> > Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] pref_get() on library mode

2020-10-25 Thread Pedro Lacerda
Hi,

How to use pref_get() on library mode.

Or even better, how to use pref_get() even before library mode?

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Formatted output

2020-10-25 Thread Pedro Lacerda
I see that probably you are using HTML for this.
https://github.com/schrodinger/pymol-open-source/blob/69b1f0b53b4109c34604adcea3983e4d3886069e/modules/pymol/colorprinting.py

But printing HTML directly into the console didn't worked.

Em dom., 25 de out. de 2020 às 23:06, Pedro Lacerda 
escreveu:

> Hi,
>
> How can I print formatted output into the PyMOL console?
>
> I see that on the incentive version the output is coloured (eg errors are
> red).
>
>
> --
> Pedro Sousa Lacerda
>
> Laboratório de Bioinformática e Modelagem Molecular / UFBA
> Mestrando em Ciências Farmácias / UEFS
>
> @pslacerda
> +55 71 9 9981-1856
> http://lattes.cnpq.br/8338596525330907
>


-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] Formatted output

2020-10-25 Thread Pedro Lacerda
Hi,

How can I print formatted output into the PyMOL console?

I see that on the incentive version the output is coloured (eg errors are
red).


-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] Command varargs

2020-07-30 Thread Pedro Lacerda
Hi,

How can I accept variable arguments in my command? My first attempt was:

@pm.extend
def func(*args, kw1=1, kw2=True):
  pass


-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] User data

2020-07-16 Thread Pedro Lacerda
Hi,

I opted for

> This works on all platforms:
> os.path.expanduser("~/.pymol/myplugindata")
>

And it is working here:
https://github.com/pslacerda/pymol-labimm/blob/f8d4906f89c0cae3f6c5b504cc78a9bbf70565d1/pymol_labimm/prefs.py#L40


Em seg., 15 de jun. de 2020 às 05:08, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

> Hi Pedro,
>
> There is no designated infrastructure for this. Other plugins typically
> create their own directory in the user's home folder, like
> "~/.myplugindata". You could also create it inside the "~/.pymol" directory
> (like "~/.pymol/myplugindata").
>
> This works on all platforms:
> os.path.expanduser("~/.pymol/myplugindata")
>
> On Windows, you could also put it inside the %APPDATA% directory:
> os.path.join(os.environ['APPDATA'], 'pymol', 'myplugindata')
>
>
> Let me know how you decide or if you have other ideas!
>
> Cheers,
>   Thomas
>
>
> > On Jun 9, 2020, at 10:20 PM, Pedro Lacerda  wrote:
> >
> > Hi PyMOL users and developers,
> >
> > I have a plugin that needs to download data periodically. Where should I
> download to?
> >
> > By the way, I managed to get a plugin into a python package.
> >
> >
> https://github.com/pslacerda/pymol-labimm/blob/master/scripts/pymol_labimm.py
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular
> > Faculdade de Farmácia / UFBA
> >
> > @pslacerda
> > +55 71 9 9981-1856
> > http://lattes.cnpq.br/8338596525330907
> > ___
> > PyMOL-users mailing list
> > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> > Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] How to count the number of molecules in a selection?

2020-07-10 Thread Pedro Lacerda
Thank you!

Em qui., 9 de jul. de 2020 às 18:40, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

> @cmd.extend
> def count_molecules(selection="all", quiet=0):
> tmpsele = cmd.get_unused_name("_tmp")
> count = 0
> if cmd.select(tmpsele, selection):
> count += 1
> while cmd.select(tmpsele, f'{tmpsele} &! bm. first {tmpsele}'):
> count += 1
> cmd.delete(tmpsele)
> if not int(quiet):
> print(f' Number of molecules: {count}')
> return count
>
> Cheers,
>   Thomas
>
>
> > On Jul 9, 2020, at 9:52 PM, Pedro Lacerda  wrote:
> >
> > ... via programming
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular
> > Faculdade de Farmácia / UEFS
> >
> > @pslacerda
> > +55 71 9 9981-1856
> > http://lattes.cnpq.br/8338596525330907
> > ___
> > PyMOL-users mailing list
> > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> > Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular / UFBA
Mestrando em Ciências Farmácias / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] How to count the number of molecules in a selection?

2020-07-09 Thread Pedro Lacerda
... via programming

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UEFS

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] cmd.get_fastastr()

2020-07-07 Thread Pedro Lacerda
Thank you for this pearl.

Em ter., 7 de jul. de 2020 às 11:23, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

> Hi Pedro,
>
> I would probably just count CA atoms. Something like this:
>
> # Check nearby peptides
> tmpsele = pm.get_unused_name("_tmp")
> pm.select(tmpsele, f"({sim_pdb} and polymer) within 5 of "
> f"({entry.pdb_id} and (bysegi resid {entry.ligand_resid} "
> f"and chain {entry.ligand_chain}))")
> for chain in pm.get_chains(tmpsele):
> if pm.count_atoms(f"guide & bs. ({tmpsele} & chain {chain})") <= 25:
> pm.delete(sim_pdb)
> is_apo = False
>     break
> pm.delete(tmpsele)
>
>
> Cheers,
>   Thomas
>
>
> > On Jul 6, 2020, at 10:59 PM, Pedro Lacerda  wrote:
> >
> > I used the function to check if the fasta is smaller than 25 characters.
> If it is then it is a peptide:
> >
> https://github.com/pslacerda/pymol-labimm/blob/master/scripts/peptbase/create.py#L186
> >
> > There is another way to check for peptides using only selection?
> >
> > Em seg., 6 de jul. de 2020 às 02:47, Thomas Holder <
> thomas.hol...@schrodinger.com> escreveu:
> > Hi Pedro,
> >
> > cmd.get_fastastr() always returned a FASTA formatted string. What
> changed in PyMOL 2.2 is that it now creates a record for every chain, not
> just for every object. There is a new "key" argument, you get the old
> behavior with key="model".
> >
> > print(cmd.get_fastastr(key="model"))
> >
> > If you actually want the plain sequence and not the fasta formatted
> string, then I suggest you use a function like this:
> >
> > def get_sequence(selection='all'):
> > return ''.join(L.strip() for L in
> cmd.get_fastastr(selection).splitlines()
> >if not L.startswith('>'))
> >
> >
> > Cheers,
> >   Thomas
> >
> >
> > > On Jul 4, 2020, at 5:17 PM, Pedro Lacerda  wrote:
> > >
> > > Hi,
> > >
> > > The get_fastastr function changed. Before it returned the aminoacid
> sequence. Now it returns a FASTA  formatted string.
> > >
> > > How can I get the old behaviour (ie. get the aminoacid sequence)?
> > >
> > > --
> > > Pedro Sousa Lacerda
> > >
> > > Laboratório de Bioinformática e Modelagem Molecular
> > > Faculdade de Farmácia / UFBA
> > >
> > > @pslacerda
> > > +55 71 9 9981-1856
> > > http://lattes.cnpq.br/8338596525330907
> > > ___
> > > PyMOL-users mailing list
> > > Archives:
> http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> > > Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
> >
> > --
> > Thomas Holder
> > PyMOL Principal Developer
> > Schrödinger, Inc.
> >
> >
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular
> > Faculdade de Farmácia / UFBA
> >
> > @pslacerda
> > +55 71 9 9981-1856
> > http://lattes.cnpq.br/8338596525330907
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] cmd.get_fastastr()

2020-07-06 Thread Pedro Lacerda
I used the function to check if the fasta is smaller than 25 characters. If
it is then it is a peptide:
https://github.com/pslacerda/pymol-labimm/blob/master/scripts/peptbase/create.py#L186

There is another way to check for peptides using only selection?

Em seg., 6 de jul. de 2020 às 02:47, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

> Hi Pedro,
>
> cmd.get_fastastr() always returned a FASTA formatted string. What changed
> in PyMOL 2.2 is that it now creates a record for every chain, not just for
> every object. There is a new "key" argument, you get the old behavior with
> key="model".
>
> print(cmd.get_fastastr(key="model"))
>
> If you actually want the plain sequence and not the fasta formatted
> string, then I suggest you use a function like this:
>
> def get_sequence(selection='all'):
> return ''.join(L.strip() for L in
> cmd.get_fastastr(selection).splitlines()
>if not L.startswith('>'))
>
>
> Cheers,
>   Thomas
>
>
> > On Jul 4, 2020, at 5:17 PM, Pedro Lacerda  wrote:
> >
> > Hi,
> >
> > The get_fastastr function changed. Before it returned the aminoacid
> sequence. Now it returns a FASTA  formatted string.
> >
> > How can I get the old behaviour (ie. get the aminoacid sequence)?
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular
> > Faculdade de Farmácia / UFBA
> >
> > @pslacerda
> > +55 71 9 9981-1856
> > http://lattes.cnpq.br/8338596525330907
> > ___
> > PyMOL-users mailing list
> > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> > Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] 2 proteins plus ligand

2020-07-06 Thread Pedro Lacerda
Hi Larry,

My guess is that you need a docking tool (like DOCKTHOR server;
https://dockthor.lncc.br/v2/).

So you pulled the protein structures from the web... the coordinates from
one is arbitrary to the other. If they interact in a way that forms a
protein-protein interface (PPI) then you need a PPI docking software also
to get the complex. But my guess is that you don't need the complex and the
small ligand will bind to only one of the proteins... I don't know.

Hope it helps,
Abraços,

Em seg., 6 de jul. de 2020 às 15:09, Larry Mahan 
escreveu:

> Hello,
> Like others, I am new to Pymol.  I am interested in seeing if a small
> molecule (.mol2) "ligand" has a binding site on one of two proteins (2KAV
> and 5FEB) but since they are known to interact, it might be something
> between the two.  While I am also looking into/learning Autodock Vina, in
> Pymol I tried pulling up one protein (successful), then the other
> (successful) and interestingly they came up somewhat "intertwined" next to
> each other.  Then I brought in the small molecule (300MW) and it jumped to
> an orientation with one end next to an a.a. of one protein and the other
> end next to an a.a. of the other. And some of the side groups made possible
> sense (e.g. H-bonding).  No matter which order I pull up the proteins or
> molecule, they always configure this same way.
>
> So my question is ... are these alignments just fortuitous? (then why the
> same each permutation of adding) or is Pymol suggesting an optimal
> alignment for the 2 proteins and "suggesting" a binding site for the small
> molecule?
> Is there a better way to look at this?
> Thanks for any insights!
>
> Larry (pymol newbie)
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe



-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Radius of gyration of a trimer

2020-07-05 Thread Pedro Lacerda
Correction: gyradius is the name.

Em dom., 5 de jul. de 2020 às 06:42, Pedro Lacerda 
escreveu:

> It can be accomplished with the following command (gyration on psico
> library):
>
> https://pymolwiki.org/index.php/Radius_of_gyration
>
>
> Em dom., 5 de jul. de 2020 às 04:15, Dr. Subramanian, Senthil Kumar <
> senth...@hu-berlin.de> escreveu:
>
>> Hello,
>>
>> I would like to measure radius of gyration for a protein (1JB0). The PDB
>> structure is only a monomer. But, I would like to find the RoG for the
>> trimer. Could any one please help me? Bytheway, I failed massively even to
>> get RoG for monomer and it says 'RoG is not defined'. I would appreciate
>> your time and effort.
>>
>> Thank you.
>>
>> Best regards,
>>
>> Senthil
>> ___
>> PyMOL-users mailing list
>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>> Unsubscribe:
>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
>
>
> --
> Pedro Sousa Lacerda
>
> Laboratório de Bioinformática e Modelagem Molecular
> Faculdade de Farmácia / UFBA
>
> @pslacerda
> +55 71 9 9981-1856
> http://lattes.cnpq.br/8338596525330907
>


-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Radius of gyration of a trimer

2020-07-05 Thread Pedro Lacerda
It can be accomplished with the following command (gyration on psico
library):

https://pymolwiki.org/index.php/Radius_of_gyration


Em dom., 5 de jul. de 2020 às 04:15, Dr. Subramanian, Senthil Kumar <
senth...@hu-berlin.de> escreveu:

> Hello,
>
> I would like to measure radius of gyration for a protein (1JB0). The PDB
> structure is only a monomer. But, I would like to find the RoG for the
> trimer. Could any one please help me? Bytheway, I failed massively even to
> get RoG for monomer and it says 'RoG is not defined'. I would appreciate
> your time and effort.
>
> Thank you.
>
> Best regards,
>
> Senthil
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe



-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] cmd.get_fastastr()

2020-07-04 Thread Pedro Lacerda
Hi,

The get_fastastr function changed. Before it returned the aminoacid
sequence. Now it returns a FASTA  formatted string.

How can I get the old behaviour (ie. get the aminoacid sequence)?

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Python script with iterate_state and selection command

2020-06-22 Thread Pedro Lacerda
Hi,

Not sure if I understood your code but maybe you want change Myselection to:

Myselection="resname SOL within 3.5 of resname CHO"

-- Pedro Lacerda

Em seg, 22 de jun de 2020 10:44, ABEL Stephane 
escreveu:

> Hello all,
>
> I would like to write a basic python script to select residues for each
> state using the iterate_state and output the results first in pymol console
> window with the following format
>
> frame 1 : resid ...
> frame 2 : resid ...
> ...
>
> ### my script ##
>
> from pymol import cmd, stored
>
> mytraj=""
> mytraj2=""
>
> ## Load PDB
> cmd.load("1JNO_GrA_DMPC_NACL_Membrane_TIP3P_SemiIso_rep3_Water_InChannel_0ns.pdb"),
> mytraj
>
> ## Load XTC
> cmd.load_traj("1JNO_GrA_DMPC_NACL_Membrane_TIP3P_SemiIso_rep3_Water_InChannel_0_50ns_Every_0.5ns_TRANSLATED.xtc"),
> mytraj2
>
> stored.resid = []
>
> Myselection="select water_channel, resname SOL within 3.5 of resname CHO"
>
> nb_states=cmd.count_states(mytraj2)---> Contains 102 states
> print(mytraj2, nb_states)
>
> state=1
> for i in range (nb_states) :
> print(i)
> cmd.iterate_state (i, (Myselection), 'resid.append(resv)')   >
> Should to ireate for all the states
> print("frame " + str(i) + ":" + str(stored.residues))   ---> Print
> the results of the Myselection command in the console
>
> ###
>
> But the first problem I have is the syntax of the iterate_state. I obtain
> the  following error
> "Selector-Error: Invalid selection name "select".
> ( select water_channel, resname SOL within 3.5 of resname CHO )<--"
>
> When I put this selection command directly in Pymol, it works and i can
> obtain the desired waters that was near 3.5 A of the CHO over all the
> states . So What is the correct syntax for the selection with
> "iterate_state" ? And how to output the results again for each state in the
> screen .
>
> Thanks in advance for your help
>
> Stéphane
>
>
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] User data

2020-06-09 Thread Pedro Lacerda
Hi PyMOL users and developers,

I have a plugin that needs to download data periodically. Where should I
download to?

By the way, I managed to get a plugin into a python package.

https://github.com/pslacerda/pymol-labimm/blob/master/scripts/pymol_labimm.py

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] How to load ~/.pymolpluginsrc.py before finish_launching()?

2020-03-16 Thread Pedro Lacerda
Hi,

As the title says: How to load *~/.pymolpluginsrc.py* before
*finish_launching()*?

I didn't found an way to access saved preferences in library mode.

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Protonated aspartic acid

2020-01-07 Thread Pedro Lacerda
Hi Neena,

Check the builder. You can change the charge of a atom adding or removing H.

Cheers,

[image: image.png]

Em ter., 7 de jan. de 2020 às 20:29, Neena Susan Eappen <
neenasusan...@gmail.com> escreveu:

> Hello PyMOL users,
>
> How to change the protonation state of aminoacid in Pymol? Say from
> aspartic acid at deprotonated state to protonated state?
>
> Thank you,
> Neena
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe



-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] User defined variable or property

2020-01-06 Thread Pedro Lacerda
Didn't found the module `pymol.properties.set_property` as stated by
https://pymol.org/pymol-command-ref.html#set_property.

Em seg., 6 de jan. de 2020 às 15:40, Pedro Lacerda 
escreveu:

> Hi,
>
> How can I store custom object properties.
>
> I didn't found `set_property` or `get_property` in my PyMOL version.
> Neither found a way to store arbitrary session data. I even tried to encode
> data in the label to parse it back, but found no way to read a label value.
>
> How can I have the `set_property` and `get_property` feature?
>
> --
> Pedro Sousa Lacerda
>
> Laboratório de Bioinformática e Modelagem Molecular
> Faculdade de Farmácia / UFBA
>
> @pslacerda
> +55 71 9 9981-1856
> http://lattes.cnpq.br/8338596525330907
>


-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] User defined variable or property

2020-01-06 Thread Pedro Lacerda
Hi,

How can I store custom object properties.

I didn't found `set_property` or `get_property` in my PyMOL version.
Neither found a way to store arbitrary session data. I even tried to encode
data in the label to parse it back, but found no way to read a label value.

How can I have the `set_property` and `get_property` feature?

-- 
Pedro Sousa Lacerda

Laboratório de Bioinformática e Modelagem Molecular
Faculdade de Farmácia / UFBA

@pslacerda
+55 71 9 9981-1856
http://lattes.cnpq.br/8338596525330907
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Autosave

2019-11-22 Thread Pedro Lacerda
I would rather create a QTimer to autosave and autorender. It would report
correct CPU usage.

After then you may of course create a plugin:
https://pymolwiki.org/index.php/Plugins_Tutorial.

Em sex, 22 de nov de 2019 22:41, Pedro Lacerda 
escreveu:

> Only now I see your code. I'm not very versed with PyMOL code but maybe
> you want to wait for the pymol lock. Grep for the lock and wait for it. Can
> you imagine the last auto rendering be a wrong image after a long and hard
> session.
>
> Em sex, 22 de nov de 2019 22:36, Pedro Lacerda 
> escreveu:
>
>> Hi Jason,
>>
>> You can save with Ctrl-S, as you might know. Auto rendering would be
>> complicated because there is a lot of options. For instance, you may have
>> to choose low DPI for quick inspection or high for final rendering.
>>
>> Best regards,
>> Pedro Lacerda
>>
>> Em sex, 22 de nov de 2019 19:49, Junsu Park aka. Jason Mosier <
>> parksinj...@gmail.com> escreveu:
>>
>>> Hello, I'm fairly new to pymol and python in general, but I honestly
>>> don't have to self control to save by myself very well and so I was trying
>>> to use the proof of concept code for autosaving. However, it was written
>>> for a way old version of pymol and so I was wondering if I could get some
>>> help with fixing this code up? If that would be too difficult, is there a
>>> way that I could bind a key to saving AND then rendering? Or even just
>>> clicking on the render button causes it to save before ray tracing? I keep
>>> rendering on a weak computer thinking it can handle it and then it crashes
>>> and I lose all my progress.
>>>
>>> Link to code: https://pastebin.com/EJJQWc00
>>> <https://gnldr.online/tracker/click?redirect=https%3A%2F%2Fpastebin.com%2FEJJQWc00=1574462896168=https://pastebin.com/EJJQWc00>
>>>
>>> Link to output:  https://pastebin.com/TNSuA0fH
>>> <https://gnldr.online/tracker/click?redirect=https%3A%2F%2Fpastebin.com%2FTNSuA0fH=1574462896168=https://pastebin.com/TNSuA0fH>
>>>
>>> Thanks,
>>> -Jason
>>> ___
>>> PyMOL-users mailing list
>>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>>> Unsubscribe:
>>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>>
>>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Autosave

2019-11-22 Thread Pedro Lacerda
Only now I see your code. I'm not very versed with PyMOL code but maybe you
want to wait for the pymol lock. Grep for the lock and wait for it. Can you
imagine the last auto rendering be a wrong image after a long and hard
session.

Em sex, 22 de nov de 2019 22:36, Pedro Lacerda 
escreveu:

> Hi Jason,
>
> You can save with Ctrl-S, as you might know. Auto rendering would be
> complicated because there is a lot of options. For instance, you may have
> to choose low DPI for quick inspection or high for final rendering.
>
> Best regards,
> Pedro Lacerda
>
> Em sex, 22 de nov de 2019 19:49, Junsu Park aka. Jason Mosier <
> parksinj...@gmail.com> escreveu:
>
>> Hello, I'm fairly new to pymol and python in general, but I honestly
>> don't have to self control to save by myself very well and so I was trying
>> to use the proof of concept code for autosaving. However, it was written
>> for a way old version of pymol and so I was wondering if I could get some
>> help with fixing this code up? If that would be too difficult, is there a
>> way that I could bind a key to saving AND then rendering? Or even just
>> clicking on the render button causes it to save before ray tracing? I keep
>> rendering on a weak computer thinking it can handle it and then it crashes
>> and I lose all my progress.
>>
>> Link to code: https://pastebin.com/EJJQWc00
>> <https://gnldr.online/tracker/click?redirect=https%3A%2F%2Fpastebin.com%2FEJJQWc00=1574462896168=https://pastebin.com/EJJQWc00>
>>
>> Link to output:  https://pastebin.com/TNSuA0fH
>> <https://gnldr.online/tracker/click?redirect=https%3A%2F%2Fpastebin.com%2FTNSuA0fH=1574462896168=https://pastebin.com/TNSuA0fH>
>>
>> Thanks,
>> -Jason
>> ___
>> PyMOL-users mailing list
>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>> Unsubscribe:
>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Autosave

2019-11-22 Thread Pedro Lacerda
Hi Jason,

You can save with Ctrl-S, as you might know. Auto rendering would be
complicated because there is a lot of options. For instance, you may have
to choose low DPI for quick inspection or high for final rendering.

Best regards,
Pedro Lacerda

Em sex, 22 de nov de 2019 19:49, Junsu Park aka. Jason Mosier <
parksinj...@gmail.com> escreveu:

> Hello, I'm fairly new to pymol and python in general, but I honestly don't
> have to self control to save by myself very well and so I was trying to use
> the proof of concept code for autosaving. However, it was written for a way
> old version of pymol and so I was wondering if I could get some help with
> fixing this code up? If that would be too difficult, is there a way that I
> could bind a key to saving AND then rendering? Or even just clicking on the
> render button causes it to save before ray tracing? I keep rendering on a
> weak computer thinking it can handle it and then it crashes and I lose all
> my progress.
>
> Link to code: https://pastebin.com/EJJQWc00
> <https://gnldr.online/tracker/click?redirect=https%3A%2F%2Fpastebin.com%2FEJJQWc00=1574462896168=https://pastebin.com/EJJQWc00>
>
> Link to output:  https://pastebin.com/TNSuA0fH
> <https://gnldr.online/tracker/click?redirect=https%3A%2F%2Fpastebin.com%2FTNSuA0fH=1574462896168=https://pastebin.com/TNSuA0fH>
>
> Thanks,
> -Jason
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Get surface coordinates

2019-11-11 Thread Pedro Lacerda
Hi Jared,

May I reopen the ticket?

I got the `get_volume_field` idea. It returns the grid. My grid was trimmed
or was justified to have only the observations and because of this my
shapes seemed incoherent.

I jumped in the code yesterday to add the `quiet` flag on `dump`. This is
code is like the `get_volume_field` but return points instead of the grid
itself. Seems that there is no way on the PyMOL API to handle a grid
dislocated from origin (except dump level by level until fill a volume and
then parse each file). Some notes: (1) my build has no numpy and no idea
why; (2) and I'm not sure if I got the offset alright; (3) didn't handled
other typeofs, only float.

Can you review this code for me?


void ObjectMapDump(ObjectMap* om, const char* fname, int state, int quiet)
{
  auto file = fopen(fname, "wb");
  if (!file) {
ErrMessage(om->G, "ObjectMapDump", "can't open file for writing");
  }

  ObjectMapState* oms = om->State + 0;

  int zd = oms->Field->dimensions[2];
  int yd = oms->Field->dimensions[1];
  int xd = oms->Field->dimensions[0];

  float zs = (oms->ExtentMax[2] - oms->ExtentMin[2]) /
(oms->Field->dimensions[2]);
  float ys = (oms->ExtentMax[1] - oms->ExtentMin[1]) /
(oms->Field->dimensions[1]);
  float xs = (oms->ExtentMax[0] - oms->ExtentMin[0]) /
(oms->Field->dimensions[0]);

  int offset = 0;
  for (int zi = 0; zi < oms->Field->dimensions[2]; zi++) {
for (int yi = 0; yi < oms->Field->dimensions[1]; yi++) {
  for (int xi = 0; xi < oms->Field->dimensions[0]; xi++) {

float z = oms->ExtentMin[2] + zs * zi;
float y = oms->ExtentMin[1] + ys * yi;
float x = oms->ExtentMin[0] + xs * xi;

float* data = (float*) oms->Field->data->data;
float value = data[offset];
offset += 1;

fprintf(file, "%10.4f%10.4f%10.4f%10.4f\n", x, y, z, value);
  }
}
  }
  fclose(file);
  if (!quiet) {
PRINTFB(om->G, FB_ObjectMap, FB_Actions)
  " ObjectMapDump: %s written to %s\n", om->Name, fname ENDFB(om->G);
  }
}

Em qui., 7 de nov. de 2019 às 11:41, Jared Sampson <
jared.samp...@columbia.edu> escreveu:

> Hi Pedro - Glad you have something working for your use case.
>
> Best,
> Jared
>
>
> On November 5, 2019 at 9:32:51 AM, Pedro Lacerda (pslace...@gmail.com)
> wrote:
>
> Update:
>
> worked the same for me, but may have impact in other cases:
>
> MIN_LEVEL = 0
> MAX_LEVEL = 20
> LEVEL_RANGE = np.arange(MIN_LEVEL, MAX_LEVEL+0.5, 0.5)
>
> def _get_map(map_name):
> dump_fhandle, dump_fname = tempfile.mkstemp()
> open(dump_fhandle).close()
>
> try:
> levels = {}
> for level in LEVEL_RANGE:
> # dump level
> cmd.isodot('_i', map_name, level)
> cmd.dump(dump_fname, '_i')
> cmd.delete('_i')
>
> # load level
> with warnings.catch_warnings():
> xyz = np.loadtxt(dump_fname)
> warnings.simplefilter("ignore")
>
>     # handle empty maps
> if len(xyz) == 0:
> xyz = np.ndarray((0, 3))
>
> xyz = xyz[:, :3]
> levels[level] = xyz
>
> return levels
> finally:
> os.unlink(dump_fname)
>
> Em ter., 5 de nov. de 2019 às 11:13, Pedro Lacerda 
> escreveu:
>
>> For the sake of completeness here is some working code.
>>
>> `dump` exports the surface of map representations. They are all surfaces.
>>
>> So I had to dump the map at each level (0.5 by 0.5 increment) in order to
>> get a filled volume. If you concatenate all xyz arrays you get the filled
>> volume of the level 20 surface.
>>
>> Thank you for the support.
>>
>>
>> MIN_LEVEL = 0
>> MAX_LEVEL = 20
>> LEVEL_RANGE = np.arange(MIN_LEVEL, MAX_LEVEL+0.5, 0.5)
>>
>>
>> def _get_map(map_name):
>> dump_fhandle, dump_fname = tempfile.mkstemp()
>> open(dump_fhandle).close()
>>
>> try:
>> levels = {}
>> skip = False
>> for level in LEVEL_RANGE:
>> if not skip:
>> # dump level
>> cmd.isodot('_i', map_name, level)
>> cmd.dump(dump_fname, '_i')
>> cmd.delete('_i')
>>
>> # load level
>> with warnings.catch_warnings():
>> xyz = np.loadtxt(dump_fname)
>> warnings.simplefilter("ignore")
>>
>> # handle empty maps
>> if skip or len(xyz) == 0:
>>  

Re: [PyMOL] View manger (and how to store arbitrary data on the session?)

2019-11-09 Thread Pedro Lacerda
Jared,

I did a pull request with the plugin and asked a account on pymolwiki.org.

I thought the account email was a bot so I was a bit lame. First I sent an
email titled "New Account" with no more text.

https://github.com/Pymol-Scripts/Pymol-script-repo/pull/105



Em qua., 30 de out. de 2019 às 20:13, Pedro Lacerda 
escreveu:

> Hi Jared,
>
> Glad you liked and thank you for the patch and incentive. I'll pull it on
> the repo and create a wiki page.
>
> Best regards,
> Pedro Lacerda
>
>
> Em qua, 30 de out de 2019 14:16, Jared Sampson 
> escreveu:
>
>> Hi Pedro -
>>
>> I just took a look at the plugin, and it seems quite convenient.  I
>> imagine using this as a tool to complement PyMOL's default scenes, as a way
>> of looking at different representations or objects from the same viewpoint.
>>
>> Looking at the code, I was curious about all the Q* global variable
>> assignments near the top, and thought they might be cleaner and easier to
>> maintain as imports.  (Plus many of them were unused in the plugin code.)
>>  Apparently due to the way pymol.Qt is a wrapper for PyQt5, we can't do
>> `from pymol.Qt.QtWidgets import *`, but the following does work:
>>
>> ```
>> from pymol.Qt import QtWidgets, QtCore, QtGui
>> ```
>>
>> then use e.g. `QtWidgets.QWidget()` in the body of the code; see the
>> attached patch (I hope you don't mind my sending it!).  As a side note,
>> this appears to be—at least unofficially—a preferred way to do it,
>> according to an example plugin
>> <https://github.com/Pymol-Scripts/pymol2-demo-plugin/blob/master/__init__.py#L51>
>>  by
>> PyMOL lead developer Thomas Holder (speleo3).
>>
>> Also, I would encourage you to add your plugin to the PyMOL scripts repo
>> <https://github.com/Pymol-Scripts/Pymol-script-repo> on Github, and to
>> create a PyMOL Wiki page for it.
>>
>> Thanks for sharing!
>>
>> Cheers,
>> Jared
>>
>> On October 26, 2019 at 12:39:35 PM, Pedro Lacerda (pslace...@gmail.com)
>> wrote:
>>
>> And the plugin, of course!
>>
>> Em sáb, 26 de out de 2019 às 13:37, Pedro Lacerda 
>> escreveu:
>>
>>> Hi,
>>>
>>> I just made a graphical plugin to set and get views. It uses the
>>> set_view and get_view functions.
>>>
>>> It is available in the last option ("Show views") on the "Scene" menu.
>>> Double-click to rename a view. Erase it's name to delete it.
>>>
>>> In order to persist data in the PSE session it stores data into the
>>> mesh_clear_selection setting. It was the only way I found.
>>>
>>> How to store arbitrary data on the session? Some "ostate" string
>>> settings are preserved on the PSE session. But not all support set
>>> arbitrary data (eg, bg_image_filename). It is very hackish and not a
>>> definite solution.
>>>
>>> Just wondering, maybe a hidden "setting" (not visible to can be be used
>>> as a key-value store. It would hold serialized data (eg json or pickle) and
>>> have a pair of functions set_key(key, obj) and get(key) that read and write
>>> the setting.
>>>
>>> Another great addition would be able to set arbitrary strings to objects
>>> and atoms. But in case of implementing a key-value store would be some
>>> overlap.
>>>
>>> Best regards,
>>>
>>>
>>> [image: image.png]
>>>
>>> --
>>> Pedro Sousa Lacerda
>>>
>>>
>>> *Laboratório de Bioinformática e Modelagem Molecular*
>>> *Faculdade de Farmácia / UFBA*
>>>
>>> *@pslacerda*
>>>
>>> *+55 71 9 9981-1856*
>>>
>>
>>
>> --
>> Pedro Sousa Lacerda
>>
>>
>> *Laboratório de Bioinformática e Modelagem Molecular*
>> *Faculdade de Farmácia / UFBA*
>>
>> *@pslacerda*
>>
>> *+55 71 9 9981-1856*
>> ___
>> PyMOL-users mailing list
>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>> Unsubscribe:
>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubsc
>> <https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe>
>>
>>

-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] Show lone pairs

2019-11-09 Thread Pedro Lacerda
Hi,

According to this page seems that GOLD software craft pseudoatoms to
represent lone pairs.

https://chemistryandcomputers.wordpress.com/2012/05/31/pymol-tip/

I would expect some `lone_pairs` setting (like `valence` and `RepValence`)
would represent it.

Is there any way to show lone eletron pairs?


-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Get surface coordinates

2019-11-05 Thread Pedro Lacerda
Update:

worked the same for me, but may have impact in other cases:

MIN_LEVEL = 0
MAX_LEVEL = 20
LEVEL_RANGE = np.arange(MIN_LEVEL, MAX_LEVEL+0.5, 0.5)

def _get_map(map_name):
dump_fhandle, dump_fname = tempfile.mkstemp()
open(dump_fhandle).close()

try:
levels = {}
for level in LEVEL_RANGE:
# dump level
cmd.isodot('_i', map_name, level)
cmd.dump(dump_fname, '_i')
cmd.delete('_i')

# load level
with warnings.catch_warnings():
xyz = np.loadtxt(dump_fname)
warnings.simplefilter("ignore")

# handle empty maps
if len(xyz) == 0:
xyz = np.ndarray((0, 3))

xyz = xyz[:, :3]
levels[level] = xyz

return levels
finally:
os.unlink(dump_fname)

Em ter., 5 de nov. de 2019 às 11:13, Pedro Lacerda 
escreveu:

> For the sake of completeness here is some working code.
>
> `dump` exports the surface of map representations. They are all surfaces.
>
> So I had to dump the map at each level (0.5 by 0.5 increment) in order to
> get a filled volume. If you concatenate all xyz arrays you get the filled
> volume of the level 20 surface.
>
> Thank you for the support.
>
>
> MIN_LEVEL = 0
> MAX_LEVEL = 20
> LEVEL_RANGE = np.arange(MIN_LEVEL, MAX_LEVEL+0.5, 0.5)
>
>
> def _get_map(map_name):
> dump_fhandle, dump_fname = tempfile.mkstemp()
> open(dump_fhandle).close()
>
> try:
> levels = {}
> skip = False
> for level in LEVEL_RANGE:
> if not skip:
> # dump level
> cmd.isodot('_i', map_name, level)
> cmd.dump(dump_fname, '_i')
> cmd.delete('_i')
>
> # load level
> with warnings.catch_warnings():
> xyz = np.loadtxt(dump_fname)
> warnings.simplefilter("ignore")
>
> # handle empty maps
> if skip or len(xyz) == 0:
> xyz = np.ndarray((0, 3))
> skip = True
>
> xyz = xyz[:, :3]
>     levels[level] = xyz
>
> return levels
> finally:
> os.unlink(dump_fname)
>
> Em seg., 4 de nov. de 2019 às 01:38, Pedro Lacerda 
> escreveu:
>
>> Hi Jared,
>>
>> So COLLADA exports some kind of already rendered 3D image.
>>
>> Took me some time to figure out if dump exports the map points or
>> something specific to the surface representation. In fact, it is yet to be
>> figured out.
>>
>> Dump can export at least map and surface objects.
>>
>> When I export two different overlapping surfaces of the same map there is
>> points of the outer surface that aren't in the inner. I expected all points
>> of the inner to be present in both dumps.
>>
>> So I guess that when I dump surface objects it exports newly created
>> points of the enclosed volume of that surface. Is it correct?
>>
>> To export the map directly would preserve the original points? (Which I
>> hope to be the original grid count of the server's method)
>>
>> Is overlap is defined for map objects?
>>
>>
>> Sorry maybe I'm not saying very clear.
>>
>> And about the get_volume_field(), if I remember correctly it returned on
>> a call an ndarray of shape (28, 26, 15) and on other call an ndarray of
>> shape (28, 28, 16). Something like that.
>>
>>
>> Cheers,
>>
>>
>> Em sex, 1 de nov de 2019 10:33, Jared Sampson 
>> escreveu:
>>
>>> Hi Pedro -
>>>
>>> The COLLADA option exports unlabeled mesh objects so I couldn't figure
>>> out which one is acceptor or donor.
>>>
>>> Yes, you're correct about that.  This is due to the fact that COLLADA
>>> export uses geometry after it is prepared for ray tracing, which doesn't
>>> know about object names (see the primary function call
>>> <https://github.com/schrodinger/pymol-open-source/blob/master/layer1/COLLADA.cpp#L667>).
>>> It might be interesting/useful to export things in a more granular way
>>> using pre-ray-tracing information as it is stored in the PyMOL session, but
>>> that would involve substantial effort, and wasn't included when we planned
>>> this export feature.
>>>
>>> If you wanted to know which mesh is which, you could export objects
>>> one-at-a-time by disabling all the others, although to me, the dump command
>>> output looks more helpful as it can be more easily parsed.
>>>
>>> Just one more quest

Re: [PyMOL] Get surface coordinates

2019-11-05 Thread Pedro Lacerda
For the sake of completeness here is some working code.

`dump` exports the surface of map representations. They are all surfaces.

So I had to dump the map at each level (0.5 by 0.5 increment) in order to
get a filled volume. If you concatenate all xyz arrays you get the filled
volume of the level 20 surface.

Thank you for the support.


MIN_LEVEL = 0
MAX_LEVEL = 20
LEVEL_RANGE = np.arange(MIN_LEVEL, MAX_LEVEL+0.5, 0.5)


def _get_map(map_name):
dump_fhandle, dump_fname = tempfile.mkstemp()
open(dump_fhandle).close()

try:
levels = {}
skip = False
for level in LEVEL_RANGE:
if not skip:
# dump level
cmd.isodot('_i', map_name, level)
cmd.dump(dump_fname, '_i')
cmd.delete('_i')

# load level
with warnings.catch_warnings():
xyz = np.loadtxt(dump_fname)
warnings.simplefilter("ignore")

# handle empty maps
if skip or len(xyz) == 0:
xyz = np.ndarray((0, 3))
skip = True

xyz = xyz[:, :3]
levels[level] = xyz

return levels
finally:
os.unlink(dump_fname)

Em seg., 4 de nov. de 2019 às 01:38, Pedro Lacerda 
escreveu:

> Hi Jared,
>
> So COLLADA exports some kind of already rendered 3D image.
>
> Took me some time to figure out if dump exports the map points or
> something specific to the surface representation. In fact, it is yet to be
> figured out.
>
> Dump can export at least map and surface objects.
>
> When I export two different overlapping surfaces of the same map there is
> points of the outer surface that aren't in the inner. I expected all points
> of the inner to be present in both dumps.
>
> So I guess that when I dump surface objects it exports newly created
> points of the enclosed volume of that surface. Is it correct?
>
> To export the map directly would preserve the original points? (Which I
> hope to be the original grid count of the server's method)
>
> Is overlap is defined for map objects?
>
>
> Sorry maybe I'm not saying very clear.
>
> And about the get_volume_field(), if I remember correctly it returned on a
> call an ndarray of shape (28, 26, 15) and on other call an ndarray of shape
> (28, 28, 16). Something like that.
>
>
> Cheers,
>
>
> Em sex, 1 de nov de 2019 10:33, Jared Sampson 
> escreveu:
>
>> Hi Pedro -
>>
>> The COLLADA option exports unlabeled mesh objects so I couldn't figure
>> out which one is acceptor or donor.
>>
>> Yes, you're correct about that.  This is due to the fact that COLLADA
>> export uses geometry after it is prepared for ray tracing, which doesn't
>> know about object names (see the primary function call
>> <https://github.com/schrodinger/pymol-open-source/blob/master/layer1/COLLADA.cpp#L667>).
>> It might be interesting/useful to export things in a more granular way
>> using pre-ray-tracing information as it is stored in the PyMOL session, but
>> that would involve substantial effort, and wasn't included when we planned
>> this export feature.
>>
>> If you wanted to know which mesh is which, you could export objects
>> one-at-a-time by disabling all the others, although to me, the dump command
>> output looks more helpful as it can be more easily parsed.
>>
>> Just one more question, what are these normal values?
>>
>>
>> The normal values Thomas refers to are the 3 components of the vector
>> indicating the direction toward the "outside" of the object, which is
>> normal to the surface the triangle mesh attempts to approximate.  This is
>> used in shading.
>>
>> https://en.wikipedia.org/wiki/Vertex_normal
>>
>> The cmd.get_volume_field() returns a sparse ndarray with unknow layout
>> and all dimensions variables depending of the object. How to interpret such
>> array?
>> On PyMOL 1.x it returned -1 but in 2.x returned the array.
>>
>> The dump command worked (almost) like a charm.
>> I expect to extract the "dump" array from get_volume_field() so don't
>> need to write the file just to be read and deleted afterwards. Is it
>> possible?
>>
>>
>> I'm not familiar with `cmd.get_volume_field()`, so I'll defer to others
>> on those questions.
>>
>> Hope that helps.
>>
>> Cheers,
>> Jared
>>
>

-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Get surface coordinates

2019-11-03 Thread Pedro Lacerda
Hi Jared,

So COLLADA exports some kind of already rendered 3D image.

Took me some time to figure out if dump exports the map points or something
specific to the surface representation. In fact, it is yet to be figured
out.

Dump can export at least map and surface objects.

When I export two different overlapping surfaces of the same map there is
points of the outer surface that aren't in the inner. I expected all points
of the inner to be present in both dumps.

So I guess that when I dump surface objects it exports newly created points
of the enclosed volume of that surface. Is it correct?

To export the map directly would preserve the original points? (Which I
hope to be the original grid count of the server's method)

Is overlap is defined for map objects?


Sorry maybe I'm not saying very clear.

And about the get_volume_field(), if I remember correctly it returned on a
call an ndarray of shape (28, 26, 15) and on other call an ndarray of shape
(28, 28, 16). Something like that.


Cheers,


Em sex, 1 de nov de 2019 10:33, Jared Sampson 
escreveu:

> Hi Pedro -
>
> The COLLADA option exports unlabeled mesh objects so I couldn't figure out
> which one is acceptor or donor.
>
> Yes, you're correct about that.  This is due to the fact that COLLADA
> export uses geometry after it is prepared for ray tracing, which doesn't
> know about object names (see the primary function call
> ).
> It might be interesting/useful to export things in a more granular way
> using pre-ray-tracing information as it is stored in the PyMOL session, but
> that would involve substantial effort, and wasn't included when we planned
> this export feature.
>
> If you wanted to know which mesh is which, you could export objects
> one-at-a-time by disabling all the others, although to me, the dump command
> output looks more helpful as it can be more easily parsed.
>
> Just one more question, what are these normal values?
>
>
> The normal values Thomas refers to are the 3 components of the vector
> indicating the direction toward the "outside" of the object, which is
> normal to the surface the triangle mesh attempts to approximate.  This is
> used in shading.
>
> https://en.wikipedia.org/wiki/Vertex_normal
>
> The cmd.get_volume_field() returns a sparse ndarray with unknow layout and
> all dimensions variables depending of the object. How to interpret such
> array?
> On PyMOL 1.x it returned -1 but in 2.x returned the array.
>
> The dump command worked (almost) like a charm.
> I expect to extract the "dump" array from get_volume_field() so don't need
> to write the file just to be read and deleted afterwards. Is it possible?
>
>
> I'm not familiar with `cmd.get_volume_field()`, so I'll defer to others on
> those questions.
>
> Hope that helps.
>
> Cheers,
> Jared
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] About Pymol 2.3 Python Package

2019-11-03 Thread Pedro Lacerda
Hi,

Certainly you can use PyMOL as you want, it is open source (has few
restrictions). If you install from Ubuntu or Fedora repositories you can
use freely.

Don't worry, just share your code or session then your coworkers open as
they can. If is for your sole analysis don't worry as well.

(In fact seems that exists some proprietary version at pymol.org but I
don't know)

Em sáb, 2 de nov de 2019 20:51, halil ibrahim özdemir <
ozdemir.gene...@gmail.com> escreveu:

> Dear Mr/Mrs,
>
>
>
> I am a fresh master's degree student in the computational biology
> department. Now working on my new standalone project about allosteric
> proteins. Actually i finished. But for visualization I used pymol2 and I
> heard that it is not free anymore. And i wrote my code in python 3. So I
> want to show my protein in Pymol. Is it possible or not that I want to ask?
> The program for academic, not commercial. Thank you very much for your
> understanding, kindness and precious time.
>
>
>
> Best regards,
>
> Halil İbrahim ÖZDEMİR
>
> Marmara University
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Get surface coordinates

2019-11-01 Thread Pedro Lacerda
Just one more question, what are these normal values?

Em sex, 1 de nov de 2019 às 02:43, Pedro Lacerda 
escreveu:

> Hi Thomas,
>
> The cmd.get_volume_field() returns a sparse ndarray with unknow layout and
> all dimensions variables depending of the object. How to interpret such
> array?
> On PyMOL 1.x it returned -1 but in 2.x returned the array.
>
> The dump command worked (almost) like a charm.
> I expect to extract the "dump" array from get_volume_field() so don't need
> to write the file just to be read and deleted afterwards. Is it possible?
>
> Hi Jared,
>
> The COLLADA option exports unlabeled mesh objects so I couldn't figure out
> which one is acceptor or donor.
>
>
> Em qua, 30 de out de 2019 às 15:20, Thomas Holder <
> thomas.hol...@schrodinger.com> escreveu:
>
>> Hi Pedro,
>>
>> There is a "dump" command which exports all surface points and normals to
>> a text file.
>>
>>   dump /tmp/dump.txt, acceptor_17
>>
>> Each line will have 6 numbers, 3 for the position, and 3 for the normal.
>>
>> For cmd.get_volume_field you need the map name, not the surface name.
>>
>>   data = cmd.get_volume_field('acceptor')
>>   print(data)
>>
>>
>> Hope that helps.
>>
>> Cheers,
>>   Thomas
>>
>>
>> > On Oct 30, 2019, at 6:42 AM, Pedro Lacerda  wrote:
>> >
>> > And cmd.get_volume_field is returning -1.
>> >
>> > Em qua, 30 de out de 2019 às 02:00, Pedro Lacerda 
>> escreveu:
>> > Hi,
>> >
>> > How can I access the underlying coordinates of acceptor, donor and
>> apolar surface objects on the given session given by the following server?
>> Coords akin to dot representation would suffice.
>> >
>> > http://fragment-hotspot-maps.ccdc.cam.ac.uk/results_table
>> > http://fragment-hotspot-maps.ccdc.cam.ac.uk/result/1542
>> >
>> > An example of session is attached.
>> >
>> > --
>> > Pedro Sousa Lacerda
>> >
>> > Laboratório de Bioinformática e Modelagem Molecular
>> > Faculdade de Farmácia / UFBA
>> >
>> > @pslacerda
>> > +55 71 9 9981-1856
>> >
>> >  ARSB_hotspots.pse
>> >
>> >
>> > --
>> > Pedro Sousa Lacerda
>> >
>> > Laboratório de Bioinformática e Modelagem Molecular
>> > Faculdade de Farmácia / UFBA
>> >
>> > @pslacerda
>> > +55 71 9 9981-1856
>> > ___
>> > PyMOL-users mailing list
>> > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>> > Unsubscribe:
>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>>
>> --
>> Thomas Holder
>> PyMOL Principal Developer
>> Schrödinger, Inc.
>>
>>
>
> --
> Pedro Sousa Lacerda
>
>
> *Laboratório de Bioinformática e Modelagem Molecular*
> *Faculdade de Farmácia / UFBA*
>
> *@pslacerda*
>
> *+55 71 9 9981-1856*
>


-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Get surface coordinates

2019-10-31 Thread Pedro Lacerda
Hi Thomas,

The cmd.get_volume_field() returns a sparse ndarray with unknow layout and
all dimensions variables depending of the object. How to interpret such
array?
On PyMOL 1.x it returned -1 but in 2.x returned the array.

The dump command worked (almost) like a charm.
I expect to extract the "dump" array from get_volume_field() so don't need
to write the file just to be read and deleted afterwards. Is it possible?

Hi Jared,

The COLLADA option exports unlabeled mesh objects so I couldn't figure out
which one is acceptor or donor.


Em qua, 30 de out de 2019 às 15:20, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

> Hi Pedro,
>
> There is a "dump" command which exports all surface points and normals to
> a text file.
>
>   dump /tmp/dump.txt, acceptor_17
>
> Each line will have 6 numbers, 3 for the position, and 3 for the normal.
>
> For cmd.get_volume_field you need the map name, not the surface name.
>
>   data = cmd.get_volume_field('acceptor')
>   print(data)
>
>
> Hope that helps.
>
> Cheers,
>   Thomas
>
>
> > On Oct 30, 2019, at 6:42 AM, Pedro Lacerda  wrote:
> >
> > And cmd.get_volume_field is returning -1.
> >
> > Em qua, 30 de out de 2019 às 02:00, Pedro Lacerda 
> escreveu:
> > Hi,
> >
> > How can I access the underlying coordinates of acceptor, donor and
> apolar surface objects on the given session given by the following server?
> Coords akin to dot representation would suffice.
> >
> > http://fragment-hotspot-maps.ccdc.cam.ac.uk/results_table
> > http://fragment-hotspot-maps.ccdc.cam.ac.uk/result/1542
> >
> > An example of session is attached.
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular
> > Faculdade de Farmácia / UFBA
> >
> > @pslacerda
> > +55 71 9 9981-1856
> >
> >  ARSB_hotspots.pse
> >
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular
> > Faculdade de Farmácia / UFBA
> >
> > @pslacerda
> > +55 71 9 9981-1856
> > ___
> > PyMOL-users mailing list
> > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> > Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>

-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] View manger (and how to store arbitrary data on the session?)

2019-10-30 Thread Pedro Lacerda
Hi Jared,

Glad you liked and thank you for the patch and incentive. I'll pull it on
the repo and create a wiki page.

Best regards,
Pedro Lacerda


Em qua, 30 de out de 2019 14:16, Jared Sampson 
escreveu:

> Hi Pedro -
>
> I just took a look at the plugin, and it seems quite convenient.  I
> imagine using this as a tool to complement PyMOL's default scenes, as a way
> of looking at different representations or objects from the same viewpoint.
>
> Looking at the code, I was curious about all the Q* global variable
> assignments near the top, and thought they might be cleaner and easier to
> maintain as imports.  (Plus many of them were unused in the plugin code.)
>  Apparently due to the way pymol.Qt is a wrapper for PyQt5, we can't do
> `from pymol.Qt.QtWidgets import *`, but the following does work:
>
> ```
> from pymol.Qt import QtWidgets, QtCore, QtGui
> ```
>
> then use e.g. `QtWidgets.QWidget()` in the body of the code; see the
> attached patch (I hope you don't mind my sending it!).  As a side note,
> this appears to be—at least unofficially—a preferred way to do it,
> according to an example plugin
> <https://github.com/Pymol-Scripts/pymol2-demo-plugin/blob/master/__init__.py#L51>
>  by
> PyMOL lead developer Thomas Holder (speleo3).
>
> Also, I would encourage you to add your plugin to the PyMOL scripts repo
> <https://github.com/Pymol-Scripts/Pymol-script-repo> on Github, and to
> create a PyMOL Wiki page for it.
>
> Thanks for sharing!
>
> Cheers,
> Jared
>
> On October 26, 2019 at 12:39:35 PM, Pedro Lacerda (pslace...@gmail.com)
> wrote:
>
> And the plugin, of course!
>
> Em sáb, 26 de out de 2019 às 13:37, Pedro Lacerda 
> escreveu:
>
>> Hi,
>>
>> I just made a graphical plugin to set and get views. It uses the set_view
>> and get_view functions.
>>
>> It is available in the last option ("Show views") on the "Scene" menu.
>> Double-click to rename a view. Erase it's name to delete it.
>>
>> In order to persist data in the PSE session it stores data into the
>> mesh_clear_selection setting. It was the only way I found.
>>
>> How to store arbitrary data on the session? Some "ostate" string settings
>> are preserved on the PSE session. But not all support set arbitrary data
>> (eg, bg_image_filename). It is very hackish and not a definite solution.
>>
>> Just wondering, maybe a hidden "setting" (not visible to can be be used
>> as a key-value store. It would hold serialized data (eg json or pickle) and
>> have a pair of functions set_key(key, obj) and get(key) that read and write
>> the setting.
>>
>> Another great addition would be able to set arbitrary strings to objects
>> and atoms. But in case of implementing a key-value store would be some
>> overlap.
>>
>> Best regards,
>>
>>
>> [image: image.png]
>>
>> --
>> Pedro Sousa Lacerda
>>
>>
>> *Laboratório de Bioinformática e Modelagem Molecular*
>> *Faculdade de Farmácia / UFBA*
>>
>> *@pslacerda*
>>
>> *+55 71 9 9981-1856*
>>
>
>
> --
> Pedro Sousa Lacerda
>
>
> *Laboratório de Bioinformática e Modelagem Molecular*
> *Faculdade de Farmácia / UFBA*
>
> *@pslacerda*
>
> *+55 71 9 9981-1856*
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubsc
> <https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe>
>
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Get surface coordinates

2019-10-29 Thread Pedro Lacerda
And cmd.get_volume_field is returning -1.

Em qua, 30 de out de 2019 às 02:00, Pedro Lacerda 
escreveu:

> Hi,
>
> How can I access the underlying coordinates of acceptor, donor and apolar
> surface objects on the given session given by the following server? Coords
> akin to dot representation would suffice.
>
> http://fragment-hotspot-maps.ccdc.cam.ac.uk/results_table
> http://fragment-hotspot-maps.ccdc.cam.ac.uk/result/1542
>
> An example of session is attached.
>
> --
> Pedro Sousa Lacerda
>
>
> *Laboratório de Bioinformática e Modelagem Molecular*
> *Faculdade de Farmácia / UFBA*
>
> *@pslacerda*
>
> *+55 71 9 9981-1856*
>
>  ARSB_hotspots.pse
> <https://drive.google.com/file/d/1os3t_yNQ556PrwgFEaRcyQZs-FVi3YEr/view?usp=drive_web>
>


-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] Get surface coordinates

2019-10-29 Thread Pedro Lacerda
Hi,

How can I access the underlying coordinates of acceptor, donor and apolar
surface objects on the given session given by the following server? Coords
akin to dot representation would suffice.

http://fragment-hotspot-maps.ccdc.cam.ac.uk/results_table
http://fragment-hotspot-maps.ccdc.cam.ac.uk/result/1542

An example of session is attached.

-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*

 ARSB_hotspots.pse

___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] educational PyMOL 1.7.4.5 crashing with Mac Catalina OS 10.15

2019-10-18 Thread Pedro Lacerda
Recently I found that the trial version 2.x don't expires. You may have
some trouble with licensing, but it is fine for 30 days.

I had only some trouble with pse versions, but the pse_export_version
option did the job.

https://pymol.org/2/

Em sex, 18 de out de 2019 às 17:50, Amy C Rosenzweig 
escreveu:

> Students in a course I am teaching just updated to Mac Catalina OS 10.15
> and they are now unable to use the educational version of PyMOL (1.7.4.5).
> Does anyone know if there is a fix for this? Thanks!
> ___
> PyMOL-users mailing list
> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe



-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] How to download and install

2019-08-15 Thread Pedro Lacerda
It is very hard!

I give up last week and installed the trial version to show some session to
my coworkers.

And only PyMOL is installed, there isn't anything like install.packaged()
from R, so I can't even share my commands with custom requirements to them.

Em qui, 15 de ago de 2019 19:46, Joel Tyndall 
escreveu:

> Details of where to get the appropriate files are available here.
>
>
>
> https://pymolwiki.org/index.php/Windows_Install
>
>
>
> With a little bit of tinkering I was able to install this
>
>
>
> J
>
>
>
> *From:* Pedro Lacerda 
> *Sent:* Wednesday, 14 August 2019 11:22 PM
> *To:* pymol-users@lists.sourceforge.net
> *Subject:* [PyMOL] How to download and install
>
>
>
> Hi,
>
>
>
> I'm unable to build or download and install PyMOL for Windows for free in
> our laboratory.
>
>
>
> How can I find a valid license or a free build? Don't need all the
> features of the professional version, but would be very useful.
>

Em qui, 15 de ago de 2019 19:46, Joel Tyndall 
escreveu:

> Details of where to get the appropriate files are available here.
>
>
>
> https://pymolwiki.org/index.php/Windows_Install
>
>
>
> With a little bit of tinkering I was able to install this
>
>
>
> J
>
>
>
> *From:* Pedro Lacerda 
> *Sent:* Wednesday, 14 August 2019 11:22 PM
> *To:* pymol-users@lists.sourceforge.net
> *Subject:* [PyMOL] How to download and install
>
>
>
> Hi,
>
>
>
> I'm unable to build or download and install PyMOL for Windows for free in
> our laboratory.
>
>
>
> How can I find a valid license or a free build? Don't need all the
> features of the professional version, but would be very useful.
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Label volume

2019-08-15 Thread Pedro Lacerda
Hi Thomas,

Cool, I did something like that, copied the selection "%obj and index 1"
then labeled it. So I got an independent label.

Multi-line labels was somewhat hackish:

cmd.label(
label_obj_name,
'"' + "\\n".join([
f'ID {i}',
f'Class {ensemble.klass}',
f'S {ensemble.strength}',
]) + '"'
)


I give up of volumes right now because I didn't figured out how to align
them. The behaviour I wanted was achieved with an "pseudo" atom.

Cheers,

Em qui, 15 de ago de 2019 às 05:49, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

> Hi Pedro,
>
> it's only possible to label atoms. If you need an independent label,
> create a pseudo atom:
>
> pseudoatom label="Hello World"
>
> You can move the atom (or the label) in 3-Button Editing mouse mode while
> holding CTRL and dragging with the left mouse button.
>
> Cheers,
>   Thomas
>
> > On Aug 12, 2019, at 7:01 PM, Pedro Lacerda  wrote:
> >
> > And how to place a single arbitrary label on the object or segment?
> >
> > Em seg, 12 de ago de 2019 às 13:55, Pedro Lacerda 
> escreveu:
> > Hi PyMOL list,
> >
> > Is possible toshow  a label independent of the associated object be
> enabled?
> >
> > Or is possible to label a volume or map?
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular
> > Faculdade de Farmácia / UFBA
> >
> > @pslacerda
> > +55 71 9 9981-1856
> >
> >
> > --
> > Pedro Sousa Lacerda
> >
> > Laboratório de Bioinformática e Modelagem Molecular
> > Faculdade de Farmácia / UFBA
> >
> > @pslacerda
> > +55 71 9 9981-1856
> > ___
> > PyMOL-users mailing list
> > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
> > Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>

-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] count_atoms and states

2019-08-15 Thread Pedro Lacerda
Hi,

Thank you for your effort.

This would be the very best option? Thinking the use case that users need
all the states would be a lot harder.

I would rather let state 0 refer to all the states like now, but upper
nonexistent states give an error. This would remove some errors by 1, and
would work as is for single state objects.

Em qui, 15 de ago de 2019 05:56, Thomas Holder <
thomas.hol...@schrodinger.com> escreveu:

>
> > On Aug 12, 2019, at 2:56 PM, Christian Cole French <
> christian.fre...@schrodinger.com> wrote:
> >
> > Maybe the nonexistent state warning is something that should be
> implemented elsewhere as well.
>
> Selecting state 0 is now an error:
>
>
> https://github.com/schrodinger/pymol-open-source/commit/c09ce287d447e6c703e57d31ae3e5d53f8359ee1
>
> Cheers,
>   Thomas
>
> --
> Thomas Holder
> PyMOL Principal Developer
> Schrödinger, Inc.
>
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] How to download and install

2019-08-14 Thread Pedro Lacerda
Hi,

I'm unable to build or download and install PyMOL for Windows for free in
our laboratory.

How can I find a valid license or a free build? Don't need all the features
of the professional version, but would be very useful.
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Label volume

2019-08-12 Thread Pedro Lacerda
And how to place a single arbitrary label on the object or segment?

Em seg, 12 de ago de 2019 às 13:55, Pedro Lacerda 
escreveu:

> Hi PyMOL list,
>
> Is possible toshow  a label independent of the associated object be
> enabled?
>
> Or is possible to label a volume or map?
> --
> Pedro Sousa Lacerda
>
>
> *Laboratório de Bioinformática e Modelagem Molecular*
> *Faculdade de Farmácia / UFBA*
>
> *@pslacerda*
>
> *+55 71 9 9981-1856*
>


-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] Label volume

2019-08-12 Thread Pedro Lacerda
Hi PyMOL list,

Is possible toshow  a label independent of the associated object be
enabled?

Or is possible to label a volume or map?
-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] count_atoms and states

2019-08-09 Thread Pedro Lacerda
So missing boolean operators are filled with OR, for me this is should be a
big and loud WARNING. I almost messed everything up because it almost
passed in my tests.

Also I mistake states a couple of days on multi-model files because I was
counting from ZERO but states starts on ONE. That was until I needed
get_area, it properly stated that my states were nonexistant.

So these were my personal thoughts and issues about.

Have a nice weekend!

Em sex, 9 de ago de 2019 12:41, Pedro Lacerda 
escreveu:

> Question answered.
>
> Best regards!
>
> Em sex, 9 de ago de 2019 às 12:33, Christian "Cole" French <
> christian.fre...@schrodinger.com> escreveu:
>
>> Hi Pedro,
>>
>> *count_states* is correct here; there's only 1 state, which is state 1.
>> The reason for the observed *count_atoms* behavior is that "polymer" and
>> "state" are different operators in the selection algebra, so putting them
>> together without a logical operator such as "and" or "or" between them
>> indicates an implicit "or". So you're actually counting atoms which match
>> "polymer" *or* "state X", which is why the number only goes up to 8627
>> when you count state 1.
>>
>> This might clear up your scope question as well, but please indicate if
>> otherwise.
>>
>> Best,
>> Cole
>>
>> On Fri, Aug 9, 2019 at 10:55 AM Pedro Lacerda 
>> wrote:
>>
>>> I'm also puzzled by the scope of state:
>>>
>>> *PyMOL>count_atoms polymer state 1 within 5 of resn NAP*
>>>>  count_atoms: 8205 atoms
>>>>
>>>> *PyMOL>count_atoms polymer state 1 within 0 of resn NAP*
>>>>  count_atoms: 8109 atoms
>>>>
>>>> *PyMOL>count_atoms polymer (state 1) within 0 of resn NAP*
>>>>  count_atoms: 8109 atoms
>>>>
>>>> *PyMOL>count_atoms (polymer (state 1)) within 0 of resn NAP*
>>>>  count_atoms: 192 atoms
>>>>
>>>> *PyMOL>count_atoms (polymer (state 0)) within 0 of resn NAP*
>>>>  count_atoms: 0 atoms
>>>>
>>>
>>> Em sex, 9 de ago de 2019 às 11:31, Pedro Lacerda 
>>> escreveu:
>>>
>>>> Hi,
>>>>
>>>> There is only one state but the atom counting changes between states 0,
>>>> 1 and 2.
>>>>
>>>>
>>>> What this means?
>>>>
>>>> *PyMOL>fetch 1e92*
>>>>>
>>>>> TITLE Pteridine reductase 1 from Leishmania major complexed with 
>>>>> NADP+ and dihydrobiopterin
>>>>>  ExecutiveLoad-Detail: Detected mmCIF
>>>>>  CmdLoad: loaded as "1e92".
>>>>>
>>>>> *PyMOL>count_atoms polymer state 0*
>>>>>  count_atoms: 7917 atoms
>>>>>
>>>>> *PyMOL>count_atoms polymer state 1*
>>>>>  count_atoms: 8627 atoms
>>>>>
>>>> *PyMOL>count_atoms polymer state 2*
>>>>>  count_atoms: 7917 atoms
>>>>>
>>>> *PyMOL>count_states *
>>>>>  cmd.count_states: 1 states.
>>>>>
>>>>
>>>> --
>>>> Pedro Sousa Lacerda
>>>>
>>>>
>>>> *Laboratório de Bioinformática e Modelagem Molecular*
>>>> *Faculdade de Farmácia / UFBA*
>>>>
>>>> *@pslacerda*
>>>>
>>>> *+55 71 9 9981-1856*
>>>>
>>>
>>>
>>> --
>>> Pedro Sousa Lacerda
>>>
>>>
>>> *Laboratório de Bioinformática e Modelagem Molecular*
>>> *Faculdade de Farmácia / UFBA*
>>>
>>> *@pslacerda*
>>>
>>> *+55 71 9 9981-1856*
>>> ___
>>> PyMOL-users mailing list
>>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>>> Unsubscribe:
>>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>>
>>
>
> --
> Pedro Sousa Lacerda
>
>
> *Laboratório de Bioinformática e Modelagem Molecular*
> *Faculdade de Farmácia / UFBA*
>
> *@pslacerda*
>
> *+55 71 9 9981-1856*
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] count_atoms and states

2019-08-09 Thread Pedro Lacerda
Question answered.

Best regards!

Em sex, 9 de ago de 2019 às 12:33, Christian "Cole" French <
christian.fre...@schrodinger.com> escreveu:

> Hi Pedro,
>
> *count_states* is correct here; there's only 1 state, which is state 1.
> The reason for the observed *count_atoms* behavior is that "polymer" and
> "state" are different operators in the selection algebra, so putting them
> together without a logical operator such as "and" or "or" between them
> indicates an implicit "or". So you're actually counting atoms which match
> "polymer" *or* "state X", which is why the number only goes up to 8627
> when you count state 1.
>
> This might clear up your scope question as well, but please indicate if
> otherwise.
>
> Best,
> Cole
>
> On Fri, Aug 9, 2019 at 10:55 AM Pedro Lacerda  wrote:
>
>> I'm also puzzled by the scope of state:
>>
>> *PyMOL>count_atoms polymer state 1 within 5 of resn NAP*
>>>  count_atoms: 8205 atoms
>>>
>>> *PyMOL>count_atoms polymer state 1 within 0 of resn NAP*
>>>  count_atoms: 8109 atoms
>>>
>>> *PyMOL>count_atoms polymer (state 1) within 0 of resn NAP*
>>>  count_atoms: 8109 atoms
>>>
>>> *PyMOL>count_atoms (polymer (state 1)) within 0 of resn NAP*
>>>  count_atoms: 192 atoms
>>>
>>> *PyMOL>count_atoms (polymer (state 0)) within 0 of resn NAP*
>>>  count_atoms: 0 atoms
>>>
>>
>> Em sex, 9 de ago de 2019 às 11:31, Pedro Lacerda 
>> escreveu:
>>
>>> Hi,
>>>
>>> There is only one state but the atom counting changes between states 0,
>>> 1 and 2.
>>>
>>>
>>> What this means?
>>>
>>> *PyMOL>fetch 1e92*
>>>>
>>>> TITLE Pteridine reductase 1 from Leishmania major complexed with NADP+ 
>>>> and dihydrobiopterin
>>>>  ExecutiveLoad-Detail: Detected mmCIF
>>>>  CmdLoad: loaded as "1e92".
>>>>
>>>> *PyMOL>count_atoms polymer state 0*
>>>>  count_atoms: 7917 atoms
>>>>
>>>> *PyMOL>count_atoms polymer state 1*
>>>>  count_atoms: 8627 atoms
>>>>
>>> *PyMOL>count_atoms polymer state 2*
>>>>  count_atoms: 7917 atoms
>>>>
>>> *PyMOL>count_states *
>>>>  cmd.count_states: 1 states.
>>>>
>>>
>>> --
>>> Pedro Sousa Lacerda
>>>
>>>
>>> *Laboratório de Bioinformática e Modelagem Molecular*
>>> *Faculdade de Farmácia / UFBA*
>>>
>>> *@pslacerda*
>>>
>>> *+55 71 9 9981-1856*
>>>
>>
>>
>> --
>> Pedro Sousa Lacerda
>>
>>
>> *Laboratório de Bioinformática e Modelagem Molecular*
>> *Faculdade de Farmácia / UFBA*
>>
>> *@pslacerda*
>>
>> *+55 71 9 9981-1856*
>> ___
>> PyMOL-users mailing list
>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>> Unsubscribe:
>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
>

-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] count_atoms and states

2019-08-09 Thread Pedro Lacerda
I'm also puzzled by the scope of state:

*PyMOL>count_atoms polymer state 1 within 5 of resn NAP*
>  count_atoms: 8205 atoms
>
> *PyMOL>count_atoms polymer state 1 within 0 of resn NAP*
>  count_atoms: 8109 atoms
>
> *PyMOL>count_atoms polymer (state 1) within 0 of resn NAP*
>  count_atoms: 8109 atoms
>
> *PyMOL>count_atoms (polymer (state 1)) within 0 of resn NAP*
>  count_atoms: 192 atoms
>
> *PyMOL>count_atoms (polymer (state 0)) within 0 of resn NAP*
>  count_atoms: 0 atoms
>

Em sex, 9 de ago de 2019 às 11:31, Pedro Lacerda 
escreveu:

> Hi,
>
> There is only one state but the atom counting changes between states 0, 1
> and 2.
>
>
> What this means?
>
> *PyMOL>fetch 1e92*
>>
>> TITLE Pteridine reductase 1 from Leishmania major complexed with NADP+ 
>> and dihydrobiopterin
>>  ExecutiveLoad-Detail: Detected mmCIF
>>  CmdLoad: loaded as "1e92".
>>
>> *PyMOL>count_atoms polymer state 0*
>>  count_atoms: 7917 atoms
>>
>> *PyMOL>count_atoms polymer state 1*
>>  count_atoms: 8627 atoms
>>
> *PyMOL>count_atoms polymer state 2*
>>  count_atoms: 7917 atoms
>>
> *PyMOL>count_states *
>>  cmd.count_states: 1 states.
>>
>
> --
> Pedro Sousa Lacerda
>
>
> *Laboratório de Bioinformática e Modelagem Molecular*
> *Faculdade de Farmácia / UFBA*
>
> *@pslacerda*
>
> *+55 71 9 9981-1856*
>


-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] count_atoms and states

2019-08-09 Thread Pedro Lacerda
Hi,

There is only one state but the atom counting changes between states 0, 1
and 2.


What this means?

*PyMOL>fetch 1e92*
>
> TITLE Pteridine reductase 1 from Leishmania major complexed with NADP+ 
> and dihydrobiopterin
>  ExecutiveLoad-Detail: Detected mmCIF
>  CmdLoad: loaded as "1e92".
>
> *PyMOL>count_atoms polymer state 0*
>  count_atoms: 7917 atoms
>
> *PyMOL>count_atoms polymer state 1*
>  count_atoms: 8627 atoms
>
*PyMOL>count_atoms polymer state 2*
>  count_atoms: 7917 atoms
>
*PyMOL>count_states *
>  cmd.count_states: 1 states.
>

-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Selection algebra

2019-08-05 Thread Pedro Lacerda
Thank you, it was really what I asked!



Em seg, 5 de ago de 2019 15:50, Christian "Cole" French <
christian.fre...@schrodinger.com> escreveu:

> select_with_filter allows you to make a selection as you would with the
> select command, so it supports all selection algebra including byres,
> chain, organic, etc. Here's a modified example from the wiki:
>
> # Select all residues within 5 Ang. of any organic small molecules whose
> x-coordinate is at least 50
> select_with_filter sele, br. all within 5 of (organic and flag 8), lambda
> s: cmd.get_extent(s)[0][0] >= 50
>
> Best,
> Cole
>
> On Mon, Aug 5, 2019 at 1:06 PM Pedro Lacerda  wrote:
>
>> Yes, one more question.
>>
>> How to use all other "functions", like byres, "chain A" or "organic"?
>>
>> Em seg, 5 de ago de 2019 12:36, Christian "Cole" French <
>> christian.fre...@schrodinger.com> escreveu:
>>
>>> I see now. I updated the code at the link in my previous email to
>>> provide behavior which should allow you to do what you want. Here are your
>>> examples written using the command:
>>>
>>> select_with_filter sele, flag 8, lambda s: len(cmd.get_chains(s)) < 2
>>> select_with_filter sele, flag 8, lambda s: cmd.get_fastastr(s) < 2
>>> select_with_filter sele, flag 8 and chain A, lambda s: peplength(s) < 15
>>>
>>> If you want to write and use your own multi-line function, you can write
>>> a script and cmd.extend('your_function', your_function), then use
>>> your_function in select_with_filter.
>>>
>>> Please let me know if you have any further questions.
>>>
>>> Best,
>>> Cole
>>>
>>> On Mon, Aug 5, 2019 at 8:30 AM Pedro Lacerda 
>>> wrote:
>>>
>>>> I expressed myself wrong, I'm looking something like:
>>>>
>>>>select peplength < 15 and chain A
>>>>
>>>> Where peplength is an user defined function like:
>>>>
>>>> def peplength(atom):
>>>> return compute_peplength(atom)
>>>>
>>>> I'm looking for the availability of user defined functions on selection
>>>> expressions. How to?
>>>>
>>>> Em sex, 2 de ago de 2019 às 15:44, Christian "Cole" French <
>>>> christian.fre...@schrodinger.com> escreveu:
>>>>
>>>>> Edit: remove the cmd. part when running select_with_filter. (Since
>>>>> it's a custom command, it doesn't belong to the cmd module.)
>>>>>
>>>>> On Fri, Aug 2, 2019 at 2:41 PM Christian "Cole" French <
>>>>> christian.fre...@schrodinger.com> wrote:
>>>>>
>>>>>> Hi Pedro Lacerda,
>>>>>>
>>>>>> Here is a link to a script I wrote which adds a command which does
>>>>>> what you ask:
>>>>>> https://gist.github.com/ColeFrench/6f68fa5f04a67bb6234f10c25debb865.
>>>>>> To use it, download the file to the directory where you run PyMOL from,
>>>>>> then open PyMOL and run run select_with_filter.py.
>>>>>>
>>>>>> For your examples, the commands would be 
>>>>>> cmd.select_with_filter(predicate=lambda
>>>>>> s: len(cmd.get_chains(s)) < 2) and 
>>>>>> cmd.select_with_filter(predicate=lambda
>>>>>> s: cmd.get_fastastr(s) < 2).
>>>>>>
>>>>>> Commands which can be simply run are a convenience which allows you
>>>>>> to type less (e.g., select chain A instead of cmd.select('chain A')).
>>>>>> Some commands require different arguments and can only be run the longer
>>>>>> way, such as the one I wrote which takes a function as an argument.
>>>>>>
>>>>>> Hope this helps,
>>>>>> Cole
>>>>>>
>>>>>> On Fri, Aug 2, 2019 at 11:45 AM Pedro Lacerda 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi PyMOL users,
>>>>>>>
>>>>>>> It there any way to enhance the selecion algebra with functions? For
>>>>>>> instance:
>>>>>>>
>>>>>>> select len(get_chains(*)) < 2
>>>>>>>>
>>>>>>>
>>>>>>> Or even:
>>>>>>>
>>>>>>> select cmd.get_fastastr(*) < 2
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> By the way, why some commands we can simply run (like get_chains)
>>>>>>> and others are different (like cmd.get_fastastr())?
>>>>>>>
>>>>>>> --
>>>>>>> Pedro Sousa Lacerda
>>>>>>>
>>>>>>>
>>>>>>> *Laboratório de Bioinformática e Modelagem Molecular*
>>>>>>> *Faculdade de Farmácia / UFBA*
>>>>>>>
>>>>>>> *@pslacerda*
>>>>>>>
>>>>>>> *+55 71 9 9981-1856*
>>>>>>> ___
>>>>>>> PyMOL-users mailing list
>>>>>>> Archives:
>>>>>>> http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>>>>>>> Unsubscribe:
>>>>>>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>>>>>>
>>>>>>
>>>>
>>>> --
>>>> Pedro Sousa Lacerda
>>>>
>>>>
>>>> *Laboratório de Bioinformática e Modelagem Molecular*
>>>> *Faculdade de Farmácia / UFBA*
>>>>
>>>> *@pslacerda*
>>>>
>>>> *+55 71 9 9981-1856*
>>>>
>>> ___
>> PyMOL-users mailing list
>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>> Unsubscribe:
>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Selection algebra

2019-08-05 Thread Pedro Lacerda
Yes, one more question.

How to use all other "functions", like byres, "chain A" or "organic"?

Em seg, 5 de ago de 2019 12:36, Christian "Cole" French <
christian.fre...@schrodinger.com> escreveu:

> I see now. I updated the code at the link in my previous email to provide
> behavior which should allow you to do what you want. Here are your examples
> written using the command:
>
> select_with_filter sele, flag 8, lambda s: len(cmd.get_chains(s)) < 2
> select_with_filter sele, flag 8, lambda s: cmd.get_fastastr(s) < 2
> select_with_filter sele, flag 8 and chain A, lambda s: peplength(s) < 15
>
> If you want to write and use your own multi-line function, you can write a
> script and cmd.extend('your_function', your_function), then use
> your_function in select_with_filter.
>
> Please let me know if you have any further questions.
>
> Best,
> Cole
>
> On Mon, Aug 5, 2019 at 8:30 AM Pedro Lacerda  wrote:
>
>> I expressed myself wrong, I'm looking something like:
>>
>>select peplength < 15 and chain A
>>
>> Where peplength is an user defined function like:
>>
>> def peplength(atom):
>> return compute_peplength(atom)
>>
>> I'm looking for the availability of user defined functions on selection
>> expressions. How to?
>>
>> Em sex, 2 de ago de 2019 às 15:44, Christian "Cole" French <
>> christian.fre...@schrodinger.com> escreveu:
>>
>>> Edit: remove the cmd. part when running select_with_filter. (Since it's
>>> a custom command, it doesn't belong to the cmd module.)
>>>
>>> On Fri, Aug 2, 2019 at 2:41 PM Christian "Cole" French <
>>> christian.fre...@schrodinger.com> wrote:
>>>
>>>> Hi Pedro Lacerda,
>>>>
>>>> Here is a link to a script I wrote which adds a command which does what
>>>> you ask:
>>>> https://gist.github.com/ColeFrench/6f68fa5f04a67bb6234f10c25debb865.
>>>> To use it, download the file to the directory where you run PyMOL from,
>>>> then open PyMOL and run run select_with_filter.py.
>>>>
>>>> For your examples, the commands would be 
>>>> cmd.select_with_filter(predicate=lambda
>>>> s: len(cmd.get_chains(s)) < 2) and cmd.select_with_filter(predicate=lambda
>>>> s: cmd.get_fastastr(s) < 2).
>>>>
>>>> Commands which can be simply run are a convenience which allows you to
>>>> type less (e.g., select chain A instead of cmd.select('chain A')).
>>>> Some commands require different arguments and can only be run the longer
>>>> way, such as the one I wrote which takes a function as an argument.
>>>>
>>>> Hope this helps,
>>>> Cole
>>>>
>>>> On Fri, Aug 2, 2019 at 11:45 AM Pedro Lacerda 
>>>> wrote:
>>>>
>>>>> Hi PyMOL users,
>>>>>
>>>>> It there any way to enhance the selecion algebra with functions? For
>>>>> instance:
>>>>>
>>>>> select len(get_chains(*)) < 2
>>>>>>
>>>>>
>>>>> Or even:
>>>>>
>>>>> select cmd.get_fastastr(*) < 2
>>>>>>
>>>>>
>>>>>
>>>>> By the way, why some commands we can simply run (like get_chains) and
>>>>> others are different (like cmd.get_fastastr())?
>>>>>
>>>>> --
>>>>> Pedro Sousa Lacerda
>>>>>
>>>>>
>>>>> *Laboratório de Bioinformática e Modelagem Molecular*
>>>>> *Faculdade de Farmácia / UFBA*
>>>>>
>>>>> *@pslacerda*
>>>>>
>>>>> *+55 71 9 9981-1856*
>>>>> ___
>>>>> PyMOL-users mailing list
>>>>> Archives:
>>>>> http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>>>>> Unsubscribe:
>>>>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>>>>
>>>>
>>
>> --
>> Pedro Sousa Lacerda
>>
>>
>> *Laboratório de Bioinformática e Modelagem Molecular*
>> *Faculdade de Farmácia / UFBA*
>>
>> *@pslacerda*
>>
>> *+55 71 9 9981-1856*
>>
>
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

Re: [PyMOL] Selection algebra

2019-08-05 Thread Pedro Lacerda
I expressed myself wrong, I'm looking something like:

   select peplength < 15 and chain A

Where peplength is an user defined function like:

def peplength(atom):
return compute_peplength(atom)

I'm looking for the availability of user defined functions on selection
expressions. How to?

Em sex, 2 de ago de 2019 às 15:44, Christian "Cole" French <
christian.fre...@schrodinger.com> escreveu:

> Edit: remove the cmd. part when running select_with_filter. (Since it's a
> custom command, it doesn't belong to the cmd module.)
>
> On Fri, Aug 2, 2019 at 2:41 PM Christian "Cole" French <
> christian.fre...@schrodinger.com> wrote:
>
>> Hi Pedro Lacerda,
>>
>> Here is a link to a script I wrote which adds a command which does what
>> you ask:
>> https://gist.github.com/ColeFrench/6f68fa5f04a67bb6234f10c25debb865. To
>> use it, download the file to the directory where you run PyMOL from, then
>> open PyMOL and run run select_with_filter.py.
>>
>> For your examples, the commands would be 
>> cmd.select_with_filter(predicate=lambda
>> s: len(cmd.get_chains(s)) < 2) and cmd.select_with_filter(predicate=lambda
>> s: cmd.get_fastastr(s) < 2).
>>
>> Commands which can be simply run are a convenience which allows you to
>> type less (e.g., select chain A instead of cmd.select('chain A')). Some
>> commands require different arguments and can only be run the longer way,
>> such as the one I wrote which takes a function as an argument.
>>
>> Hope this helps,
>> Cole
>>
>> On Fri, Aug 2, 2019 at 11:45 AM Pedro Lacerda 
>> wrote:
>>
>>> Hi PyMOL users,
>>>
>>> It there any way to enhance the selecion algebra with functions? For
>>> instance:
>>>
>>> select len(get_chains(*)) < 2
>>>>
>>>
>>> Or even:
>>>
>>> select cmd.get_fastastr(*) < 2
>>>>
>>>
>>>
>>> By the way, why some commands we can simply run (like get_chains) and
>>> others are different (like cmd.get_fastastr())?
>>>
>>> --
>>> Pedro Sousa Lacerda
>>>
>>>
>>> *Laboratório de Bioinformática e Modelagem Molecular*
>>> *Faculdade de Farmácia / UFBA*
>>>
>>> *@pslacerda*
>>>
>>> *+55 71 9 9981-1856*
>>> ___
>>> PyMOL-users mailing list
>>> Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
>>> Unsubscribe:
>>> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
>>
>>

-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] pymol2 and multiprocessing issues

2019-08-01 Thread Pedro Lacerda
Hi,

I'm using pymol2.PyMOL() to instantiate a PyMOL session per process but it
is struggling at threading locks wasting all the time locked (ie doing
nothing).

My job function only the following commands from PyMOL: fetch, align,
get_model and delete. It clean all the objects within the function itself.

I didn't even tried start()/stop() because the pool has only eight
processes.

-- 
Pedro Sousa Lacerda


*Laboratório de Bioinformática e Modelagem Molecular*
*Faculdade de Farmácia / UFBA*

*@pslacerda*

*+55 71 9 9981-1856*
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe

[PyMOL] Display running commands

2019-02-21 Thread Pedro Lacerda
Hi,

I want to show executed commands when right before they run, so I can track
my script execution.

Something like the following for all the commands:

orig_create = cmd.create
def create(*args, **kwargs):
print('create', repr(args), repr(kwargs))
orig_create(*args, **kwargs)
cmd.create = create


I also want it to figure out what commands some GUI actions really do. Like
those in presets and so on.

There is some verbose option that does it?

Thank you,
Pedro Lacerda
___
PyMOL-users mailing list
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net
Unsubscribe: 
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe