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
                  Strategies for Sequencing Challenging Samples
                  by seqadmin


                  Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                  03-22-2024, 06:39 AM
                • seqadmin
                  Techniques and Challenges in Conservation Genomics
                  by seqadmin



                  The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                  Avian Conservation
                  Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                  03-08-2024, 10:41 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by seqadmin, Yesterday, 06:37 PM
                0 responses
                12 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, Yesterday, 06:07 PM
                0 responses
                10 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 03-22-2024, 10:03 AM
                0 responses
                52 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 03-21-2024, 07:32 AM
                0 responses
                68 views
                0 likes
                Last Post seqadmin  
                Working...
                X