<p>Basically this is 16S data. If its proteins there's a different strategy - even if the data set needed is nucleotides (separate question). I would simply use trimal which is available on <strong>conda</strong></p>
<pre><code>trimal -in &lt;inputfile&gt; -out &lt;outputfile&gt; -nogaps
</code></pre>
<p>The input file is aligned fasta here and will output as aligned fasta.</p>
<p>Any site (alignment position) with an indel <code>-</code> will be removed. This is definitely preferred if performing an <strong>iqtree</strong> analysis, because of the way it handles indels. This will also clean up poorly aligned, alignments.</p>
<p>e.g.</p>
<pre><code>---ATG
---A-G
--TATG
</code></pre>
<p>This will result in...</p>
<pre><code>AG
AG
AG
</code></pre>
<p>Ultimately for alignments - there's no magic bullet - and manual editing and inspection is expected e.g. using <strong>seqotron</strong>. There are very good reasons for this concerning circular mathematics. However, modern aligners such as <strong>muscle5</strong> are extremely good.</p>
<p>Trimal is available via conda</p>
<pre><code>conda install -c bioconda trimal 
</code></pre>
<p>In terms of using GBlock I'd need to know whether it was simply deleting indel sites, deleting indel sites at &gt;50% frequency or whether it was performing a genetic diversity calculation per site. I don't think it is doing the latter. It is better to perform diversity saturation calculation explicitly rather than using an unknown automate because thats kinda important. If its deleting sites with excessive &gt;50% indels - honestly its better to do a blockwise deletion rather than do something half-half. Within SSU there is a reason might be being done because there can be excessive indels at deep taxonomic levels with this data type. Again using iqtree just do it 'blockwise' which is the trimal output.</p>
<p><em>Note</em> I've not read the original GBlock paper, but if you summarise its application I could consider it against <strong>trimal</strong>. However, I definitely prefer <strong>trimal</strong> considering the downstream application.</p>

CC BY-SA 4.0
2023-05-23T07:20:35.257Z
Thank you again, @M__ . Will definitely go ahead with what you have suggested. Although, I must admit, being an absolute amateur in bioinformatics I don't follow some of the things you have so sincerely explained. Forgive me if I am being imprudent, do you have any way that I could learn all this under your guidance? I wish to be thorough.. thanks again!
K_081
CC BY-SA 4.0
2023-05-23T12:40:50.533Z
If you need the theory you can always ask a separate question. The theory is very detailed, why certain things and done and otherwise not.
M__
CC BY-SA 4.0
2023-05-22T14:15:13.943Z
2023-05-22T14:27:13.477Z
2023-05-22T14:27:13.477Z
M__
<p>I have run OrthoFinder on a set of 11 genomes and got the results in a folder. From the output folder, I saved all the single-copy gene sequences in a single FASTA file and now wish to remove all gaps using <strong>Gblocks</strong> before using them for constructing a phylogenomic tree. But I don't know the command line used for running <strong>Gblocks</strong>. Any help will be appreciated!</p>

CC BY-SA 4.0
2023-05-20T20:01:04.633Z
I assume you've aligned these sequences? I don't know **GBlocks** but I know **trimal** and will do the same thing (or do it better). Could you describe what you mean by 'removing gaps'? **1.** Are you looking to trim the 5' and 3' ends? **2.** Wanting to remove 'gap [indel] only columns'? **3.** May be wanting to remove the any position which contains an indel, i.e. the entire site is removed? The last option is the best approach.
M__
CC BY-SA 4.0
2023-05-21T20:36:53.560Z
Did you look for the gblocks docs? You know it's >20 years old that tool!
Chris_Rands
CC BY-SA 4.0
2023-05-22T05:44:46.213Z
Hey @M__ ! I am still learning the procedures for doing phylogenetic analysis but I think I need to remove ambiguous sequences that hamper the accuracy of a phylogeny. You can check this paper which has cited Gblocks.                                        [link] (https://doi.org/10.1016/j.syapm.2020.126166)          If you feel trimal is better could you please explain how to use it? Thanks!
K_081
CC BY-SA 4.0
2023-05-22T05:50:49.093Z
@Chris_Rands, I did come across the Gblocks documentation but it did not work for me. I think it has not been updated in a while. Since my supervisor shared the paper which used Gblocks, I wanted to learn it. I agree that the latest tool would be better.
K_081
<phylogenetics><phylogeny><linux><orthologues><orthofinder>
How to use Gblocks for trimming single-copy gene sequences?
# How to use Gblocks for trimming single-copy gene sequences?

(Asked by: username_0 on 2023-05-20)

I have run OrthoFinder on a set of 11 genomes and got the results in a folder. From the output folder, I saved all the single-copy gene sequences in a single FASTA file and now wish to remove all gaps using **Gblocks** before using them for constructing a phylogenomic tree. But I don't know the command line used for running **Gblocks**. Any help will be appreciated!

**Tags:** phylogenetics, phylogeny, linux, orthologues, orthofinder
> **Comments:**
> **username_1**: I assume you've aligned these sequences? I don't know **GBlocks** but I know **trimal** and will do the same thing (or do it better). Could you describe what you mean by 'removing gaps'? **1.** Are you looking to trim the 5' and 3' ends? **2.** Wanting to remove 'gap [indel] only columns'? **3.** May be wanting to remove the any position which contains an indel, i.e. the entire site is removed? The last option is the best approach.  
> **username_2**: Did you look for the gblocks docs? You know it's >20 years old that tool!  
> **username_0**: Hey @M__ ! I am still learning the procedures for doing phylogenetic analysis but I think I need to remove ambiguous sequences that hamper the accuracy of a phylogeny. You can check this paper which has cited Gblocks.                                        [link] (https://doi.org/10.1016/j.syapm.2020.126166)          If you feel trimal is better could you please explain how to use it? Thanks!  
> **username_0**: @Chris_Rands, I did come across the Gblocks documentation but it did not work for me. I think it has not been updated in a while. Since my supervisor shared the paper which used Gblocks, I wanted to learn it. I agree that the latest tool would be better.  

---

## 1 answers

### Answer by username_1 on 2023-05-22. Score: 1 | Accepted answer

Basically this is 16S data. If its proteins there's a different strategy - even if the data set needed is nucleotides (separate question). I would simply use trimal which is available on conda
trimal -in  -out  -nogaps

The input file is aligned fasta here and will output as aligned fasta.
Any site (alignment position) with an indel - will be removed. This is definitely preferred if performing an iqtree analysis, because of the way it handles indels. This will also clean up poorly aligned, alignments.
e.g.
---ATG
---A-G
--TATG

This will result in...
AG
AG
AG

Ultimately for alignments - there's no magic bullet - and manual editing and inspection is expected e.g. using seqotron. There are very good reasons for this concerning circular mathematics. However, modern aligners such as muscle5 are extremely good.
Trimal is available via conda
conda install -c bioconda trimal 

In terms of using GBlock I'd need to know whether it was simply deleting indel sites, deleting indel sites at >50% frequency or whether it was performing a genetic diversity calculation per site. I don't think it is doing the latter. It is better to perform diversity saturation calculation explicitly rather than using an unknown automate because thats kinda important. If its deleting sites with excessive >50% indels - honestly its better to do a blockwise deletion rather than do something half-half. Within SSU there is a reason might be being done because there can be excessive indels at deep taxonomic levels with this data type. Again using iqtree just do it 'blockwise' which is the trimal output.
Note I've not read the original GBlock paper, but if you summarise its application I could consider it against trimal. However, I definitely prefer trimal considering the downstream application.

> **Comments:**
> **username_0**: Thank you again, @M__ . Will definitely go ahead with what you have suggested. Although, I must admit, being an absolute amateur in bioinformatics I don't follow some of the things you have so sincerely explained. Forgive me if I am being imprudent, do you have any way that I could learn all this under your guidance? I wish to be thorough.. thanks again!  
> **username_1**: If you need the theory you can always ask a separate question. The theory is very detailed, why certain things and done and otherwise not.  

---

