brentp / slivar

genetic variant expressions, annotation, and filtering for great good.
MIT License
248 stars 23 forks source link

how can I extract \xb3 in slivar? #128

Closed luceamso closed 2 years ago

luceamso commented 2 years ago

Hi, I'm very appreciated with your help and thanks for wonderful tool. I tried several times to extract variants with annotation containing "\x3b" but have failed. I confirmed "ncRNA_exonic\x3bsplicing" annotation in subset vcf file and used --info "INFO['Func.refGeneWithVer'] == 'ncRNA_exonic\\x3bsplicing'" but it's not worked.
I would like to ask for help on this. Sorry for asking a very basic question.

brentp commented 2 years ago

Hi, this is hard because your shell will interpret the \\ in some cases. I would try:

--info 'INFO["Func.refGeneWithVer"] == "ncRNA_exonic\x3bsplicing"'

with outer ' and inner " and various escape patterns of that.

You could also try:

'INFO["Func.refGeneWithVer"].match("^ncRNA_exonic")

and mofify the regex to get the exact match that you want.

luceamso commented 2 years ago

thanks for quickly reply. I tried both command and modified the regex like 'INFO["Func.refGeneWithVer"].match("^ncRNA*") but doesn't work. I don't know why I can't have any variants when used "^ncRNA*". I thought all variants containing ncRNA would be extracted.

brentp commented 2 years ago

can you share a VCF with a single record that should match but doesn't?

luceamso commented 2 years ago

sure, thanks for your time.

single.txt

brentp commented 2 years ago

can you share one with the header?

luceamso commented 2 years ago

added the header, thank you!

single.txt

brentp commented 2 years ago

I was able to use this:

 --info 'INFO["Func.refGeneWithVer"].match("^ncRNA") != null'
luceamso commented 2 years ago

I extracted the variant what I want as modified the code you provided. Thank you so much!