nextstrain / nextclade

Viral genome alignment, mutation calling, clade assignment, quality checks and phylogenetic placement
https://clades.nextstrain.org
MIT License
219 stars 61 forks source link

Allow indels in primer detection #510

Open mcroxen opened 3 years ago

mcroxen commented 3 years ago

Thank you so much for your work on nextclade.

I was wondering if code could be added so that --input-pcr-primers primers.csv could also report on if there is a deletion or insertion in the priming region.

Thank you

ivan-aksamentov commented 3 years ago

If someone wants to implement, we discussed this with Matthew on Slack and here are some technical details:

Currently it only checks for substitutions. Deletions should be pretty easy to add, just need to loop over the deletions similar to how it loops over substitutions: https://github.com/nextstrain/nextclade/blob/15daff812fbaa8aff54ca8b7b846fe0cacc90850/packages/nextclade/src/analyze/getPcrPrimerChanges.cpp#L38-L44 and check if a deletion range and a primer range have an intersection (in terms of nuc positions).

Insertions might be a bit harder, they are stripped away early on, but should be doable too. Just need to pass all the necessary data into the function I linked above (or to make a new one).

rneher commented 3 years ago

yes, this would be a useful addition. We already have code to detect overlap of deletions with genes and codons, I believe.

@mcroxen out of curiosity, what primer sets are you testing against? we have only a vague ideas of who uses this feature and the default primers in the app are possibly quite out-dated. So we'd be happy to find out how this is used.

mcroxen commented 3 years ago

@rneher we have our own in-house oligos that we like to keep an eye on, and thought it would be handy to be able to capture both substitutions and indels if they occur.