Convert multi-allele to bi-allele
1
0
Entering edit mode
6.9 years ago

Hi all,

I have a vcf file and several positions have multi-allele like

REF=TTT

ALT=T,TT,TTTT,TTTTT

To my knowledge, rare variant association tools only handle bi-allele sites. But I want to include these positions, too. So I tried to convert these sites into bi-allelic sites like "ins/del".

I used python to create this file, but the converted sites were not supported by association tool.

Does anyone know how to convert multi- to bi-allele?

vcf • 5.8k views
ADD COMMENT
1
Entering edit mode

In my opinion, we can separate these multi-allelic variants and do the association separately with specific statistic method.

ADD REPLY
1
Entering edit mode
6.9 years ago

I've written a tool VcfMultiToOneAllele http://lindenb.github.io/jvarkit/VcfMultiToOneAllele.html

there's also a tool in GATK: LeftAlignAndTrimVariants https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_gatk_tools_walkers_variantutils_LeftAlignAndTrimVariants.php with an option splitMultiallelics

--splitMultiallelics / -split

Split multiallelic records and left-align individual alleles If this argument is set, split multiallelic records and left-align individual alleles. If this argument is not set, multiallelic records are not attempted to left-align and will be copied as is.

UPDATE 2021: use bcftools norm

ADD COMMENT
0
Entering edit mode

Thank you. But I don't want to split these sites into multiple sites. I want the number of lines remain same as before. What I want to do finally is association test, but the association tool will handle these multiple variants as independent, though they are actually from same position.

So the result file I want to have from the example above is like REF=Del, ALT=Ins and T,TT,TTT will be coded as Del, and TTTT, TTTTT should be Ins.

Thanks.

ADD REPLY
0
Entering edit mode

what about REF=A ALT=T,C ?

ADD REPLY
0
Entering edit mode

For those sites, I want to just remove them.

But for indels, multi-alleles are not caused by noises. So I want to include these sites to association test and I need to simplify them first. Actually I made it with python, but there was something wrong with new vcf file. It seems these newly D/I coded sites are not supported by variant tools, or other tools. These lines were just skipped.

ADD REPLY
0
Entering edit mode

The VcfMultiToOneAllele is giving the following error when I try to use ./gradlew

Downloading https://services.gradle.org/distributions/gradle-6.7-bin.zip

Exception in thread "main" java.net.ConnectException: Connection timed out (Connection timed out)
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:607)
        at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:284)
        at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:173)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
        at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
        at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
        at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
        at org.gradle.wrapper.Download.downloadInternal(Download.java:78)
        at org.gradle.wrapper.Download.download(Download.java:63)
        at org.gradle.wrapper.Install$1.call(Install.java:68)
        at org.gradle.wrapper.Install$1.call(Install.java:48)
        at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:69)
        at org.gradle.wrapper.Install.createDist(Install.java:48)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:107)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
ADD REPLY
0
Entering edit mode
ADD REPLY
0
Entering edit mode

Is there a chance to use the tool without gradle?

ADD REPLY
0
Entering edit mode

Is there a chance to use the tool without gradle?

no

ADD REPLY

Login before adding your answer.

Traffic: 2685 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6