How do concatenate different fasta file
3
0
Entering edit mode
5.4 years ago
lkianmehr ▴ 100

Does anybody know what is the best and trustable way to concatenate different FASTA files for making them index together?

thanks in advance

concatenate fasta • 2.2k views
ADD COMMENT
0
Entering edit mode

How do i delete all the fasta files with my info

ADD REPLY
0
Entering edit mode

Please ask a new question and give us as much information as you can. Do not add an answer unless you're answering the top-level post. I'm moving your "answer" to a comment and deleting the other duplicate "answer".

ADD REPLY
0
Entering edit mode

give us as much information as you can

In this it would be "please give any information"...

nadiawerksfoon imagine you were in the situation of a user reading this and willing to help, could you reproduce at all what the problem is? At least I cannot. Probably others cannot as well. Add details!

ADD REPLY
4
Entering edit mode
5.4 years ago
GenoMax 141k

Just cat them together. I am not sure what you mean by trustable?

If you have spaces in the headers (e.g. words separated by names) make sure to change the space to _. Most aligners will drop things past first space when reporting alignments (e.g. bbmap is an exception and will keep the entire name by default unless you use trd=t). You may get confusing results if the part of name up to first space is common to more than one record.

ADD COMMENT
2
Entering edit mode
5.4 years ago

As Genomax commented :

In a unix shell :

cat file1.fasa file2.fastq file3.fasta > merged_file.fasta

or even easier if all your fasta files are in a directory and ends by .fasta

cat *.fasta > merged_file.fasta
ADD COMMENT
1
Entering edit mode

I tend to remember that there were cases (also reported here on Biostars) when cat *.fasta somehow caused an infinity loop because the output file would be constantly appended to itself (as it also ends on .fasta). To avoid this, consider to use:

find . -maxdepth 1 -name \*.fasta | xargs cat > output.fasta
ADD REPLY
0
Entering edit mode

that's a good point !

ADD REPLY

Login before adding your answer.

Traffic: 2545 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