greatings, I was wondering if anyone could provide any clues/assitance in automating a series of commands. Currently, I am formatting Illumina data for a UPARSE/USEARCH pipeline. Post quality filtered, trimmed samples need to have the fasta header changed to from
">Sample1_sequence1"
to
">barcodelabel=Sample1;Sample1_sequence1"
This is easy to do with sed;
sed 's/>Sample1/barcodelabel=Sample1/g' sample.fna > sample.rename.fna
However, the file I have has 48 different samples, and I was wondering if there is way to automate or loop sed, so that it might be able to read the Sample names from a text file, and then replace them in the new file.
Any suggestions are welcome. Thanks,
-tony
">Sample1_sequence1"
to
">barcodelabel=Sample1;Sample1_sequence1"
This is easy to do with sed;
sed 's/>Sample1/barcodelabel=Sample1/g' sample.fna > sample.rename.fna
However, the file I have has 48 different samples, and I was wondering if there is way to automate or loop sed, so that it might be able to read the Sample names from a text file, and then replace them in the new file.
Any suggestions are welcome. Thanks,
-tony
Comment