Get fastastr: Difference between revisions

From PyMOLWiki
Jump to navigation Jump to search
(rewrite of page)
(Nucleic acid support)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[get_fastastr]] is an API-only function which returns the one-letter amino acid sequence in FASTA format.
[[get_fastastr]] is an API-only function which returns the one-letter amino acid sequence in FASTA format.
''Changed in PyMOL 2.2: Sequences per chain''
''Changed in PyMOL 2.2: Nucleic acid support''


== PyMOL API ==
== PyMOL API ==
Line 11: Line 15:
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
fetch 1ubq, async=0
fetch 1ubq, async=0
print cmd.get_fastastr('all')
print(cmd.get_fastastr('all'))
</syntaxhighlight>
</syntaxhighlight>


Line 17: Line 21:
  MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLV
  MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLV
  LRLRGG
  LRLRGG
== Known Issues ==
* Due to a bug this function currently only works for selections from a single object (see [https://sourceforge.net/tracker/?func=detail&aid=3466472&group_id=4546&atid=104546 #3466472])
* The sequences of different chains are just concatenated and returned as a single sequence


== See Also ==
== See Also ==


* [[Aa codes]]
* [[Aa codes]]

Latest revision as of 12:49, 30 July 2020

get_fastastr is an API-only function which returns the one-letter amino acid sequence in FASTA format.

Changed in PyMOL 2.2: Sequences per chain

Changed in PyMOL 2.2: Nucleic acid support

PyMOL API

cmd.get_fastastr(string selection='all', int state=-1, int quiet=1)

Example

fetch 1ubq, async=0
print(cmd.get_fastastr('all'))
>1ubq
MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLV
LRLRGG

See Also