Get.oturep (changing fasta file header)

Dear colleagues, how are you doing?

I would like to generate a tree of OTUs, in order to do some phylogenetic based analysis on R. To do this, I used the Get.oturep command. This command generated a fasta file with the representative sequence of each OTU.

I would like to change the headers of the fasta file, erasing the name generated by MiSeq leaving only the OTU number.

The fasta header looks like this:

M02913_120_000000000-AMC56_1_1101_21790_20427 Otu223080|1|C9C2

And I would like it to be like this:


Any Sugestion?

Thank you in advance.

You should be able to do something like this from the command line in Mac/Linux…

sed “s/>.* />/” original.fasta > new_names.fasta

original.fasta should be the name of your fasta file and new_names.fasta will be the new file without the Illumina sequence names.


Thank you very much for your help, Mr. Pat. It worked.