Entering edit mode
2.6 years ago
p
•
0
Hi, pls, let me know how can i edit the fasta file header.
>LR99555.1 Avo, chromosome: 1
I want this header like this.
>LR99555.1
Hi, pls, let me know how can i edit the fasta file header.
>LR99555.1 Avo, chromosome: 1
I want this header like this.
>LR99555.1
according to the manual (man cut
):
-f list
The list specifies fields, separated in the input by the field
delimiter character (see the -d option). Output fields are
separated by a single occurrence of the field delimiter character.
Meaning that it keeps everything before the first space delimiter and removes the rest.
$ awk '/^>/ {print $1} !/>/' test.fa
$ sed '/^>/ s/\s.*//g' input.fa
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
A low-tech way of doing this is to open the file in any text editor and simply delete the part you don't need. This is not advised if you have a large number of sequences.