gravatar for aebartl2

16 hours ago by

I have a large number of directories with unique names. Inside each directory is a contigs.fasta file. I need to rename the contigs.fasta file to include the unique directory name so that if I combine all of the contigs.fasta files I will be able to determine where each originated.
For example some of the directories are listed below:

Cage1.out_bin.100_Reassembly.Spades  Cage1.out_bin.125_Reassembly.Spades  Cage1.out_bin.27_Reassembly.Spades  Cage1.out_bin.51_Reassembly.Spades  Cage1.out_bin.76_Reassembly.Spades
Cage1.out_bin.101_Reassembly.Spades  Cage1.out_bin.126_Reassembly.Spades  Cage1.out_bin.28_Reassembly.Spades  Cage1.out_bin.52_Reassembly.Spades  Cage1.out_bin.77_Reassembly.Spades
Cage1.out_bin.102_Reassembly.Spades  Cage1.out_bin.127_Reassembly.Spades  Cage1.out_bin.29_Reassembly.Spades  Cage1.out_bin.53_Reassembly.Spades  Cage1.out_bin.78_Reassembly.Spades

The contents of one directory is listed below:
assembly_graph.fastg before_rr.fasta contigs.paths K33 K77 misc scaffolds.fasta spades.log
assembly_graph_with_scaffolds.gfa contigs.fasta corrected input_dataset.yaml K55 K99 params.txt scaffolds.paths tmp

How do I rename the contigs.fasta file for all the directories?

Source link