Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Counting number of reads mapped to an allele

    Hi,

    I have a sam file and I want to count how many queries mapped to a specific reference in the reference file. Is there a simple way to do this? Thanks!

  • #2
    One way would be with bedtools multicov.

    You'll need to convert your SAM file to a BAM file, sort the BAM file and index it.
    If you put your reference in the form of a BED file, you can then easily count the number of alignments for each interval defined in the BED file with bedtools multicov.

    Comment


    • #3
      So if I want to count the number of alignments to the reference with rname "IGHV01-02" how would I define this in the BED file?

      Comment


      • #4
        Sorry, I misunderstood your question.
        I thought reference meant a chromosomal position.
        BED files work with chromosomal positions.
        You could still answer your question with bedtools multicov though, if you defined the start as 0 and the end as a position larger than the largest position in IGHV01-02.
        E. g.
        IGHV01-02 0 10000000

        However, if your question is that simple, you could just use grep.
        grep -c IGHV01-02 yoursamfile

        Comment


        • #5
          Hi,

          Yes, I did try grep but when I do grep -c "IGHV7-81*01" myfile.sam the count is 0 and when I grep for "IGHV7-81*" the count is 119, but I'm very sure there is at least one IGHV7-81*01.

          Comment


          • #6
            I don't know.

            If your SAM file has a header, you could check the reference names in the header.
            You could also check the reference names in the reference genome, as well as test the grep syntax on the reference genome.

            You could also convert the SAM file to a BAM file, sort it and index it.
            You could then load the BAM file and the reference genome in IGV to visualize the alignments.

            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...
              04-22-2024, 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, Yesterday, 08:47 AM
            0 responses
            13 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-11-2024, 12:08 PM
            0 responses
            60 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-10-2024, 10:19 PM
            0 responses
            60 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-10-2024, 09:21 AM
            0 responses
            54 views
            0 likes
            Last Post seqadmin  
            Working...
            X