This is a test version of Biostars. For the public version, visit https://www.biostars.org.
snp, indels and their densities in each chromosome

Hi

Can anyone help me to find the number of snps, indels and their densities in each chromosome ?

Thanks

snp

what is your input? do you have sequences , alignment or already have snps file?

And I think this is Question not a Tool

Hi sir

Input is vcf file which has snps and indels information.

Thanks

Hi sir

I cudnt install bioalcide.. I installed gradle too. Can you pls go through the error once ..

root@genetics-Precision-Tower-7810:/home/sukesh/jvarkit# make bioalcidae echo "Compiling htsjdk with ${JAVA_HOME} = " Compiling htsjdk with = echo "Compiling htsjdk library for java. It requires Gradle http://gradle.org/ since 2016 May 30. Libraries will be installed in $gradle.user.home='/root/.gradle' . If it fails here, it's a not a problem with jvarkit." Compiling htsjdk library for java. It requires Gradle http://gradle.org/ since 2016 May 30. Libraries will be installed in .user.home='/root/.gradle' . If it fails here, it's a not a problem with jvarkit. echo "And ${JAVA_HOME}/bin/javac should be >=1.8" And /bin/javac should be >=1.8 (cd /home/sukesh/jvarkit/htsjdk-5196d09b3e9cc72f73d7bf08f0154f50bdadd475 && ./gradlew --gradle-user-home "/root/.gradle" ) Downloading https://services.gradle.org/distributions/gradle-2.13-bin.zip

Exception in thread "main" java.net.UnknownHostException: services.gradle.org at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:579) at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:637) at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:160) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) 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.plainConnect(HttpURLConnection.java:934) at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1302) at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254) at org.gradle.wrapper.Download.downloadInternal(Download.java:58) at org.gradle.wrapper.Download.download(Download.java:44) at org.gradle.wrapper.Install$1.call(Install.java:61) at org.gradle.wrapper.Install$1.call(Install.java:48) at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) at org.gradle.wrapper.Install.createDist(Install.java:48) at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128) at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61) make: * [/home/sukesh/jvarkit/htsjdk-5196d09b3e9cc72f73d7bf08f0154f50bdadd475/build/libs/htsjdk-5196d09b3e9cc72f73d7bf08f0154f50bdadd475-unspecified-SNAPSHOT.jar] Error 1

I am no sure but this is related to gradle proxy maybe "I am green here"

2 answers

If you are aware of gatk then -SelectVariants and -selectType INDEL for indels and -selectType SNP for point mutations can be used to perform the same.

Alternatively vcftools can do the trick. See here

Then a python script to do the same as well.

There are many options

using bioalcidae: https://github.com/lindenb/jvarkit/wiki/BioAlcidae and the following script:

var chrom2count={};
var step=100000;
while(iter.hasNext())
    {
    var ctx = iter.next();
    var contig  = ctx.getContig();
    var start = parseInt(Math.floor(ctx.getStart()/(step*1.0)))*step;

    var key = contig+":"+start+"-"+(start+step);

    var v = null;
    if(!(key in chrom2count) )
        {
        v = {"snp":0,"indel":0};
        chrom2count[key] = v; 
        }
    else
        {
        v = chrom2count[key];
        }
    if( ctx.isIndel()) v.indel++;
    if( ctx.    isSNP()) v.snp++;
    }

out.println(JSON.stringify(chrom2count));

example:

 java -jar dist/bioalcidae.jar -f input.js  my.vcf.gz | python -m json.tool
(....)

(...)
    "8:93400000-93500000": {
        "indel": 0,
        "snp": 24
    },
    "8:93500000-93600000": {
        "indel": 0,
        "snp": 34
    },
    "8:93600000-93700000": {
        "indel": 0,
        "snp": 25
    },
    "8:93700000-93800000": {
        "indel": 1,
        "snp": 6
    },
    "8:93800000-93900000": {
        "indel": 0,
        "snp": 6
    },
    "8:93900000-94000000": {
        "indel": 0,
        "snp": 15
    },
    "8:9400000-9500000": {
        "indel": 0,
        "snp": 10
    },    "8:93400000-93500000": {
        "indel": 0,
        "snp": 24
    },
    "8:93500000-93600000": {
        "indel": 0,
        "snp": 34
    },
    "8:93600000-93700000": {
        "indel": 0,
        "snp": 25
    },
    "8:93700000-93800000": {
        "indel": 1,
        "snp": 6
    },
    "8:93800000-93900000": {
        "indel": 0,
        "snp": 6
    },
    "8:93900000-94000000": {
        "indel": 0,
        "snp": 15
    },
    "8:9400000-9500000": {
        "indel": 0,
        "snp": 10
    },
    "8:94000000-94100000": {
        "indel": 0,
        "snp": 26

    "8:94000000-94100000": {
        "indel": 0,
        "snp": 26
(...)


Log in to answer this question.