text: user2286: My task is to count the mutations  occurred in several proteins after a treatment. The sequences are all present in the two files in the same order. I opened both files with the FASTA parser (SeqIO.parse) in Biopython and I got all the proteins listed (separated before and after the treatment).
  How can I zip the parsers together to count the mutations?
  How can I count the mutations that occured after the treatment?
  from Bio import SeqIO
  for normal_samples in SeqIO.parse("/data/statistic/normal_samples", "fasta"):
      print(normal_samples.id)
      print(repr(normal_samples.seq))
      print(len(normal_samples))
  
  for treated_samples in SeqIO.parse("/data/statistic/with_treatment", "fasta"):
      print(normal_samples.id)
      print(repr(normal_samples.seq))
      print(len(normal_samples))
  
  dict_n_t = dict(zip(normal_samples & treated_samples))
  
  
  user77: from Bio import SeqIO
  for normal, treated in zip(SeqIO.parse("/data/statistic/normal_samples", "fasta"),
                             SeqIO.parse("/data/statistic/with_treatment", "fasta")):
      ... do stuff...
  
  That's generally how you zip iterators together in python.
  
original_text: 2286: <p>My task is to count the mutations  occurred in several proteins after a treatment. The sequences are all present in the two files in the same order. I opened both files with the FASTA parser (<code>SeqIO.parse</code>) in Biopython and I got all the proteins listed (separated before and after the treatment).</p>
  
  <p>How can I zip the parsers together to count the mutations?</p>
  
  <p>How can I count the mutations that occured after the treatment?</p>
  
  <pre><code>from Bio import SeqIO
  for normal_samples in SeqIO.parse("/data/statistic/normal_samples", "fasta"):
      print(normal_samples.id)
      print(repr(normal_samples.seq))
      print(len(normal_samples))
  
  for treated_samples in SeqIO.parse("/data/statistic/with_treatment", "fasta"):
      print(normal_samples.id)
      print(repr(normal_samples.seq))
      print(len(normal_samples))
  
  dict_n_t = dict(zip(normal_samples &amp; treated_samples))
  </code></pre>
   77: <pre><code>from Bio import SeqIO
  for normal, treated in zip(SeqIO.parse("/data/statistic/normal_samples", "fasta"),
                             SeqIO.parse("/data/statistic/with_treatment", "fasta")):
      ... do stuff...
  </code></pre>
  
  <p>That's generally how you <code>zip</code> iterators together in python.</p>
  