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
                  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...
                  Yesterday, 07:01 AM
                • 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

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by seqadmin, 04-11-2024, 12:08 PM
                0 responses
                59 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 10:19 PM
                0 responses
                57 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 09:21 AM
                0 responses
                48 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-04-2024, 09:00 AM
                0 responses
                55 views
                0 likes
                Last Post seqadmin  
                Working...
                X