-
Notifications
You must be signed in to change notification settings - Fork 94
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
How to apply a protein change to a given amino acid sequence to produce a mutant amino acid sequence #641
Comments
I'm reading this as: you'd like to create a p. expression for an arbitrary protein change. Right? As you pointed out in #640, and discussed in #333, there's poor congruence between the nt and aa data models, so the method will look different for nt and aa variation (unfortunately).
Is that what you wanted? #333 would aim to create greater parity between the models, and therefore enable something more like |
@reece I have a similar problem. My vision on such a function would be
Is there any function in the package that would offer the conversion from (wildtype sequence, variant) -> (mutant sequence)? |
Agreed with @kchu02 , I want a method where I can supply the wildtype sequence and it applies the protein or cdna change. It should do some validation if ref/alt are available, but it can't in many situations. |
I have a similar use case but expanded to include the use case of having multiple variants. For example if I have 2 SNP variants in DNA space (in which ever space
If case 1 is true, then you can just convert
So i'd like to apply multiple variants to a DNA sequence, making the full alt sequence and then convert to AA (and get the per AA variants back out). Edit: |
@mbiokyle29 : Your use case is actually the inverse of the topic of this issue, which is reverse translation from protein to nucleic acid sequence. Your issue is actually about what HGVS alleles (see the "[ ]" bullet on https://varnomen.hgvs.org/recommendations/general/, the links from there). We took a stab at alleles a long time ago, but it presents numerous complexities, including how to handle/warn about overlapping variants, shuffling (including shuffling variants into each other), phasing certain/uncertain, coordinate shifting due to upstream indels. All of these have solutions, but understanding the complexity of this implementation requires a pretty deep understanding of HGVS... and even then there are unknown dragons lurking, I suspect. Meanwhile, I rarely see HGVS alleles in the wild, so it was very unclear that the complexity would be worth the effort. |
@reece thanks for the additional context (and again for all the hard work on the library). I have come up with an approach which solves my current challenge. For reference our use case is pretty divergent from the primary focus of HGVS. We are working on protein engineering tools, for tracking changes made to proteins of interest (stored, expressed and sequenced from plasmids). We have variant calls in VCF format in DNA space. What I did was:
This idea was based on the "Note" section of https://varnomen.hgvs.org/recommendations/DNA/variant/delins/. Specifically:
The merge code (which only works currently for directly adjacent variants, not the base in the middle case yet): def merge_dna_variant(left, right, hdp):
if all([
left.ac == right.ac,
left.type == right.type,
left.posedit.edit.type in {'delins', 'sub'},
right.posedit.edit.type in {'delins', 'sub'},
left.posedit.pos.end.base + 1 == right.posedit.pos.start.base
]):
new_start = left.posedit.pos.start.base
new_end = right.posedit.pos.end.base
ref = hdp.get_seq(new_start - 1, new_end)
return SequenceVariant(
ac=left.ac,
type=left.type,
posedit=PosEdit(
pos=Interval(
start=SimplePosition(base=new_start),
end=SimplePosition(base=new_end),
),
edit=NARefAlt(
alt=left.posedit.edit.alt + right.posedit.edit.alt,
alt=ref,
),
),
) I am confident that this is fairly abnormal, but hopefully doesn't produce an incorrect result. In my limited testing it appears to have worked. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
This issue was closed by stalebot. It has been reopened to give more time for community review. See biocommons coding guidelines for stale issue and pull request policies. This resurrection is expected to be a one-time event. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
I was thinking it would be in one of the mapping or projection classes, but I couldn't find one. I don't want to have to rely on transcript sequence database lookups or the like, but simply provide the reference AA sequence and the change to apply.
The text was updated successfully, but these errors were encountered: