Answers.Body: <p>Your overall approach is cool, given caveats (below) to adapt the method. I can fairly authoritatively say your specific methodological approach will not work regarding its phylogenetic strategy without changing it. This is due to a phenomenon where the number of mutations becomes so great it is impossible to recover the ancestral state, basically it randomises the phylogenetic signal, this especially occurs at the 3rd codon nucleotide positions, i.e. 1 in every 3 nucleotides, 33.3% of the entire data set. This violates a central tenant of phylogenetic theory, therefore I am afraid that you cannot build a tree using this approach, but again you can adapt it to work (below).</p>
  <p>If you want only to use nucleotides then 16S is the only target available. However, 16S has been a good target for amphibians, therefore just aligning that gene and building a tree is cool. Its perfectly solid given prior work in vertebrates ...</p>
  <blockquote>
  <p><a href="https://doi.org/10.1186/s12862-022-01994-y" rel="nofollow noreferrer">Chan, K.O., Hertwig, S.T., Neokleous, D.N. et al. Widely used, short 16S rRNA mitochondrial gene fragments yield poor and erratic results in phylogenetic estimation and species delimitation of amphibians. BMC Ecol Evo 22, 37 (2022).</a></p>
  </blockquote>
  <p>If you wish to use protein coding genes you need to switch amino acids and align those. In terms of conservation there alot of established tools rather than &quot;reinvent the wheel&quot;. One program you could consider is <strong>AAcon</strong>, <a href="http://www.compbio.dundee.ac.uk/aacon/" rel="nofollow noreferrer">available here</a>. This would give you can empirical basis for deducing which gene is</p>
  <ul>
  <li>the most conserved</li>
  <li>the most represented, i.e. &quot;read-depth&quot;, or species representation.</li>
  </ul>
  <p>... after its aligned, thereby yielding a genetic marker for phylogenetics. It uses a large number of metrics therefore most scenarios would be accommodated.</p>
  <p>COX1 is good target and likely gene to emerge from AAcon analysis.</p>
  <p>Building protein phylogenetic trees is a separate question.</p>
  <hr />
  <p><strong>Lacking computational power to align</strong>. That is solvable, even on small computers, and you can place that as a separate question stating your computer capacity (RAM and CPUs). It's not difficult to align 1000s even on a small machine, it's simply the strategy to do this. Algorithm performance and accuracy change rapidly.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-24T14:42:38.233Z
Answers.LastActivityDate: 2023-10-24T15:43:20.290Z
Answers.LastEditDate: 2023-10-24T15:43:20.290Z
Answers.UserDisplayName: M__
Answers.Body: <p>It looks like these are random mitochondrial sequences pulled from NCBI, which is probably why the alignments aren't working well.</p>
  <p>As a starting point, I recommend you make sure that all the mitochondrial DNA sequences are rotated and reverse-complemented as necessary to make sure that the same gene matches position 1 of the sequence. I prefer doing this for COX1, because it's a well-conserved gene. After doing that, it'll be much easier to look at the alignment of that gene alone, which will give you an idea of the complexity of extending the task to the full length of the mitochondrial genome.</p>
  <p>I don't expect you'll find a long exact-match sequence that is consistently conserved across all species, even within COX1. It wouldn't surprise me if the longest conserved sequence were less than 16bp, with a few repeats of that sequence throughout the genome. If that is the case, you need to think about what to do with that information. Given the complexity of this intermediate problem you've asked about, it would be a good idea to think first about what you would do after you discovered there were no such sequence.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-24T03:14:01.213Z
Answers.LastActivityDate: 2023-10-24T03:19:09.880Z
Answers.LastEditDate: 2023-10-24T03:19:09.880Z
Answers.UserDisplayName: gringer
Body: <p>I would like to create a phylogenetic tree for the most species in my dataset.</p>
  <p>I'm starting with around 1200 species, but since it's not good practice to align short and long sequences I tried filtering only for the species with the [15k-18k bp] range in length, but this leaves me with around 350 species in total.</p>
  <p>Those sequences vary a lot in size, here's an histogram of the number of species I have data for
  <a href="https://i.sstatic.net/aYzXX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/aYzXX.png" alt="enter image description here" /></a>
  As you can see I have a lot of sequences with length [12k-15k bp] and [15k-18k bp] (values on the x axis are scaled by a factor of 3000 and then rounded).
  I would like maximise the species genetic information.<br />
  To do so I would like to extract the part of genome that is shared the most among all the species.</p>
  <p>Is this achievable by using a regex?<br />
  I am not sure on the length and type of the query to be sure of not extracting non-homologous regions as it would create a big problem later on for the phylogenetic tree creation.</p>
  <p>I can't make an alignment for all species because of the lack of computational power. That is why I'm trying to subset a piece of DNA that is the most shared (prior to the alignment, but I don't know if that is doable or logic)</p>
  <p>My question is: how would you proceed to get the most phylogenetic data out of this dataset?</p>
  <p>If you would use a regex, what type of query would you use?</p>
  <h1>More Info</h1>
  <h3>Alignment</h3>
  <p>When I try to align 10 sequences drawn from the [15k-18k bp] range I get this result (the numbers on the right are the TaxID of the species).<br />
  <a href="https://i.sstatic.net/W53d5.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/W53d5.png" alt="enter image description here" /></a>
  We can't see much here so I used an online MSA viewer
  [https://alignmentviewer.org/]
  <a href="https://i.sstatic.net/1UKNq.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/1UKNq.png" alt="enter image description here" /></a></p>
  <h3>Data</h3>
  <p>My data is one Fasta file containing mitochondrial genomes for all the species.</p>
  <p>To do this preliminary analysis I only used 10 randomly chosen species with a sequence of length in the range [15k-18k bp].</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-23T13:47:42.323Z
Comments.Text: Have you considered using only genes for the alignment instead of the entire sequence?
Comments.UserDisplayName: terdon
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-24T01:55:20.297Z
Comments.Text: Is there a way for you to find an existing vertebrate phylogeny (this seems to be your group of interest) based on a larger set of sequences and to prune it to the set you care about? e.g. idk [here](http://timetree.org/book), see .newick and .tre dowloads. [iTOL](https://itol.embl.de/) makes interactive tree exploration/pruning pretty easy.
Comments.UserDisplayName: Maximilian Press
Tags: <phylogenetics><phylogeny><multiple-sequence-alignment>
Title: How to create a phylogenetic tree from diverse mitochondrial genomes
ThreadText: # How to create a phylogenetic tree from diverse mitochondrial genomes
  
  (Asked by: username_0 on 2023-10-23)
  
  I would like to create a phylogenetic tree for the most species in my dataset.
  
  I'm starting with around 1200 species, but since it's not good practice to align short and long sequences I tried filtering only for the species with the [15k-18k bp] range in length, but this leaves me with around 350 species in total.
  
  Those sequences vary a lot in size, here's an histogram of the number of species I have data for
  [![enter image description here](https://i.sstatic.net/aYzXX.png)](https://i.sstatic.net/aYzXX.png)
  As you can see I have a lot of sequences with length [12k-15k bp] and [15k-18k bp] (values on the x axis are scaled by a factor of 3000 and then rounded).
  I would like maximise the species genetic information.  
  To do so I would like to extract the part of genome that is shared the most among all the species.
  
  Is this achievable by using a regex?  
  I am not sure on the length and type of the query to be sure of not extracting non-homologous regions as it would create a big problem later on for the phylogenetic tree creation.
  
  I can't make an alignment for all species because of the lack of computational power. That is why I'm trying to subset a piece of DNA that is the most shared (prior to the alignment, but I don't know if that is doable or logic)
  
  My question is: how would you proceed to get the most phylogenetic data out of this dataset?
  
  If you would use a regex, what type of query would you use?
  
  # More Info
  
  ### Alignment
  
  When I try to align 10 sequences drawn from the [15k-18k bp] range I get this result (the numbers on the right are the TaxID of the species).  
  [![enter image description here](https://i.sstatic.net/W53d5.png)](https://i.sstatic.net/W53d5.png)
  We can't see much here so I used an online MSA viewer
  [https://alignmentviewer.org/]
  [![enter image description here](https://i.sstatic.net/1UKNq.png)](https://i.sstatic.net/1UKNq.png)
  
  ### Data
  
  My data is one Fasta file containing mitochondrial genomes for all the species.
  
  To do this preliminary analysis I only used 10 randomly chosen species with a sequence of length in the range [15k-18k bp].
  
  **Tags:** phylogenetics, phylogeny, multiple-sequence-alignment
  
  > **Comments:**
  > **username_1**: Have you considered using only genes for the alignment instead of the entire sequence?  
  > **username_2**: Is there a way for you to find an existing vertebrate phylogeny (this seems to be your group of interest) based on a larger set of sequences and to prune it to the set you care about? e.g. idk [here](http://timetree.org/book), see .newick and .tre dowloads. [iTOL](https://itol.embl.de/) makes interactive tree exploration/pruning pretty easy.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2023-10-24. Score: 2 | Accepted answer
  
  Your overall approach is cool, given caveats (below) to adapt the method. I can fairly authoritatively say your specific methodological approach will not work regarding its phylogenetic strategy without changing it. This is due to a phenomenon where the number of mutations becomes so great it is impossible to recover the ancestral state, basically it randomises the phylogenetic signal, this especially occurs at the 3rd codon nucleotide positions, i.e. 1 in every 3 nucleotides, 33.3% of the entire data set. This violates a central tenant of phylogenetic theory, therefore I am afraid that you cannot build a tree using this approach, but again you can adapt it to work (below).
  
  If you want only to use nucleotides then 16S is the only target available. However, 16S has been a good target for amphibians, therefore just aligning that gene and building a tree is cool. Its perfectly solid given prior work in vertebrates ...
  
  > [Chan, K.O., Hertwig, S.T., Neokleous, D.N. et al. Widely used, short 16S rRNA mitochondrial gene fragments yield poor and erratic results in phylogenetic estimation and species delimitation of amphibians. BMC Ecol Evo 22, 37 (2022).](https://doi.org/10.1186/s12862-022-01994-y)
  
  If you wish to use protein coding genes you need to switch amino acids and align those. In terms of conservation there alot of established tools rather than "reinvent the wheel". One program you could consider is **AAcon**, [available here](http://www.compbio.dundee.ac.uk/aacon/). This would give you can empirical basis for deducing which gene is
  
  * the most conserved
  * the most represented, i.e. "read-depth", or species representation.
  
  ... after its aligned, thereby yielding a genetic marker for phylogenetics. It uses a large number of metrics therefore most scenarios would be accommodated.
  
  COX1 is good target and likely gene to emerge from AAcon analysis.
  
  Building protein phylogenetic trees is a separate question.
  
  ---
  
  **Lacking computational power to align**. That is solvable, even on small computers, and you can place that as a separate question stating your computer capacity (RAM and CPUs). It's not difficult to align 1000s even on a small machine, it's simply the strategy to do this. Algorithm performance and accuracy change rapidly.
  
  
  ---
  
  ### Answer by username_4 on 2023-10-24. Score: 2
  
  It looks like these are random mitochondrial sequences pulled from NCBI, which is probably why the alignments aren't working well.
  
  As a starting point, I recommend you make sure that all the mitochondrial DNA sequences are rotated and reverse-complemented as necessary to make sure that the same gene matches position 1 of the sequence. I prefer doing this for COX1, because it's a well-conserved gene. After doing that, it'll be much easier to look at the alignment of that gene alone, which will give you an idea of the complexity of extending the task to the full length of the mitochondrial genome.
  
  I don't expect you'll find a long exact-match sequence that is consistently conserved across all species, even within COX1. It wouldn't surprise me if the longest conserved sequence were less than 16bp, with a few repeats of that sequence throughout the genome. If that is the case, you need to think about what to do with that information. Given the complexity of this intermediate problem you've asked about, it would be a good idea to think first about what you would do after you discovered there were no such sequence.
  
  
  ---
  
  