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
          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, 12:17 PM
        0 responses
        11 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-29-2024, 10:49 AM
        0 responses
        18 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-25-2024, 11:49 AM
        0 responses
        24 views
        0 likes
        Last Post seqadmin  
        Started by seqadmin, 04-24-2024, 08:47 AM
        0 responses
        22 views
        0 likes
        Last Post seqadmin  
        Working...
        X