Merging FA or Fasta files

I have 21,000 FASTA files with short sequences of DNA, I need help with merging all of the together for example file 1 is :

flavicollis_CLocus_6_consensus
TAAAACACAAATCACATACACAACAAGCCAAGCAAAGGGAAGAGGAGGGAAAGGGCTGGA
GATCAGAGTCATTGAGAGTTCAGGCTAAGAATAGAGAGGAACTCGGAGAGCTGCTTGGCT
GTGTGACCTCCTGCAATGCGA

and 2 is :

flavicollis_CLocus_205_consensus
TAATCCATGCAAGTTTCCAGGGATTTTTGCAACACTAGCCGCTTTGGTGGAGTCCGTGTA
AGCCTGTTGGGGTCCTCTGTAGCGTCACTGCCCTTTCCTCTGTCTCTGCCCCAGCTTACC
ATTCCTTCCCCCTGCAATGCG

So my objective is to end up with file 1+2 :

TAAAACACAAATCACATACACAACAAGCCAAGCAAAGGGAAGAGGAGGGAAAGGGCTGGA
GATCAGAGTCATTGAGAGTTCAGGCTAAGAATAGAGAGGAACTCGGAGAGCTGCTTGGCT
GTGTGACCTCCTGCAATGCGATAATCCATGCAAGTTTCCAGGGATTTTTGCAACACTAGCCGCTTTGGTGGAGTCCGTGTAAGCCTGTTGGGGTCCTCTGTAGCGTCACTGCCCTTTCCTCTGTCTCTGCCCCAGCTTACCATTCCTTCCCCCTGCAATGCG

And that needs t be done 21,000 times

Many thanks

Hi @Robski,

In theory this shouldn't be too tricky to achieve. Are all of the Fasta files named in some sequantial manner? Such as file1.fasta, file2.fasta etc.

Hi @mattwarkentin
The files are numbered in an increasing order but have gaps. For example 6, 205, 513, 516, 529, 590 etc.

I also want to add that i got the "biostrings" package too if that helps.

Many thanks