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 <pslace...@gmail.com> 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 <pslace...@gmail.com> 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.



_______________________________________________
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

Reply via email to