Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • pileup only on a specific position

    I am wondering is there a way to use samtools pileup to out put pileup only on 1 position I want? Since the bam file is sorted and indexed, I would think this is doable, I saw there is a -l option for pileup, but couldn't make it work. Does anyone know how?

    Thanks

  • #2
    I assume you want to do it based on the coordinates?

    Code:
    $ samtools view my.bam | awk '$3=="chr1" && $4>5 && $4<10'
    That will show you the positions for chr1 where the coordinates are >5 and <10.
    -drd

    Comment


    • #3
      You can also supply a set of positions in a space delimited file with the -l option

      Code:
      samtools pileup -l site-list.txt my.bam myref.fa

      where site-list.txt might contain
      Code:
      chr1 123456789

      Comment


      • #4
        Both of those method works sort of, but the problem is they don't stop after I found what I wanted. For example if I only want the 1 position in chr1, it will still search through the whole bam file, which is wasting a lot of time.

        Comment


        • #5
          samtools mpileup -r chr1:100-100 ...

          Comment


          • #6
            Originally posted by lh3 View Post
            samtools mpileup -r chr1:100-100 ...
            this is very nice feature. But it seems that it can only output one region at a time?

            I am wondering if the pileup can be made according to a BED file or any files that defines a series of regions. It is particularly useful for targeted exome re-sequencing.

            Comment


            • #7
              speed-wise, taking a BED or not will not make a big difference. The speed of mpileup is determined by the number of reads. As the majority of reads fall in targeted regions, time spent on non-target regions is relatively small.

              Comment


              • #8
                In my case (maybe very special), there are a couple dozen out of all genes are of interests. so, to output only the specific exons is often requested.

                Comment


                • #9
                  Hi there,

                  I have similar question too.

                  samtools view ftp://hgdownload.cse.ucsc.edu/gbdb/h...33.16.hg18.bam chr3:36186433-36186433

                  give me a short sequence w multiple bps, instead of 1 bp that I prefer.

                  & my Window PC does not have the "awk" function

                  Thanks in advance.

                  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 on Modified Bases...
                    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
                  39 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-10-2024, 10:19 PM
                  0 responses
                  41 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-10-2024, 09:21 AM
                  0 responses
                  35 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