Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jdrum00
    Member
    • Dec 2009
    • 16

    #1

    Samtools rmdup in a stream

    I'm trying the following strategy to remove duplicates from small subsets of interest:

    samtools view -b test.bam chr1:7660315-7660315 | samtools rmdup - - | samtools view -

    ...but it doesn't seem to remove anything. Am I doing something wrong syntactically, or do I perhaps have some of that data that rmdup doesn't work on? How do I tell if I have FR orientation, or if ISIZE is correctly set? (I'm new to using BAMs, and I don't create them myself.)

    Here's a sample line.

    938_1080_925 16 chr1 590592 0 30M * 0 0 TCATGTCAACTGCAAACAGAAACAATTTAA :BIIIICIIIIIIIIIHIIIIIIIIIIIII RG:Z:0 CS:Z:T003003011002211001312101211312 CQ:Z:?0>59;7=/;=><54<5<39?/@/5>3A):

    (And yes, according to other posts, "I should really use Picard for this". But that has weird Java problems on my system that I don't have the time or permissions to fix.)

    Thanks!
  • lh3
    Senior Member
    • Feb 2008
    • 686

    #2
    For samtools, you must set ISIZE correctly; otherwise it won't work. If you have single-end reads, use rmdup -s. To use Picard, you must have MRNM and MPOS set correctly for paired end reads (so far as I know). Picard is more theoretically correct about duplicates. You may see tiny differences between samtools and Picard results, but in practice this does not matter too much.

    Comment

    • jdrum00
      Member
      • Dec 2009
      • 16

      #3
      Thanks, but I don't know if I have ISIZE set correctly or if I have single-end reads. Those are my actual questions.

      Comment

      • Pepe
        Member
        • Mar 2009
        • 30

        #4
        You need to read the sam format specifications:
        Look it up on google.
        Column number 9 is the Inferred insert SIZE (ISIZE). If all of those in your file are 0, then you have single ends (or no read mapped to the reference )

        Comment

        • jdrum00
          Member
          • Dec 2009
          • 16

          #5
          Originally posted by Pepe View Post
          You need to read the sam format specifications:
          Look it up on google.
          Column number 9 is the Inferred insert SIZE (ISIZE). If all of those in your file are 0, then you have single ends (or no read mapped to the reference )
          I've read the spec backwards and forwards; it's a matter of understanding the details. I don't see anywhere that it says "if you have all zeroes, that means single ends, so use rmdup -s" -- so, thanks.

          Comment

          • lh3
            Senior Member
            • Feb 2008
            • 686

            #6
            To tell if reads are paired in sequencing or mapped in pairs, one should look at the FLAG (2nd) column.

            Comment

            • jdrum00
              Member
              • Dec 2009
              • 16

              #7
              I know about the flags field, but I don't know what those things mean in detail. I've Googled for resources about pairing, but I don't think I'm getting the whole picture. I just don't know enough about sequencing technology yet, I guess.

              Is the combination of pipes I'm trying reasonable, if I get the right options set up? That is, am I correct that I want a -b on my first view command, so that I'm sending BAM format to rmdup? And should those stdin/stdout dashes work, the way I have them? Thanks.

              Comment

              Latest Articles

              Collapse

              • SEQadmin2
                Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                by SEQadmin2



                Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                ...
                10-14-2026, 09:55 AM
              • SEQadmin2
                New Genomics Technologies Take Aim at Long-Standing Limits
                by SEQadmin2


                Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                ...
                09-28-2026, 10:25 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by SEQadmin2, 10-22-2026, 11:13 AM
              0 responses
              27 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-22-2026, 10:48 AM
              0 responses
              20 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-15-2026, 10:52 AM
              0 responses
              36 views
              0 reactions
              Last Post SEQadmin2  
              Started by SEQadmin2, 10-14-2026, 05:39 AM
              0 responses
              43 views
              0 reactions
              Last Post SEQadmin2  
              Working...