Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Questions concerning samtools bedcov

    Hello,
    I have some question concerning samtools bedcov to which I didn't found answers until now.

    1. Does bedcov ignore reads marked as PCR/optical duplicates when calculating the coverage?

    2. It seems that bedcov needs the index bam file. Right?
    So I have a batch of bam files in which pcr duplicates are not flagged. I need to run PicardTools MarkDuplicates on them. I would like to pipe the output directly to bedcov, but because the output have no index it doesn't work. Is there a way to pipe to bedcov without creating intermediate files?

    Thanks for your help.

    fin swimmer

  • #2
    1. This is completely undocumented, but it skips marked duplicates, entries marked as "unaligned", secondary alignments, and alignments marked as QC failed (bit 512, which is rarely seen).
    2. Correct, you need to "samtools index" the file first.

    There's no way for you to pipe into samtools bedcov.

    Comment


    • #3
      Point of clarification; the BAM needs to be sorted before indexing (use samtools 'sort').

      Comment


      • #4
        Thank you all for your answers.

        It's a pitty that I cannot pipe to bedcov. So I have to write a small shell script that do all neccessary steps and clean up the intermediate files afterwards.

        Do I have to sort bam files everytime I manipulated (markduplicateds, using samtools view ...) them? Or is it just to be sure, that they are sorted?

        fin swimmer

        Comment


        • #5
          You only need to sort a BAM file once. Marking duplicates/filtering/etc. on a sorted file results in another sorted file. Just reindex it if appropriate.

          Regarding needing to write a script to streamline things, I think many of us find snakemake a convenient way to do that (it can handle removing intermediate files for you).

          Comment


          • #6
            Originally posted by dpryan View Post
            Regarding needing to write a script to streamline things, I think many of us find snakemake a convenient way to do that (it can handle removing intermediate files for you).
            Thanks for that hint. Didn't know it before. It looks very useful. I will have a closer look at it.

            fin swimmer

            Comment

            Latest Articles

            Collapse

            • seqadmin
              Quality Control Essentials for Next-Generation Sequencing Workflows
              by seqadmin




              Like all molecular biology applications, next-generation sequencing (NGS) workflows require diligent quality control (QC) measures to ensure accurate and reproducible results. Proper QC begins at nucleic acid extraction and continues all the way through to data analysis. This article outlines the key QC steps in an NGS workflow, along with the commonly used tools and techniques.

              Nucleic Acid Quality Control
              Preparing for NGS starts with isolating the...
              02-10-2025, 01:58 PM
            • seqadmin
              An Introduction to the Technologies Transforming Precision Medicine
              by seqadmin


              In recent years, precision medicine has become a major focus for researchers and healthcare professionals. This approach offers personalized treatment and wellness plans by utilizing insights from each person's unique biology and lifestyle to deliver more effective care. Its advancement relies on innovative technologies that enable a deeper understanding of individual variability. In a joint documentary with our colleagues at Biocompare, we examined the foundational principles of precision...
              01-27-2025, 07:46 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, 02-07-2025, 09:30 AM
            0 responses
            54 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 02-05-2025, 10:34 AM
            0 responses
            88 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 02-03-2025, 09:07 AM
            0 responses
            68 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 01-31-2025, 08:31 AM
            0 responses
            44 views
            0 likes
            Last Post seqadmin  
            Working...
            X