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

                        ad_right_rmr

                        Collapse

                        News

                        Collapse

                        Topics Statistics Last Post
                        Started by SEQadmin2, 06-09-2026, 11:58 AM
                        0 responses
                        13 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 06-05-2026, 10:09 AM
                        0 responses
                        26 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 06-04-2026, 08:59 AM
                        0 responses
                        36 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 06-02-2026, 12:03 PM
                        0 responses
                        60 views
                        0 reactions
                        Last Post SEQadmin2  
                        Working...