Seqanswers Leaderboard Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • OTU
    Member
    • May 2013
    • 44

    sequence coverage format trouble

    Hi everyone!

    I am using bowtie2 to map my reads on scaffolds and I would like to know, is there a way to get a coverage calculation in samtools? I know that I can use BEDTools, but how can I get .bed format from bam? And for my analysis pipeline I need .csv format of coverage information, which is not created in BEDTools.
    Any ideas how I can do this?


    Help!:
    Last edited by OTU; 01-23-2014, 02:13 PM.
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    There are several solutions on this biostars page including a "samtools depth" one: http://www.biostars.org/p/5165/

    Comment

    • OTU
      Member
      • May 2013
      • 44

      #3
      Thank you!
      However, I wasn't able to find a way to get the information on coverage to be in csv format.
      I used this:
      samtools depth *bamfile* | awk '{sum+=$3} END { print "Average = ",sum/NR}'

      And got the number. Is there a way to get it in csv format?

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        Code:
        samtools depth *bamfile* | awk '{sum+=$3} END { printf("Average,%f\n",sum/NR)}' > some_file.csv
        Will make the output comma separated (csv is just a text file with commas as column separators).

        Comment

        • GenoMax
          Senior Member
          • Feb 2008
          • 7142

          #5
          That awk script only prints a single number for the whole bam so that is probably not the output OTU is looking for.

          @OTU Are you looking to get a "depth" number for each scaffold?

          Comment

          Latest Articles

          Collapse

          • 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, Today, 05:03 AM
          0 responses
          15 views
          0 reactions
          Last Post seqadmin  
          Started by seqadmin, Yesterday, 07:27 AM
          0 responses
          12 views
          0 reactions
          Last Post seqadmin  
          Started by seqadmin, 03-18-2025, 12:50 PM
          0 responses
          14 views
          0 reactions
          Last Post seqadmin  
          Started by seqadmin, 03-03-2025, 01:15 PM
          0 responses
          185 views
          0 reactions
          Last Post seqadmin  
          Working...