Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • willgrand
    Junior Member
    • Jan 2015
    • 4

    bcftools issue

    Folks:

    I have a mouse sequencing project with multiple .bam files generated.

    samtools version 0.1.19-44428cd
    bcftools version 1.1-137-g1f79bbd (using htslib 1.1-124-g9b1cb94)

    I tried to do the following:

    samtools mpileup -g -f mm10.fa mybam.bam > mybam.bcf

    The program runs for several hours then generated a 5Gb file mybam.bcf

    However,when I tried to use
    bcftools view mybam.bcf

    it has error:

    [E::hts_hopen] fail to open file 'mybam.bcf'
    [E::hts_open] fail to open file 'mybam.bcf'
    Failed to open mybam.bcf: Success

    same error message if I use 'bcftools call -v mybam.bcf' command

    anyone has the same issue and is there a solution? the file is just there but seems the program fail to see it
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    Can you try one of the following?

    Code:
    $ bcftools view ./mybam.bcf
    or

    Code:
    $ bcftools view /path_to/mybam.bcf
    Use the bcftools included in samtools v.0.1.19.
    Last edited by GenoMax; 01-20-2015, 07:33 AM. Reason: version mismatch by OP

    Comment

    • dpryan
      Devon Ryan
      • Jul 2011
      • 3478

      #3
      Mixing different versions of samtools and vcftools is usually a bad idea. If you're going to use a new version of bcftools, use a new version of samtools too. That resolves problems like this most of the time.

      Comment

      • GenoMax
        Senior Member
        • Feb 2008
        • 7142

        #4
        Missed the fact that OP was mixing samtools versions. Good catch Devon.

        Comment

        • willgrand
          Junior Member
          • Jan 2015
          • 4

          #5
          Thanks for the replies, I think this is due to issue with different version and potentially different htslib ...

          downloading latest samtools and building it now...

          NGS is a beast given all process takes long time to finish

          Comment

          • willgrand
            Junior Member
            • Jan 2015
            • 4

            #6
            using latest samtools:

            samtools mpileup -g -f mm10.fa mybam.bam > mybam.bcf

            got message: [fai_fetch_seq] The sequence "1" not found
            [fai_fetch_seq] The sequence "10" not found

            googled the error message but got no informative information, should I be concerned? mybam.bam has its mybam.bai file in the same folder...

            Comment

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #7
              Are you sure the chromosome names in the BAM file and fasta file match?

              Comment

              • dpryan
                Devon Ryan
                • Jul 2011
                • 3478

                #8
                BTW, if the answer is yes, then try remaking the fasta index (samtools faidx).

                Comment

                • willgrand
                  Junior Member
                  • Jan 2015
                  • 4

                  #9
                  Thanks, I think that is the issue here... will look into it and get back to you
                  Originally posted by dpryan View Post
                  BTW, if the answer is yes, then try remaking the fasta index (samtools faidx).

                  Comment

                  • Jessica_L
                    Senior Member
                    • Feb 2010
                    • 117

                    #10
                    I'm having the same issue with
                    "[fai_fetch_seq] The sequence "1" not found"
                    across all human chromosomes when I'm running mpileup. I am about 99% certain that chr names aren't identical in both files, but I'm not sure how to fix that. Editing my human genome fasta file isn't really an option...

                    I'm on a linux system, using samtools/bcftools v1.2 and I tried remaking the fasta index already. Has anyone else had this problem before?

                    Comment

                    • dpryan
                      Devon Ryan
                      • Jul 2011
                      • 3478

                      #11
                      If you're fairly certain that the chromosome names differ between the files then you'll need to change one of them. Changing them in the BAM file just require "samtools view -H foo.bam", changing the names (but not the order!) to be correct, and using "samtools reheader". Alternatively, just download the matching fasta file (presumably from Ensembl or Gencode, given the error message).

                      Comment

                      • Jessica_L
                        Senior Member
                        • Feb 2010
                        • 117

                        #12
                        Originally posted by dpryan View Post
                        If you're fairly certain that the chromosome names differ between the files then you'll need to change one of them. Changing them in the BAM file just require "samtools view -H foo.bam", changing the names (but not the order!) to be correct, and using "samtools reheader". Alternatively, just download the matching fasta file (presumably from Ensembl or Gencode, given the error message).
                        Thanks! I'm going to give the samtools reheader a try first!

                        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, 07-24-2026, 12:17 PM
                        0 responses
                        16 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 07-23-2026, 11:41 AM
                        0 responses
                        18 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 07-20-2026, 11:10 AM
                        0 responses
                        24 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...