Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dena.dinesh
    Member
    • Feb 2013
    • 58

    Samtools error: fail to open file XXX_sorted.bam.0000

    Hi,

    I have a bam files and I want to sort them. i used the following command

    samtools sort control_1.bam -f control_1_sorted.bam

    It produces temporary files and later when trying to merge them it throws an error "No such file or directory
    [bam_merge_core] fail to open file control_1_sorted.bam.0000"

    Please guide me to solve it.
  • mastal
    Senior Member
    • Mar 2009
    • 666

    #2
    Usage: samtools sort [options...] [in.bam]

    try writing your command as:
    samtools sort -f control_1_sorted.bam control_1.bam

    Comment

    • WhatsOEver
      Senior Member
      • Apr 2012
      • 215

      #3
      "-f" is a legacy option and just not needed anymore.

      just use
      Code:
      samtools sort control_1.bam control_1_sorted
      to get a coordinate-sorted file named control_1_sorted.bam

      if you want to have the same file sorted by names, use
      Code:
      samtools sort -n control_1.bam control_1_sorted

      Comment

      • dpryan
        Devon Ryan
        • Jul 2011
        • 3478

        #4
        For what it's worth, I too prefer the "legacy" format when dealing only with BAM files. The new sort command format takes twice as long to type, since you have to specify the output format and the prefix.

        Comment

        • WhatsOEver
          Senior Member
          • Apr 2012
          • 215

          #5
          @dpryan: You are seriously complaining about typing speed? In that case I would go for scripting it. With a short script name it will be the shortest possible solution
          Code:
          bamFile=$1
          sortBam="${bamFile%.*}_sorted"
          
          samtools sort $bamFile $sortBam

          Comment

          • dpryan
            Devon Ryan
            • Jul 2011
            • 3478

            #6
            That's the legacy format The new format would be

            Code:
            samtools sort -O bam -T tmp input.bam > output.bam
            Of course that'd be scripted with a bunch of files, but with even then if you're only dealing with BAM then the legacy format is slightly quicker to type.

            Now I wonder if I ever submitted a pull request on how -T and -O are documented and set...

            Comment

            • WhatsOEver
              Senior Member
              • Apr 2012
              • 215

              #7
              oh... yes... of course... looks like my mind is already on the weekend

              Comment

              • dpryan
                Devon Ryan
                • Jul 2011
                • 3478

                #8
                I know the feeling Schönes Wochenende!

                Comment

                Latest Articles

                Collapse

                • SEQadmin2
                  Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                  by SEQadmin2


                  Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                  The systematic characterization of the human proteome has
                  ...
                  07-20-2026, 11:48 AM
                • SEQadmin2
                  Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                  by SEQadmin2



                  Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                  ...
                  07-09-2026, 11:10 AM
                • SEQadmin2
                  Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                  by SEQadmin2



                  Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                  There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                  07-08-2026, 05:17 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by SEQadmin2, Today, 12:17 PM
                0 responses
                10 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, Yesterday, 11:41 AM
                0 responses
                11 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 07-20-2026, 11:10 AM
                0 responses
                23 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 07-13-2026, 10:26 AM
                0 responses
                37 views
                0 reactions
                Last Post SEQadmin2  
                Working...