Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • replacing specific positions in fasta from vcf/list

    I have a reference assembly (in fasta format) and vcf file containing a list of specific sites. I'd like to edit the fasta file to change these positions to 'Ns'.

    Does anyone have any suggestions for a tool to accomplish this? I also have a trimmed down version of the vcf that just contains chrom# and position...

    Thanks in advance for any suggestions!

  • #2
    Sounds like a job for python or perl.

    You could read through the vcf file and gather the positions in a dictionary. Then read through the fasta file and make the change to N at positions that match in the dictionary..

    Comment


    • #3
      thanks for the reply. yeah--seems to be the way to go, but i'm unfortunately not fluent enough in either language.

      i did find this example but couldn't get it to run properly (it output an entire new fasta for each individual position as it looped through the vcf instead of accumulating all the changes in the vcf before printing a single, mutated fasta). i suspect it's a trivial change to get it to work properly.

      at any rate, i managed to hack a solution by changing the 'alt' allele in my vcf to 'N', modifying (using sed) all the GT values to "1/1", then feeding this file into GATK's FastaAlternateReferenceMaker tool. clearly far from elegant, but i checked the positions in question in the output and it seemed to have worked.

      Comment


      • #4
        Clever solution!

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Recent Advances in Sequencing Analysis Tools
          by seqadmin


          The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
          05-06-2024, 07:48 AM
        • seqadmin
          Essential Discoveries and Tools in Epitranscriptomics
          by seqadmin




          The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
          04-22-2024, 07:01 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, Yesterday, 06:57 AM
        0 responses
        12 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-06-2024, 07:17 AM
        0 responses
        16 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-02-2024, 08:06 AM
        0 responses
        19 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-30-2024, 12:17 PM
        0 responses
        24 views
        0 likes
        Last Post seqadmin  
        Working...
        X