Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • 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.

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

    Comment


    • #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


      • #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


        • #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


          • #6
            Thanks for all the solutions!!

            Comment


            • #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


              • #8
                I have been able to solve the problem

                Comment

                Latest Articles

                Collapse

                • seqadmin
                  Recent Advances in Sequencing Technologies
                  by seqadmin







                  Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

                  Long-Read Sequencing
                  Long-read sequencing has...
                  12-02-2024, 01:49 PM
                • seqadmin
                  Genetic Variation in Immunogenetics and Antibody Diversity
                  by seqadmin



                  The field of immunogenetics explores how genetic variations influence immune responses and susceptibility to disease. In a recent SEQanswers webinar, Oscar Rodriguez, Ph.D., Postdoctoral Researcher at the University of Louisville, and Ruben Martínez Barricarte, Ph.D., Assistant Professor of Medicine at Vanderbilt University, shared recent advancements in immunogenetics. This article discusses their research on genetic variation in antibody loci, antibody production processes,...
                  11-06-2024, 07:24 PM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by seqadmin, 12-02-2024, 09:29 AM
                0 responses
                146 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 12-02-2024, 09:06 AM
                0 responses
                51 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 12-02-2024, 08:03 AM
                0 responses
                42 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 11-22-2024, 07:36 AM
                0 responses
                73 views
                0 likes
                Last Post seqadmin  
                Working...
                X