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

How to construct a complex indel from SNVs and simple indels #1

Closed
genetronhealth opened this issue Dec 31, 2021 · 6 comments
Closed

Comments

@genetronhealth
Copy link

Hi, I read your paper, this repo, and the doc at https://indelpost.readthedocs.io/en/latest/api.html and I still do not know how to construct a complex indel from simple variants. For example, from a VCF file generated by Mutect/Strelka/UVC as input, how do I get a new VCF file with small variants fused into complex indels.

@rawagiha
Copy link
Member

rawagiha commented Dec 31, 2021

Thanks for your interest. This library expects you to write your own scripts to construct complex indels from simple indel inputs. For example, please see:
https://indelpost.readthedocs.io/en/latest/examples.html#annotating-complex-indels-from-simple-indels
This example works with a table format. However, an input VCF can easily be parsed to a table. I'd recommend appending the complex allele representation to INFO field.

Currently, this library constructs a complex indel from a simple indel, not from SNV.

Please let me know if you need more info. Or, please contact me if you need a sample script with a sample dataset.

@genetronhealth
Copy link
Author

genetronhealth commented Jan 1, 2022

Hi @rawagiha
Thank you for your quick reply. I tried using your script and got the following error as shown in the picture.
image
Is it because I was trying to combine two SNVs with one InDel (as hinted by you in your last reply)?

@rawagiha
Copy link
Member

rawagiha commented Jan 1, 2022

Hi @genetronhealth

No, this is my fault!!

Please apply phase(how="complex") to valn as fixed in the doc.
v_cplx = valn.phase(how="complex") ## not apply to v
https://indelpost.readthedocs.io/en/latest/examples.html#annotating-complex-indels-from-simple-indels
image

My apologies about this.

By the way, inputting SNV won't throw an error. Applying"phase" to VariantAlignment object representing a SNV returns a NullVariant object (https://indelpost.readthedocs.io/en/latest/api.html#indelpost.NullVariant).

@rawagiha
Copy link
Member

rawagiha commented Jan 1, 2022

Additional note on constructing complex indels:

In actual practice, we do not know in advance which SNVs and indels to combine. Or, the variant caller may not report all members of the target complex indel. Further, SNVs and Indels may be reported in two separate VCF files. For these reasons, indelPost only requires one indel to construct the target complex indel. It will search other members in the BAM file. In your case, the deletion at 55242469 is enough for construction. The other SNVs will be automatically searched. If the input indel is simple, the phase method returns the input indel as it is.

@genetronhealth
Copy link
Author

Hi @rawagiha

Thank you for your information. I got it working. I noticed a small typo in the doc at https://indelpost.readthedocs.io/en/latest/examples.html#annotating-complex-indels-from-simple-indels

The line of code
return v_cplx.pos, v_cplx.ref. v_cplx.alt
should be
return v_cplx.pos, v_cplx.ref, v_cplx.alt # comma instead of period

@rawagiha
Copy link
Member

rawagiha commented Jan 4, 2022

@genetronhealth

Wow! Thanks a lot for finding another typo (will fix it!).
I will close the issue for now.
Please let me know for any question you may have.

@rawagiha rawagiha closed this as completed Jan 4, 2022
rawagiha added a commit that referenced this issue Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants