This is a read-only mirror of pymolwiki.org

Difference between revisions of "Get fastastr"

From PyMOL Wiki
Jump to navigation Jump to search
(Created page with "== cmd.get_fastastr == Do you have a pdb file which come from a modelling program?<br> Are you unsure about which amino sequence is in the "long" pdb file? What you really want...")
 
(rewrite of page)
Line 1: Line 1:
== cmd.get_fastastr ==
+
[[get_fastastr]] is an API-only function which returns the one-letter amino acid sequence in FASTA format.
  
Do you have a pdb file which come from a modelling program?<br>
+
== PyMOL API ==
Are you unsure about which amino sequence is in the "long" pdb file?
 
  
What you really want is to: '''get the FASTA string''' ?
+
<syntaxhighlight lang="python">
 +
cmd.get_fastastr(string selection='all', int state=-1, int quiet=1)
 +
</syntaxhighlight>
  
Then write in pymol:
+
== Example ==
'''print cmd.get_fastastr('all')'''
 
  
That will give you the sequence.
+
<syntaxhighlight lang="python">
 +
fetch 1ubq, async=0
 +
print cmd.get_fastastr('all')
 +
</syntaxhighlight>
 +
 
 +
>1ubq
 +
MQIFVKTLTGKTITLEVEPSDTIENVKAKIQDKEGIPPDQQRLIFAGKQLEDGRTLSDYNIQKESTLHLV
 +
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 ==
 +
 
 +
* [[Aa codes]]

Revision as of 15:30, 8 February 2012

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

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

Known Issues

  • Due to a bug this function currently only works for selections from a single object (see #3466472)
  • The sequences of different chains are just concatenated and returned as a single sequence

See Also