hi, thanks for the reply, what is -f here?
• 0 views
•
link
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
cut -d ' ' -f 1 < in.fa
hi, thanks for the reply, what is -f here?
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
Log in to answer this question.
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.