This is a test version of Biostars. For the public version, visit https://www.biostars.org.
combine fasta sequence

Hi I have sequences like this

> abc.ff
ccgtac

> qwe.oo
aattcg

> dee.ff
aatt

> rte.oo
ttcc

and I want to be like this

> ff 
ccgtacaatt

> oo
aattcgttcc

can you tell me how to do it thsanks

genome sequence alignment r

In R: mutate a ID column from name column, group_by ID column and paste sequence column.

In shell: Step 1) split sequences by FASTA header using seqkit

seqkit split --id-regexp "\.(.+?)$" -i seqs.fa

Step 2) combining sequences in a file to one sequence. for one splited file:

$ echo ">ff" > combined.fa
$ cat seqs.id_ff.fa | seqkit fx2tab | cut -f 2 |   paste -s -d "" >> combined.fa

Hello a.moner!

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!

PS: Not really appropriate to delete old question without following up and just repeating the question in a new thread.

0 answers

No answers yet.

Log in to answer this question.