Question: (Closed) how to sort protein and nucleotide sequences based on IDs
0
gravatar for Kay
9 months ago by
Kay0
Liverpool, UK
Kay0 wrote:

I have a protein alignment file in fasta format and nucleotide sequences of the original proteins. How can I sort my nucleotide sequences such that their IDs match that of the alignment file, Assuming my protein sequences looks like:

>Seq1
MYHLGQGDPEPDIN
>Seq2
MYGGQGDPEPYIN
>Seq3
MYHLHQGDPEPD
>Seq4
TYHLGQGDPEPDIN

Here are the corresponding nucleotides:

>Seq1
ACTTTTGATACAATTAACAGGACGAAAATAATAGAAAAGCTAAAGCATCTTAGAATCCCA
>Seq2
AATCCCAGACAAATTAAGACATATTCTAACAGTGAGTCTACAGAACACAGAACACTATAG
>Seq3
AGTTTTGCAATGGTAAATTATTTTGAAGAGTTTATAGGTCGTGTCTGGAACTGCAATTAT
>Seq4
TGGAATATTAGACGAATTCCATACACAGCACCTATTGTAATATTCATAGATTTCAAAAGC

Assuming my protein alignment looks like this:

>Seq4
MYHLG-QGDPEPDIN
>Seq2
MYGGQG-DPEPY-IN
>Seq1
MYHLHQ--GDPEP-D
>Seq3
--TYHLGQGDPEPDIN

How do I get my nucleotide sequences to now look like:

>Seq4
TGGAATATTAGACGAATTCCATACACAGCACCTATTGTAATATTCATAGATTTCAAAAGC
>Seq2
AATCCCAGACAAATTAAGACATATTCTAACAGTGAGTCTACAGAACACAGAACACTATAG
>Seq1
ACTTTTGATACAATTAACAGGACGAAAATAATAGAAAAGCTAAAGCATCTTAGAATCCCA
>Seq3
AGTTTTGCAATGGTAAATTATTTTGAAGAGTTTATAGGTCGTGTCTGGAACTGCAATTAT

Especially when I have many sequences thanks

fasta • 261 views
ADD COMMENTlink written 9 months ago by Kay0
2

Hello Kay!

I think you have already received an answer in the other thread you had started earlier today: how to change the sequence ID and order of sequences in a file to match an alignment output file We can reopen this question if you can demonstrate that it is substantially different.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

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

Cheers!

ADD REPLYlink modified 9 months ago • written 9 months ago by genomax73k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1580 users visited in the last hour