This is a test version of Biostars. For the public version, visit https://www.biostars.org.
bcftools update ID keeping only string after ';'

I have values in ID column of VCF that are like this:

"stringidontwant;stringiwant"

is there some high level way to keep stringiwant but get rid of stringidontwant,

like bcftools annotate --set-id + some command to alter %ID

bcftools

1 answer

 sed 's/^\([^\t]*\t[^\t]*\)\tstringidontwant\t/\1\tstringiwant\t/' in.vcf

Log in to answer this question.