Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JdeBruin
    Member
    • Jun 2013
    • 25

    #1

    Extract Mapped Reads grouped by positions

    Hi,

    I have mapped reads to a reference genome using Bowtie2 and BWA, using samtools I have created bam files etc.

    What I would like to achieve is to group reads based on the mapping location, a new group is formed when a large gap in the mapping results are observed.
    For example, all reads that map to position 1-10000 will be in group 1 then a gap in the mapping may be present and the next mapped read will start at 15000 - 18000 followed by a gap this will then form group2.

    Any help would be appreciated.
  • sphil
    Senior Member
    • Apr 2010
    • 192

    #2
    Do you know where your "gaps" are present?

    Comment

    • JdeBruin
      Member
      • Jun 2013
      • 25

      #3
      Hi thanks for the reply.

      The gaps can be seen in the mapping results using IGV/picard thus the gaps can be defined.

      Comment

      • sphil
        Senior Member
        • Apr 2010
        • 192

        #4
        samtools view is a method of choice, if you have defined gaps you can go like this:
        Code:
        samtools view indexed_sorted.bam chr2:1,000,000-2,000,000
        for example to view just the alignments on chr2 between region 1000000 and 2000000. Note the coordinate is 1-based.
        If you need more infos this page might help: samtools FAQ
        Every read which is returned for your specific position is in that group. Region to look at == group.

        Hope that helps.

        Comment

        • swbarnes2
          Senior Member
          • May 2008
          • 910

          #5
          You can also use BEDTools intersectBed to make a new .bam which is the intersect of your .bam file and a .bed file of coordinates.

          Comment

          • JdeBruin
            Member
            • Jun 2013
            • 25

            #6
            Thanks for all the solutions!!

            Comment

            • JdeBruin
              Member
              • Jun 2013
              • 25

              #7
              Hi,

              when I use the following:
              samtools view indexed_sorted.bam chr2:1,000,000-2,000,000
              I get the following error:
              [bam_header_read] EOF marker is absent. The input is probably truncated.
              [bam_header_read] invalid BAM binary header (this is not a BAM file).
              [main_samview] fail to read the header from "indexed_sorted.bam".

              Would the view not require a flag as to specify a bam file?

              Comment

              • JdeBruin
                Member
                • Jun 2013
                • 25

                #8
                I have been able to solve the problem

                Comment

                Latest Articles

                Collapse

                • SEQadmin2
                  Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                  by SEQadmin2



                  Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                  Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                  ...
                  10-14-2026, 09:55 AM
                • SEQadmin2
                  New Genomics Technologies Take Aim at Long-Standing Limits
                  by SEQadmin2


                  Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                  We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                  ...
                  09-28-2026, 10:25 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by SEQadmin2, 10-22-2026, 11:13 AM
                0 responses
                48 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-22-2026, 10:48 AM
                0 responses
                37 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-15-2026, 10:52 AM
                0 responses
                46 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-14-2026, 05:39 AM
                0 responses
                46 views
                0 reactions
                Last Post SEQadmin2  
                Working...