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
              Recent Developments in Metagenomics
              by seqadmin





              Metagenomics has improved the way researchers study microorganisms across diverse environments. Historically, studying microorganisms relied on culturing them in the lab, a method that limits the investigation of many species since most are unculturable1. Metagenomics overcomes these issues by allowing the study of microorganisms regardless of their ability to be cultured or the environments they inhabit. Over time, the field has evolved, especially with the advent...
              09-23-2024, 06:35 AM
            • seqadmin
              Understanding Genetic Influence on Infectious Disease
              by seqadmin




              During the COVID-19 pandemic, scientists observed that while some individuals experienced severe illness when infected with SARS-CoV-2, others were barely affected. These disparities left researchers and clinicians wondering what causes the wide variations in response to viral infections and what role genetics plays.

              Jean-Laurent Casanova, M.D., Ph.D., Professor at Rockefeller University, is a leading expert in this crossover between genetics and infectious...
              09-09-2024, 10:59 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, 10-02-2024, 04:51 AM
            0 responses
            13 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 10-01-2024, 07:10 AM
            0 responses
            21 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 09-30-2024, 08:33 AM
            0 responses
            25 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 09-26-2024, 12:57 PM
            0 responses
            18 views
            0 likes
            Last Post seqadmin  
            Working...
            X