Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling get_variant_context function's "both alleles have consequences" warning #2

Open
youngchanpark opened this issue May 17, 2021 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@youngchanpark
Copy link
Member

There's this part of code in the get_variant_context function.

for(i in alleles) {

for(i in alleles) {
          #print(paste("allele", i))
	       #print(colnames(cons))
	       topaste=getVepSnp(chr=chr,pos=pos,allele=i,build=build)
	       #print(colnames(topaste))
	       #if(!("colocated_variants" %in% colnames(topaste))){topaste$colocated_variants=""}

	        #cons=ifelse(is.null(cons), topaste, rbind(cons,topaste))
          if(!is.null(topaste)){
            if(!is.null(cons)){warning("problem: both alleles have consequences");print(cons); print(tobind)}
            cons=topaste$most_severe_consequence[1]
          }
      }

There is currently a code that outputs a warning message that says both alleles have a consequence assigned to it.

I found a real situation where this occurred:

chr = 17 
pos = 5762108
a1 = 'CGT'
a2 = 'CGTGT'

a1_vep = getVepSnp(chr=chr,pos=pos,allele=a1,build=build)
a2_vep = getVepSnp(chr=chr,pos=pos,allele=a2,build=build)

print(a1_vep$most_severe_consequence)
print(a2_vep$most_severe_consequence)

Both allele's consequence is intergenic, but I thought I'd assume there would be another case where the consequence may differ.

The current code just prints out the a1's consequence and overwrites the cons variable with a2's consequence value.

I'm writing up this issue just to make sure whether this is our intended behaviour, or whether we need to handle it differently.

If this is indeed an intended behaviour, I think we should add a line of warning message, saying the A2's consequence will overwrite the consequence.

Would like your input @agilly

@youngchanpark youngchanpark added the question Further information is requested label May 17, 2021
@youngchanpark youngchanpark self-assigned this May 17, 2021
@agilly
Copy link
Member

agilly commented May 27, 2021

I presume this will happen mostly for indels where the REF is not exactly the REF that Ensembl has, or for multiallelics.

How is the most_severe_consequence field handled down the line? Is it parsed and conditioned on in any meaningful way? If not, ideal behaviour could be to make it something like "CGT=CGTGT=intergenic" if in cases like these, the csq are equal, or "AT=synonymous,ATAT=frameshift" if they are not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants