Seqanswers Leaderboard Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • finswimmer
    Member
    • Oct 2016
    • 60

    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
  • dpryan
    Devon Ryan
    • Jul 2011
    • 3478

    #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

    • HESmith
      Senior Member
      • Oct 2009
      • 512

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

      Comment

      • finswimmer
        Member
        • Oct 2016
        • 60

        #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

        • dpryan
          Devon Ryan
          • Jul 2011
          • 3478

          #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

          • finswimmer
            Member
            • Oct 2016
            • 60

            #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
              Pathogen Surveillance with Advanced Genomic Tools
              by seqadmin




              The COVID-19 pandemic highlighted the need for proactive pathogen surveillance systems. As ongoing threats like avian influenza and newly emerging infections continue to pose risks, researchers are working to improve how quickly and accurately pathogens can be identified and tracked. In a recent SEQanswers webinar, two experts discussed how next-generation sequencing (NGS) and machine learning are shaping efforts to monitor viral variation and trace the origins of infectious...
              03-24-2025, 11:48 AM
            • seqadmin
              New Genomics Tools and Methods Shared at AGBT 2025
              by seqadmin


              This year’s Advances in Genome Biology and Technology (AGBT) General Meeting commemorated the 25th anniversary of the event at its original venue on Marco Island, Florida. While this year’s event didn’t include high-profile musical performances, the industry announcements and cutting-edge research still drew the attention of leading scientists.

              The Headliner
              The biggest announcement was Roche stepping back into the sequencing platform market. In the years since...
              03-03-2025, 01:39 PM
            • seqadmin
              Investigating the Gut Microbiome Through Diet and Spatial Biology
              by seqadmin




              The human gut contains trillions of microorganisms that impact digestion, immune functions, and overall health1. Despite major breakthroughs, we’re only beginning to understand the full extent of the microbiome’s influence on health and disease. Advances in next-generation sequencing and spatial biology have opened new windows into this complex environment, yet many questions remain. This article highlights two recent studies exploring how diet influences microbial...
              02-24-2025, 06:31 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, 03-20-2025, 05:03 AM
            0 responses
            41 views
            0 reactions
            Last Post seqadmin  
            Started by seqadmin, 03-19-2025, 07:27 AM
            0 responses
            46 views
            0 reactions
            Last Post seqadmin  
            Started by seqadmin, 03-18-2025, 12:50 PM
            0 responses
            36 views
            0 reactions
            Last Post seqadmin  
            Started by seqadmin, 03-03-2025, 01:15 PM
            0 responses
            191 views
            0 reactions
            Last Post seqadmin  
            Working...