I have around 10,000 FASTA files of Influenza A virus.
These files contains sequences of each of the 8 segments of the viral genome and I want to separate each genome segment into a different folder and subdivide each directory into different files based on their geographic region of isolation.
In each FASTA file for each segment,the first line has the segment number, for example.
KM368312.1 Influenza A virus (A/swine/Shandong/01/2009(H1N1)) segment 3 polymerase PA (PA) and PA-X protein (PA-X) genes, complete cds
To be clear I want
- file1.txt has segment 1
- file2.txt has segment 2 etc ...
I want to ensure all segment 1 sequences are grouped into one folder, and each file is grouped according to its geographic origin. The geographic groupings are mirrored for all 8 segements and each placed into their own directory.