How to remove the header in fasta file and keep only the desirable part on ububtu?

How to remove the header in fasta file and keep only the desirable part on ububtu?

1

Hi all,

I have a fasta file with this header

>10005_M12.fastq    Otu0001|242290|M1.fastq-M12.fastq-M5.fastq-URTM6.fastq-M7.fastq-M9.fastq

I want to remove all the header parts except the OTU (with its number),
I used the this command “sed ‘s/>M.Otu/>Otu/g’ rep.fasta |sed -e ‘s/|.//g’> rep.otu.fasta”
but the command removed only the part after OTU as following;

>10005_M12.fastq    Otu0001

I want the header looks like (>Otu0001)

any advices will be appreciated
Thank you


microbiome


bioinformatics


NGS

• 14 views

Read more here: Source link