Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SNPs that are at least "N" bp away from each other

    Hello,

    I got a set of SNPs in a vcf file and would like to discard SNPs many nearby. The idea is to take only SNPs that are at least 200 bp away from each other. How can I do this?

    Thanks in advance.

  • #2
    You could do this with awk, assuming the VCF file is sorted in a useful way. The general idea is to keep track of two variables: the chromosome of the last entry and the position of the last entry. If the chromosome of an entry and the previous are different or their distances are above 200bp then print $0 (the variables should be updated in any case). Have a go at writing such a script in awk (or python, or perl, or whatever else you know) and post a question when you run into problems.

    Comment


    • #3
      Originally posted by dpryan View Post
      You could do this with awk, assuming the VCF file is sorted in a useful way. The general idea is to keep track of two variables: the chromosome of the last entry and the position of the last entry. If the chromosome of an entry and the previous are different or their distances are above 200bp then print $0 (the variables should be updated in any case). Have a go at writing such a script in awk (or python, or perl, or whatever else you know) and post a question when you run into problems.
      Hi...

      Thank you for your answer. I thought that possibility before but would like to know whether there was a ready-made option. But I think your suggestion is the best option.

      Thank you!

      Comment


      • #4
        vcftools has a --thin option

        --thin <int>

        Thin sites so that no two sites are within the specified distance from one another.
        Providing nextRAD genotyping and PacBio sequencing services. http://snpsaurus.com

        Comment


        • #5
          Originally posted by SNPsaurus View Post
          vcftools has a --thin option

          --thin <int>

          Thin sites so that no two sites are within the specified distance from one another.

          Hi SNPsaurus,

          I tried using this function but it only generates a log file (with the number of unique variants that range) and not a new VCF. Is that so?


          Thank you for your answer!

          Comment


          • #6
            I think you need to add the --recode option, which tells vcftools to actually make a new vcf based on the filtering.
            Providing nextRAD genotyping and PacBio sequencing services. http://snpsaurus.com

            Comment


            • #7
              Originally posted by SNPsaurus View Post
              I think you need to add the --recode option, which tells vcftools to actually make a new vcf based on the filtering.

              It really is that. Thank you very much once again.

              Comment


              • #8
                Hi SNPsaurus,
                I have applied various filters from VCFfilter tool i.e. DP>10, AF>0.1 etc.
                This filter information is shown in top of the VCF file also. However, when I used to work with VCFtools for minimum SNPs distance (--Thin 10000) parametere, it does not show the information in vcf file.
                Can you make me understand regarding this?

                Regards
                Prakash Thakor

                Comment

                Latest Articles

                Collapse

                • seqadmin
                  Best Practices for Single-Cell Sequencing Analysis
                  by seqadmin



                  While isolating and preparing single cells for sequencing was historically the bottleneck, recent technological advancements have shifted the challenge to data analysis. This highlights the rapidly evolving nature of single-cell sequencing. The inherent complexity of single-cell analysis has intensified with the surge in data volume and the incorporation of diverse and more complex datasets. This article explores the challenges in analysis, examines common pitfalls, offers...
                  06-06-2024, 07:15 AM
                • seqadmin
                  Latest Developments in Precision Medicine
                  by seqadmin



                  Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

                  Somatic Genomics
                  “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
                  05-24-2024, 01:16 PM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by seqadmin, Yesterday, 06:58 AM
                0 responses
                13 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 06-06-2024, 08:18 AM
                0 responses
                20 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 06-06-2024, 08:04 AM
                0 responses
                18 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 06-03-2024, 06:55 AM
                0 responses
                13 views
                0 likes
                Last Post seqadmin  
                Working...
                X