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 <[email protected]> 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/[email protected]
> Unsubscribe:
> https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe
--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.
_______________________________________________
PyMOL-users mailing list
Archives: http://www.mail-archive.com/[email protected]
Unsubscribe:
https://sourceforge.net/projects/pymol/lists/pymol-users/unsubscribe