Replace fasta Header witha a matching text
1
0
Entering edit mode
3.7 years ago
Optimist ▴ 190

My fasta header looks like this

>name1
ATGCATGCAT

My output must look like this

>alfaAB

--kv file looks like this

name1        alfaAB

What command can be used to achieve this??

Thank You

awk seqkit grep • 3.7k views
ADD COMMENT
0
Entering edit mode

Please use the formatting bar (especially the code option) to present your post better. I've done it for you this time.
code_formatting

What is --kv? Is that a seqkit option? If you are using seqkit then please post the command you are using by editing the original post.

ADD REPLY
0
Entering edit mode

I want to know what command can be used to achieve the purpose.

It can be seqkit or anything else

ADD REPLY
0
Entering edit mode
ADD REPLY
4
Entering edit mode
3.7 years ago
GenoMax 147k
$ more test.fa
>name1
ATGCATGCAT
>name2
AGCTAGC

$ more names
name1   alfaAB
name2   alfaCD

$ seqkit replace -p "(.+)" -r '{kv}' -k names test.fa
[INFO] read key-value file: names
[INFO] 2 pairs of key-value loaded
>alfaAB
ATGCATGCAT
>alfaCD
AGCTAGC
ADD COMMENT
0
Entering edit mode

This worked

Thanks a ton

ADD REPLY

Login before adding your answer.

Traffic: 1796 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