This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merging all sequences with identical ID's

Hi!

I am having issues with multiple genes (fasta files) which i am supposed to concatenate. My issue lies in that all these genes have identical taxon-identifiers, meaning that after concatenating my aligned + trimmed files, i end up with multiple duplicate headers in the combined file. What i am wondering is if there is any method, preferably in python, to merge all sequences with a identical header into one sequence (ie. remove the duplicate header entries, and then merge all sequences matching that header into one sequence?

sequence

please provide example.

Ha, just realized, I recommended your tool :)

1 answer

seqkit concat might do what you want: "concatenate sequences with same ID from multiple files"

https://github.com/shenwei356/seqkit

Log in to answer this question.