This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Remove-Filter specific sequences from fasta files.

Hello, I have a fasta file with some invalid charachters in some sequences. Those invalid characters are either * or X. I would like to create a new fasta file withour those sequences on it. How can i do this in easy way ? In terminal ?

My fasta

>li|LinJ.02.0010:mRNA-p1
MIMKASGAAVLHAVREKMQEATVAALIVPSSDAHNSEYVATHLQARAFISHFHGSAGTAL ITMEKALLWTDGRYWLAAEEEKYPEFDLMKQGKPEVPSLEEWIAVNLGSKAVVGMNPYVA TVAEWERLSKRINLRPVANIVQDMMPPEKNVQRMYVRPVEFCGATCQERRAAILAELEKE

>li|LinJ.01.0850:mRNA-p1
MQNPEQAHAPKFSAHTDKIYPDGAFYNRIKAVHDERSSLAGEDLRLV`*`KYAEGFRRAGAG LGNAAKEKPRQANERPANPKSGFAEGGRTHGGPRCLLWVAPPGLGGLGVVGATRPKKGAR NVCYTEGKRLLTQTGRRSSRASLRGRGGHHNPF`*`ARAQRAGRGDAKDTSATTVEIAQLRL

>li|LinJ.01.0850:mRNA-p1
MQNPEQAHAPKFSAHTDKIYPDGAFYNRIKAVHDERSSLAGEDLRLV**XX**KYAEGFRRAGAG LGNAAKEKPRQANERPANPKSGFAEGGRTHGGPRCLLWVAPPGLGGLGVVGATRPKKGAR NVCYTEGKRLLTQTGRRSSRASLRGRGGHHNPF**X**ARAQRAGRGDAKDTSATTVEIAQLRL

The new fasta should have only

>li|LinJ.02.0010:mRNA-p1
MIMKASGAAVLHAVREKMQEATVAALIVPSSDAHNSEYVATHLQARAFISHFHGSAGTAL ITMEKALLWTDGRYWLAAEEEKYPEFDLMKQGKPEVPSLEEWIAVNLGSKAVVGMNPYVA TVAEWERLSKRINLRPVANIVQDMMPPEKNVQRMYVRPVEFCGATCQERRAAILAELEKE

thank you in advance

Best Dimitris

fasta terminal filtering sequences

Hello dzisis1986!

Questions similar to yours can already be found at:

We have closed your question to allow us to keep similar content in the same thread.

If you disagree with this please tell us why in a reply below. We'll be happy to talk about it.

Cheers!

i have seen your similar reply but at this case you are replacing the unwanted charachers with N . I would like a new fasta without those sequences with unwanted characters on it . Is it the same if i keep the masked with N sequnces on the existing fasta ? Cheers Dimitris

0 answers

No answers yet.

Log in to answer this question.