Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ty23991
    Member
    • May 2015
    • 24

    bedtools bamtofastq taking too long

    Hi
    I am running the bedtools bamtofastq for converting bam to splitted fastq (read1 and read2) files for paired end reads with an expected wall time of 24 hours and memory of 4000mb.

    The input bam file is about 140 GB whereas the output file size has reached to merely 0.3 GB. So it seems that the tools is running too slow for some reason. The following is command was used. The input file has been sorted by samtools sort by names.

    bedtools bamtofastq -i X_Sorted.bam -fq X.R1.fq -fq2 X.R2.fq

    Any suggestions appreciated.
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    Perhaps you have hit memory/wall time limit for this job?

    An alternative may be reformat.sh from BBMap suite. Brian's code tends to be very efficient so you may want to give it a try. Make sure samtools is in your path for something like following to work.

    Code:
    $ reformat.sh in=file.bam out=file.fq.gz
    Are you sure that both reads have been kept in the bam file? If not you will have a problem of singletons and you will need to separate them before de-interleaving the fastq file. Start with this:

    Code:
    $ reformat.sh in=file.fq.gz verifypairing
    $ reformat.sh in=file.fq.gz out1=R1.fq out2=R2.fq

    Comment

    • ty23991
      Member
      • May 2015
      • 24

      #3
      Thanks so much. It turned out that the output directory was located in a different file system in a cluster and that somehow causes bedtools output to be written at extremely slow rate. The problem solves if i use the output directory location within the same file system in the cluster. I will post more details in case this happens only with bedtools or is a general I/O issue.

      Regardless- I tried reformat.sh and based on output rate, it turns out to be relatively efficient. Thanks so much for the clue.

      Comment

      • muxingu
        Junior Member
        • Apr 2011
        • 3

        #4
        Use the "bamtofastq" in Biobambam instead. It runs way faster and the code is highly optimized. Bedtools is written by amateurs. That's why it's slow.

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
          by SEQadmin2


          Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


          The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
          ...
          06-02-2026, 10:05 AM
        • SEQadmin2
          Single-Cell Sequencing at an Inflection Point: Early Impacts of New Platforms and Emerging Trends
          by SEQadmin2


          With the launch of new single-cell sequencing platforms in 2026, the field stands at an exciting inflection point. This article surveys the most impactful advances in the field and discusses how they’re reshaping research in cancer, immunology, and beyond.


          Introduction

          Single-cell sequencing technologies have undergone remarkable advances over the past decade, transitioning from low-throughput experimental approaches to highly scalable platforms capable of...
          05-22-2026, 06:42 AM
        • SEQadmin2
          Environmental Genomics in the Age of NGS: From Microbes to Conservation Strategies
          by SEQadmin2

          Studying ecosystems means dealing with complex, multi-species communities that are hard to observe at scale. This complexity, however, hides many important questions to be answered, from how biogeochemical cycles work and how climate change can affect species distribution to how conservation strategies can work best.


          Genomics, particularly since the expansion of NGS, has transformed ecosystem ecology. By sequencing environmental DNA, we can now assess biodiversity without direct...
          05-06-2026, 09:04 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Yesterday, 08:59 AM
        0 responses
        14 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-02-2026, 12:03 PM
        0 responses
        22 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 06-02-2026, 11:40 AM
        0 responses
        19 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 05-28-2026, 11:40 AM
        0 responses
        32 views
        0 reactions
        Last Post SEQadmin2  
        Working...