Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • calculate the base distribution of a SAM/BAM file

    Hi everyone,

    I have BAM files and want to know the base distribution at a given reference position. Samtools view can give my all reads that overlap with the reference position but then I have to parse the cigar strings to get the corresponding base from the read. I tried to get the information from VCF/BCF generated by samtools mpileup but they doesn't contain what I am looking for.

    Any suggestions?

    Cheers,
    Mathias

  • #2
    samtools mpileup should give you what you need if you don't pass it to bcftools. Another way would be to load the bam file into IGV and get the summary there.

    Comment


    • #3
      mpileup

      samtools mpileup -BQ0 -d100000 -f hg19.fa -r chr1:17420-17420 BAMFILE

      Will give you the mpileup format for 1 position (then you must parse it). There is a number of parsers around - if you can't find one you can have mine (perl).

      samtools mpileup -BQ0 -d100000 -f hg19.fa -l BEDFILE BAMFILE

      Will do it for a file with one region/position pr. line

      If you need parsing inspiration: https://github.com/riverlee/pileup2b...p2baseindel.pl
      Last edited by pallevillesen; 12-04-2012, 11:59 PM. Reason: Additional information added.

      Comment


      • #4
        Thank you very much, this was exactly what I was looking for.

        Comment

        Latest Articles

        Collapse

        • seqadmin
          Recent Advances in Sequencing Analysis Tools
          by seqadmin


          The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
          05-06-2024, 07:48 AM
        • 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

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by seqadmin, 05-07-2024, 06:57 AM
        0 responses
        12 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-06-2024, 07:17 AM
        0 responses
        16 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 05-02-2024, 08:06 AM
        0 responses
        22 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-30-2024, 12:17 PM
        0 responses
        24 views
        0 likes
        Last Post seqadmin  
        Working...
        X