CCICB / vcf2mafR

Convert VCFs and VCF-related formats to MAF
Other
1 stars 1 forks source link

Pave Annotation Fails df2maf #8

Closed selkamand closed 11 months ago

selkamand commented 11 months ago

Pave phases nearby insertions/deletions so may annotate variants to have an effect like 'phased_inframe_variant'.

df2maf function by default guesses whether an allele is inframe or not by looking at ref and alt. Why? well VEP can annotate variants as protein_altering_variant. We need to know whether these variants are inframe or not to properly map them to valid MAF terms.

dt_maf[, "Inframe" := data.table::fcase(
    Ref_Length == Alt_Length, TRUE,
    abs(Ref_Length - Alt_Length) %% 3 == 0, TRUE,
    default = FALSE
  )]

mutationtypes::mutation_types_convert_so_to_maf adds some checks to flag if the calculated 'inframe' status aggrees with the mutation types where that information is built into the consequence (e.g. if your consequence is 'inframe_deletion', inframe should be TRUE). Now PAVE 'phased' variants might look out-of-frame by looking at ref & alt but when phased in relation to nearby variants - it actually becomes an inframe variant. This mismatch makes mutationtypes::mutation_types_convert_so_to_maf throw an error.

Whats the fix?

Easiest fix is to just add mutationtypes::mutation_types_convert_pave_to_maf option if 'pave' argument = TRUE. This function wouldn't need the inframe argument