text: user3848: I'm downloading translated viral genomes initially via Blast - which had shortcomings - and now by efetch.
  What I want to do is obtain a complete list of all translated protein ids from a nucleotide Genbank entry.
  efetch -db nucleotide -format gpc -id MT039887 | xtract -insd ....
  
  The protein id and the translated gene sequences are within the efetch -db nucleotide -format gpc -id MT039887 output ... but how do I use xtract to parse them?
  
  user4282: If you want the cds in fasta format, try:
  esearch -db nucleotide -query MT039887 | efetch -format fasta_cds_na
  
  And for the proteins sequence in fasta format:
  elink -db nucleotide -target protein -id MT039887 | efetch -format fasta 
  
  
  user3577: In case you are still interested in just getting the protein ids and not sequence, you can use xtract like this: 
  efetch -db nucleotide -format gpc -id MT039887 | xtract  -insd CDS gene product protein_id 
  MT039887.1  orf1ab  orf1ab polyprotein           QHZ00388.1
  MT039887.1  S       surface glycoprotein         QHZ00389.1
  MT039887.1  orf3a   orf3a protein                QHZ00390.1
  MT039887.1  E       envelope protein             QHZ00391.1
  MT039887.1  M       membrane glycoprotein        QHZ00392.1
  MT039887.1  orf6    orf6 protein                 QHZ00393.1
  MT039887.1  orf7a   orf7a protein                QHZ00394.1
  MT039887.1  orf8    orf8 protein                 QHZ00395.1
  MT039887.1  N       nucleocapsid phosphoprotein  QHZ00396.1
  MT039887.1  orf10   orf10 protein                QHZ00397.1
  
  
original_text: 3848: <p>I'm downloading translated viral genomes initially via Blast - which had shortcomings - and now by <code>efetch</code>.</p>
  
  <p>What I want to do is obtain a complete list of all translated protein ids from a nucleotide Genbank entry.</p>
  
  <pre><code>efetch -db nucleotide -format gpc -id MT039887 | xtract -insd ....
  </code></pre>
  
  <p>The protein id and the translated gene sequences are within the <code>efetch -db nucleotide -format gpc -id MT039887</code> output ... but how do I use <code>xtract</code> to parse them?</p>
   4282: <p>If you want the cds in fasta format, try:</p>
  
  <pre><code>esearch -db nucleotide -query MT039887 | efetch -format fasta_cds_na
  </code></pre>
  
  <p>And for the proteins sequence in fasta format:</p>
  
  <pre><code>elink -db nucleotide -target protein -id MT039887 | efetch -format fasta 
  </code></pre>
   3577: <p>In case you are still interested in just getting the protein ids and not sequence, you can use <code>xtract</code> like this: </p>
  
  <pre><code>efetch -db nucleotide -format gpc -id MT039887 | xtract  -insd CDS gene product protein_id 
  MT039887.1  orf1ab  orf1ab polyprotein           QHZ00388.1
  MT039887.1  S       surface glycoprotein         QHZ00389.1
  MT039887.1  orf3a   orf3a protein                QHZ00390.1
  MT039887.1  E       envelope protein             QHZ00391.1
  MT039887.1  M       membrane glycoprotein        QHZ00392.1
  MT039887.1  orf6    orf6 protein                 QHZ00393.1
  MT039887.1  orf7a   orf7a protein                QHZ00394.1
  MT039887.1  orf8    orf8 protein                 QHZ00395.1
  MT039887.1  N       nucleocapsid phosphoprotein  QHZ00396.1
  MT039887.1  orf10   orf10 protein                QHZ00397.1
  </code></pre>
  