I've got 1000 gene sequences, each in a separate fasta file, for 4 different species. So, each species has its own sequence for 1000 different genes. Each species is it's own directory, and all the sequence files are in the same order for each species, so:
Directory1(species1): geneA.fa, geneB.fa, geneC.fa, ...
Directory2(species2): geneA.fa, geneB.fa, geneC.fa, ...
etc...
I want to concatenate all the sequences for geneA into a single file to end up for 1000 fasta files with 4 sequences (1 from each species) in every file.
Is there an easy way to automate this? I could just use cat and go one gene at a time, but I'd like to do it more quickly.
Directory1(species1): geneA.fa, geneB.fa, geneC.fa, ...
Directory2(species2): geneA.fa, geneB.fa, geneC.fa, ...
etc...
I want to concatenate all the sequences for geneA into a single file to end up for 1000 fasta files with 4 sequences (1 from each species) in every file.
Is there an easy way to automate this? I could just use cat and go one gene at a time, but I'd like to do it more quickly.
Comment