FASTA File Concatenation
1
0
Entering edit mode
13 months ago
Yarabi • 0

Hello, I am a beginner in bioinformatics and I am currently doing gene mapping of viral RNA sequences. And I have the following question:

How can I concatenate several FASTA files without losing the ID of each one?

These files are located in different folders.

I hope you can help me, thank you very much.

bash FASTA • 991 views
ADD COMMENT
0
Entering edit mode

what do you mean with concatenate ? concatenate the files or the entries ?

ADD REPLY
0
Entering edit mode

I want to concatenate the input FASTA files.

ADD REPLY
0
Entering edit mode

How can I concatenate several FASTA files without losing the ID of each one?

If you are referring to not losing the fasta header inside each file then that would not happen when you cat the files together. But you will end up with a single fasta file after this operation.

ADD REPLY
2
Entering edit mode
13 months ago
find  dir1 dir2 dir3 -type f \( -name "*.fa" -o -name "*.fasta" \) -exec cat '{}' ';'
ADD COMMENT
1
Entering edit mode

It might be a little safer to do.

find  dir1 dir2 dir3 -type f \( -name "*.fa" -o -name "*.fasta" \) -not -name 'concat.fasta' -exec cat '{}' > 'concat.fasta' '+'
ADD REPLY
0
Entering edit mode

Thank you very much it helped me a lot.

ADD REPLY

Login before adding your answer.

Traffic: 1832 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6