Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • adurasiwam3
    Member
    • Apr 2012
    • 12

    #1

    help - convert .bed to .bam

    hi,

    i need to convert a .bed file to .bam. I've tried using BEDTools, but i've been running into a lot of issues with it.

    are there any other tools/methods out there to do this?

    thanks
  • arvid
    Senior Member
    • Jul 2011
    • 156

    #2
    What are the issues with bedtools? If you post a few lines of your bed file, maybe these issues could be sorted out.

    Comment

    • adurasiwam3
      Member
      • Apr 2012
      • 12

      #3
      hi,

      thanks for your reply.

      so the current issue i'm having is:

      Error: BED entry without name found at line: 1. Exiting!

      the command I gave in UNIX is:

      bedToBam -i chr1.bed -g hg18.txt > chr1.bam

      chr1.bed (bed file for only chromosome1) looks like this:

      chr1 100000000 100000036
      chr1 100000040 100000076
      chr1 100000090 100000126
      chr1 100000136 100000172
      chr1 100000189 100000225
      chr1 100000235 100000271
      chr1 100000287 100000323
      chr1 100000336 100000372
      chr1 100000401 100000437
      chr1 100000452 100000488
      chr1 100000512 100000548..
      .....

      and hg18.txt looks like this:

      chr1 247249719
      chr10 135374737
      chr11 134452384
      chr12 132349534
      chr13 114142980
      chr14 106368585
      chr15 100338915

      thanks!

      Comment

      • Hobbe
        Member
        • Apr 2010
        • 29

        #4
        The bed file seems very sparse to me. BedToBam seems to be looking for a name which should be in a fourth column. Haven't really tried BedToBam, but that is my guess.

        Comment

        • arvid
          Senior Member
          • Jul 2011
          • 156

          #5
          Yes, that's the problem. Try the following:

          Code:
          cat chr1.bed | awk '{x++; printf "%s\tread%d\n",$0,x}' | bedtools bedtobam -g hg18.txt -i - > chr1.bam
          I get the following output then, when converted to SAM (with samtools view):

          Code:
          read1   0       chr1    100000001       255     36M     *       0       0       *       *
          read2   0       chr1    100000041       255     36M     *       0       0       *       *
          read3   0       chr1    100000091       255     36M     *       0       0       *       *
          read4   0       chr1    100000137       255     36M     *       0       0       *       *
          read5   0       chr1    100000190       255     36M     *       0       0       *       *
          read6   0       chr1    100000236       255     36M     *       0       0       *       *
          read7   0       chr1    100000288       255     36M     *       0       0       *       *
          read8   0       chr1    100000337       255     36M     *       0       0       *       *
          read9   0       chr1    100000402       255     36M     *       0       0       *       *
          read10  0       chr1    100000453       255     36M     *       0       0       *       *
          Last edited by arvid; 05-23-2012, 12:15 AM. Reason: typo

          Comment

          • adurasiwam3
            Member
            • Apr 2012
            • 12

            #6
            thanks a lot for helping out! really appreciate it.

            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
            26 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...