Answers.Body: <p>In A2M format, upper case letters represent matches, lower case letters represent inserts, dashes represent deletions, and dots (or spaces outside the identifier lines) represent gaps aligned to inserts.
  So, both &quot;-&quot; and &quot;.&quot; are essentially gaps, but assumed to have different origin. This information is supplementary, and most MSA programs ignore dots and spaces or treat them incorrectly.</p>
  <p>The code you're looking at, in lines 187–197, removes sequences that contain characters not from <code>self.alphabet</code> (defined in lines 74–86) by checking <code>if letter not in alphabet_set and letter != &quot;-&quot;</code> (line 192). Therefore, just for the sake of parsimony, it looks natural to transform &quot;.&quot; into &quot;-&quot; beforehand.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-24T19:32:14.047Z
Answers.Text: Thanks for the explanation!
Answers.UserDisplayName: Luca
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-24T18:12:36.893Z
Answers.LastActivityDate: 2021-11-24T18:12:36.893Z
Answers.UserDisplayName: Stas Malavin
Body: <p>I am a software engineer and not a bioinformatician. I am looking at some code where they are looking at aligned proteins that are in the A2M alignment format (<a href="https://compbio.soe.ucsc.edu/a2m-desc.html" rel="nofollow noreferrer">https://compbio.soe.ucsc.edu/a2m-desc.html</a>).</p>
  <p>According to the page, the</p>
  <pre><code>Uppercase characters and &quot;-&quot; represent alignment columns, 
  and there must be exactly the same number of alignment columns in each sequence
  </code></pre>
  <p>Now, the code I am looking at is doing something like:</p>
  <pre><code>sequence = sequence.replace(&quot;.&quot;,&quot;-&quot;)
  </code></pre>
  <p>So replacing the dots with hyphen and I am not sure what the purpose of that might be.</p>
  <p>For anyone interested, the code is here (See line 182): <a href="https://github.com/debbiemarkslab/DeepSequence/blob/master/DeepSequence/helper.py" rel="nofollow noreferrer">https://github.com/debbiemarkslab/DeepSequence/blob/master/DeepSequence/helper.py</a></p>
  
Tags: <phylogenetics><data-preprocessing><sequence-annotation>
Title: replacing periods with hyphen
ThreadText: # replacing periods with hyphen
  
  (Asked by: username_0 on 2021-11-24)
  
  I am a software engineer and not a bioinformatician. I am looking at some code where they are looking at aligned proteins that are in the A2M alignment format (<https://compbio.soe.ucsc.edu/a2m-desc.html>).
  
  According to the page, the
  
  ```
  Uppercase characters and "-" represent alignment columns, 
  and there must be exactly the same number of alignment columns in each sequence
  
  ```
  
  Now, the code I am looking at is doing something like:
  
  ```
  sequence = sequence.replace(".","-")
  
  ```
  
  So replacing the dots with hyphen and I am not sure what the purpose of that might be.
  
  For anyone interested, the code is here (See line 182): <https://github.com/debbiemarkslab/DeepSequence/blob/master/DeepSequence/helper.py>
  
  **Tags:** phylogenetics, data-preprocessing, sequence-annotation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-11-24. Score: 2 | Accepted answer
  
  In A2M format, upper case letters represent matches, lower case letters represent inserts, dashes represent deletions, and dots (or spaces outside the identifier lines) represent gaps aligned to inserts.
  So, both "-" and "." are essentially gaps, but assumed to have different origin. This information is supplementary, and most MSA programs ignore dots and spaces or treat them incorrectly.
  
  The code you're looking at, in lines 187–197, removes sequences that contain characters not from `self.alphabet` (defined in lines 74–86) by checking `if letter not in alphabet_set and letter != "-"` (line 192). Therefore, just for the sake of parsimony, it looks natural to transform "." into "-" beforehand.
  
  > **Comments:**
  > **username_0**: Thanks for the explanation!  
  
  ---
  
  