Answers.Body: <p>At the command, change the current directory to your target directory:</p>
  <pre><code>cd my-directory-path-containing-my-files
  </code></pre>
  <p>Load the file:</p>
  <pre><code>load 1a62.pdb
  </code></pre>
  <p>Then you can either print to screen or save to a file:</p>
  <pre><code>print(cmd.get_fastastr('all'))
  
  save 1a62.fasta
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-28T14:46:59.883Z
Answers.Text: A small caveat for `get_fastastr` is that the fasta sequence returned does not include gaps in the numbering, therefore, a multiline command using `[int(atom.resi) for atom in cmd.get_model('name CA').atom]` may be required in some cases.
Answers.UserDisplayName: Matteo Ferla
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-26T13:24:04.450Z
Answers.LastActivityDate: 2022-02-28T01:40:05.180Z
Answers.LastEditDate: 2022-02-28T01:40:05.180Z
Answers.UserDisplayName: Supertech
Body: <p>What is the command in PyMOL for listing all the amino acids in a specific protein, say, 1a62.pdb?</p>
  
Tags: <pdb><pymol>
Title: How can I list all amino acids in a protein using PyMOL?
ThreadText: # How can I list all amino acids in a protein using PyMOL?
  
  (Asked by: username_0 on 2022-02-26)
  
  What is the command in PyMOL for listing all the amino acids in a specific protein, say, 1a62.pdb?
  
  **Tags:** pdb, pymol
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-02-26. Score: 2
  
  At the command, change the current directory to your target directory:
  
  ```
  cd my-directory-path-containing-my-files
  
  ```
  
  Load the file:
  
  ```
  load 1a62.pdb
  
  ```
  
  Then you can either print to screen or save to a file:
  
  ```
  print(cmd.get_fastastr('all'))
  
  save 1a62.fasta
  
  ```
  
  > **Comments:**
  > **username_2**: A small caveat for `get_fastastr` is that the fasta sequence returned does not include gaps in the numbering, therefore, a multiline command using `[int(atom.resi) for atom in cmd.get_model('name CA').atom]` may be required in some cases.  
  
  ---
  
  