Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • How to replace select reads in a bam file?

    Hey all,

    I want to take an aligned file, run it through Dindel, output realigned windows, and merge the realigned windows with the original aligned file. If I ran the entire aligned file through Dindel I could just use the realigned windows and be done. However, to save time, I'd rather just have Dindel look at candidate windows. Thus, only a subset of reads in the aligned file will be pulled to be run through Dindel.

    Another way to state this, I want to take a subset of reads in an aligned file, alter them, and replace the original versions with the altered versions. Is there an easy way to do this? Thanks!

  • #2
    This isn't a trivial thing to do in BAM files due to the compressed and block-based nature of the file. Any change of the contents within a block is likely to alter the compressed size of the contents, meaning that the block boundaries will need to be shifted in the file, requiring a rewrite of the remainder of the file.

    Comment


    • #3
      That is logical. How about SAM files then? I should have just specified that originally.

      Comment


      • #4
        You could do this with SAM but given that it is text, random access will be a real pain. It really would be easier to take a BAM file and write it to a new file, swapping reads that you want to change. This is how local realignment methods work.

        Comment


        • #5
          I see. Is there anything already written that can do this? The real problem here is that my coding skills are very limited. I imagined that something designed for this purpose (replacing specific reads) would have already been publicly available but perhaps not.

          Comment


          • #6
            I agree it would be useful but I do not know of any end user tools that could do this. Is this a one-time need or would you do this over and over again? If you send me a PM I might be able to help more.

            Comment


            • #7
              Originally posted by genericforms View Post
              I agree it would be useful but I do not know of any end user tools that could do this. Is this a one-time need or would you do this over and over again? If you send me a PM I might be able to help more.
              I would be using it for a high throughput targeted sequencing project. We have 5000 samples which is why I would like to speed things up as quickly as possible. I'm at Washington University and surrounded by a lot of people who are far better at coding than I am, so don't worry about specifically helping me; I'll figure something out. I appreciate the offer, though.

              Comment


              • #8
                Originally posted by Heisman View Post
                I would be using it for a high throughput targeted sequencing project. We have 5000 samples which is why I would like to speed things up as quickly as possible. I'm at Washington University and surrounded by a lot of people who are far better at coding than I am, so don't worry about specifically helping me; I'll figure something out. I appreciate the offer, though.
                If you want to speed things up maximally I highly recommend you work with some computer guys to:

                (1) build a list of changes you want to make to the entire file
                (2) use the samtools or bamtools API to rewrite the BAM file and specifically modify reads in your list from #1

                The text file option will probably be too slow. Good luck!

                Comment


                • #9
                  Originally posted by genericforms View Post
                  If you want to speed things up maximally I highly recommend you work with some computer guys to:

                  (1) build a list of changes you want to make to the entire file
                  (2) use the samtools or bamtools API to rewrite the BAM file and specifically modify reads in your list from #1

                  The text file option will probably be too slow. Good luck!
                  Alright, sounds good. Thanks for the advice!

                  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
                  31 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-10-2024, 10:19 PM
                  0 responses
                  32 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-10-2024, 09:21 AM
                  0 responses
                  28 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-04-2024, 09:00 AM
                  0 responses
                  53 views
                  0 likes
                  Last Post seqadmin  
                  Working...
                  X