Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • what if samtools sort failed while merging from temp files..

    I was sorting a hug BAM file using
    Code:
    samtools sort -@ 5 -m 4G  <in.bam> <out.prefix>
    While merging from temp files
    Code:
     [bam_sort_core] merging from 630 files...
    it was killed 'cos lack of memory...

    So I checked the temp files and found that I could not simply use samtools merge to merge those temp files 'cos they were not in order

    What shall I do if I just don't wanna start over again...*

  • #2
    FYI, the "-@ 5" and "-m 4G" specify 4GB per thread for 5 threads, so 20GB total. You need to reduce the number of threads or the memory limit if you were trying to stay under 4GB.

    Comment


    • #3
      Originally posted by Brian Bushnell View Post
      FYI, the "-@ 5" and "-m 4G" specify 4GB per thread for 5 threads, so 20GB total. You need to reduce the number of threads or the memory limit if you were trying to stay under 4GB.
      Yep, the total memory should under 20Gb, yet it got 25Gb while merging, so it was killed.

      I just wanna know is there any way to tell samtools to redo the merge( just the merge), 'cos the temp files are already sorted in some way( fast sort? I'm not sure) and I don't want to waste the time to redo the sort.

      Thank you~

      Comment


      • #4
        No, it probably died sorting the temp files. The split and merge parts are both low-memory, only the sort is high-memory.

        Comment


        • #5
          Originally posted by Brian Bushnell View Post
          No, it probably died sorting the temp files. The split and merge parts are both low-memory, only the sort is high-memory.
          samtools has told me that
          Code:
            [bam_sort_core] merging from 630 files...
          thus I am sure the all the temp files have been sorted and
          samtools was killed while doing merging work ...

          The point is, is there any way to redo the merging only, 'cos sorting was really time consuming...

          Comment


          • #6
            I imagine that the merge and sort are done simultaneously. Anyway - if you want results you can trust, of course you can't use temp files from a program that crashed with a nondeterministic out-of-memory error; they could be in any condition.

            Note - I could be wrong; I can't remember the order of samtools' sort messages since I always ignore them. But there's no reason for it to need 25GB RAM while merging unless it is sorting at the same time, or writes are being internally buffered; and in either case, the temp files could be corrupt.
            Last edited by Brian Bushnell; 05-05-2014, 08:37 PM.

            Comment


            • #7
              Originally posted by Brian Bushnell View Post
              I imagine that the merge and sort are done simultaneously. Anyway - if you want results you can trust, of course you can't use temp files from a program that crashed with a nondeterministic out-of-memory error; they could be in any condition.

              Note - I could be wrong; I can't remember the order of samtools' sort messages since I always ignore them. But there's no reason for it to need 25GB RAM while merging unless it is sorting at the same time, or writes are being internally buffered; and in either case, the temp files could be corrupt.
              You're right. Samtools do sort while merging temp files, because there isn't ordinal order between temp files( each temp file contains all the chromosome... ) .

              Comment

              Latest Articles

              Collapse

              • seqadmin
                Essential Discoveries and Tools in Epitranscriptomics
                by seqadmin


                The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist on Modified Bases...
                Yesterday, 07:01 AM
              • seqadmin
                Current Approaches to Protein Sequencing
                by seqadmin


                Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                04-04-2024, 04:25 PM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              39 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              41 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              35 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-04-2024, 09:00 AM
              0 responses
              55 views
              0 likes
              Last Post seqadmin  
              Working...
              X