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
                  Current Approaches to Protein Sequencing
                  by seqadmin


                  Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                  04-04-2024, 04:25 PM
                • 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

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by seqadmin, 04-11-2024, 12:08 PM
                0 responses
                24 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 10:19 PM
                0 responses
                25 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 09:21 AM
                0 responses
                23 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-04-2024, 09:00 AM
                0 responses
                52 views
                0 likes
                Last Post seqadmin  
                Working...
                X