in reply to Re^3: Command or Perl script for changing headers of multiple FASTA files in a specific order listed in a txt file
in thread Command or Perl script for changing headers of multiple FASTA files in a specific order listed in a txt file
The mapping of names in Headers.txt and the FASTA files can work.
Following solution worked for my problem.Chimpanzee_AMY2B_CDS.fasta MP.C_AMY2B Human_AMY2B_CDS.fasta FP.H_AMY2B
create a folder called test (in the same folder where fasta files are located) and run the command:
$ mkdir testexecute:
for i in $(seq 1 $(ls *.fasta |wc -l)); do sed -n "$i"p headers.txt| sed 's/^/>/'> test/$(ls *.fasta| sed -n "$i"p); cat $(ls *.fasta| sed -n "$i"p)| sed '1d' >>test/$(ls *.fasta| sed -n "$i"p); doneCheers.. :)
|
|---|