text: user7459: 0.980634         -                    572         sp|P06672|PDC_ZYMMO                         -                     568                               1.2e-263             874.5          0.0            1        1      6.6e-267  1.4e-263   874.2      0.0       5         562    15     570    12     572    0.98   Uncharacterized                         protein                   OS=Lomentospora            prolificans        OX=41688             GN=jhhlp_005678  PE=3             SV=1
  
  I've asked a similar question before. I have a better understanding of python now and would like to revisit this. Can someone critique my thinking?
  I have an HMM output file that contains about 20 fields. There are two sets of IDs, e.g., P006672 and jhhlp_005678
  In a separate file are FASTA-formatted sequences linked to these IDs.
  Proposed solution:
  1
     a) read in fields containing IDs, lets called them fields 8 and 6; 
  
  
     b) store field values in an array or dictionary (whatever the proper data structure is for 
    this). Let's called this Fields_8_and_6
  
  
  a) read proteome file containing FASTA-formatted sequences
  b) Grep and store as ID:sequence key:value pairs; let's call this ID_to_sequence
  
  a) Compare Fields_8_and_6 to ID_to_sequence
  b) Write ID1:sequence1 ID2:sequence2 as pairs into one file
  
  
  
  send to ClustalO
  
  
  
  user3818: Biopython can index a fastafile and you can access the sequences by their ID in a dict-like manner.
  All that is left for you to do is extract the IDs from your file. (more Biopython)
  
original_text: 7459: <pre><code>0.980634         -                    572         sp|P06672|PDC_ZYMMO                         -                     568                               1.2e-263             874.5          0.0            1        1      6.6e-267  1.4e-263   874.2      0.0       5         562    15     570    12     572    0.98   Uncharacterized                         protein                   OS=Lomentospora            prolificans        OX=41688             GN=jhhlp_005678  PE=3             SV=1
  </code></pre>
  <p>I've asked a similar question before. I have a better understanding of python now and would like to revisit this. Can someone critique my thinking?</p>
  <p>I have an HMM output file that contains about 20 fields. There are two sets of IDs, e.g., P006672 and jhhlp_005678</p>
  <p>In a separate file are FASTA-formatted sequences linked to these IDs.</p>
  <p>Proposed solution:</p>
  <p>1</p>
  <pre><code>   a) read in fields containing IDs, lets called them fields 8 and 6; 
  
  
     b) store field values in an array or dictionary (whatever the proper data structure is for 
    this). Let's called this Fields_8_and_6
  </code></pre>
  <ol start="2">
  <li><p>a) read proteome file containing FASTA-formatted sequences</p>
  <p>b) Grep and store as ID:sequence key:value pairs; let's call this ID_to_sequence</p>
  </li>
  <li><p>a) Compare Fields_8_and_6 to ID_to_sequence</p>
  <p>b) Write ID1:sequence1 ID2:sequence2 as pairs into one file</p>
  </li>
  </ol>
  <ol start="4">
  <li><p>send to ClustalO</p>
  </li>
  </ol>
   3818: <p><a href="http://biopython.org/DIST/docs/tutorial/Tutorial.html#sec63" rel="nofollow noreferrer">Biopython can index a fastafile</a> and you can access the sequences by their ID in a dict-like manner.</p>
  <p>All that is left for you to do is extract the IDs from your file. (<a href="https://biopython.org/DIST/docs/api/Bio.SearchIO.HmmerIO-module.html" rel="nofollow noreferrer">more Biopython</a>)</p>
  