Problem renaming headers in multi fasta file using certain scripts
0
0
Entering edit mode
4.1 years ago

Hello! I have a FASTA file and I want to change their headers into a new name. Through searching here on this platform I have found some relevant questions and answers to my problem. Hence I decided to perform this purpose using some certain scripts which are recommended. E.g

awk '/^>/{print ">ASV" ++i; next}{print}' < file.fasta

and sed 's/>.*//g' filename.fasta

The problem with them is that changes are made, but not saved. Also a huge portion of sequences is removed...and I do the first sequences their headers are not named..any idea what could be the problem. I am using Linus konsol. My input sequences

> LTR-12
ATTGGAAAACAAACTATCCTACCTTCATCATACACTAGTGGTGCATATCACATGTATCAG
TAATATTTAGATGCAATAGCTATTGCCTAGTACTTTCATAAAGTAAACATCTTTATGACC

>Hmmer-14
ATGAAGGTAATAGAGCCTCAGGGTATACAATATTCAATGTATTTGTACCTTTTTCTGTAT
CTGGAAAGAGAACTCGAATCTGTTGTCCAGAAGTGCAATGGCTAAGTGCTATATAGAGTT

Expected output

> RLX-incomp-chim
ATTGGAAAACAAACTATCCTACCTTCATCATACACTAGTGGTGCATATCACATGTATCAG
TAATATTTAGATGCAATAGCTATTGCCTAGTACTTTCATAAAGTAAACATCTTTATGACC

>RLX-comp
ATGAAGGTAATAGAGCCTCAGGGTATACAATATTCAATGTATTTGTACCTTTTTCTGTAT
CTGGAAAGAGAACTCGAATCTGTTGTCCAGAAGTGCAATGGCTAAGTGCTATATAGAGTT

I have been followed all these question to try to solve my problem, but nothing works.

Question: Renaming Entries In A Fasta File

Question: How To Rename FASTA Headers

Question: Editing header of a fasta file

how to rename fasta file headers using sed

Modifying FASTA headers with Unix command line tools

Any script to parse fasta headers?

sequence • 758 views
ADD COMMENT
0
Entering edit mode

Renaming commands have no built in logic. How will the command know that LTR-12 needs to be changed to RLX-incomp-chim? Similarly what is the correlation between Hmmer-14 and RLX-comp? Is it based on order of the sequences in the file or some other condition?

ADD REPLY
0
Entering edit mode

So you have you new headers in a file or you just want your headers to be like ASV1, ASV2... ?

ADD REPLY

Login before adding your answer.

Traffic: 2664 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6