It works perfectly. Thanks!
• 0 views
•
link
I trimmed poor aligned regions from a MSA file, using trimAl. Now, I would like to remove all gap-containing sequences, and keep only those sequences with no gaps. It would be something like this:
input:
>seq_1
LSAIFQQPLAALLSN--------QQ-----------------------------------
>seq_2
-----------------------------GPLLTGALVTEDVAASALRIMIVALKVIIDA
ASVSELCATLLVELSVAGIVNVMNCAL
>seq_3
IKVLSEQALGQHLTQIQNCLWTLNLSAATGQILVTQLGDDNMATGILSNLVTQVEALIHV
LDVEPAVCALLTPVGLALLREALINAL
Output:
>seq_3
IKVLSEQALGQHLTQIQNCLWTLNLSAATGQILVTQLGDDNMATGILSNLVTQVEALIHV
LDVEPAVCALLTPVGLALLREALINAL
Does anyone know how to do it? I will appreciate any help. Thanks!
Linearize the fasta file | remove lines containing gaps `grep -v "-"` | reformat back to fasta.
Code for fasta manipulation (courtesy of @yokofakun):
Log in to answer this question.
Are the sequence name and sequence all contained within one line in the file? Or are there line breaks like in your post?
EDIT: It appears to be a fasta file after the post was edited, and if so the answer was kindly provided by @genomax.