Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • 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

  • #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


    • #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


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

        Comment


        • #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


          • #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


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

              Comment


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

                Comment


                • #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


                  • #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


                    • #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


                      • #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

                        • seqadmin
                          Techniques and Challenges in Conservation Genomics
                          by seqadmin



                          The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                          Avian Conservation
                          Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                          03-08-2024, 10:41 AM
                        • seqadmin
                          The Impact of AI in Genomic Medicine
                          by seqadmin



                          Artificial intelligence (AI) has evolved from a futuristic vision to a mainstream technology, highlighted by the introduction of tools like OpenAI's ChatGPT and Google's Gemini. In recent years, AI has become increasingly integrated into the field of genomics. This integration has enabled new scientific discoveries while simultaneously raising important ethical questions1. Interviews with two researchers at the center of this intersection provide insightful perspectives into...
                          02-26-2024, 02:07 PM

                        ad_right_rmr

                        Collapse

                        News

                        Collapse

                        Topics Statistics Last Post
                        Started by seqadmin, 03-14-2024, 06:13 AM
                        0 responses
                        34 views
                        0 likes
                        Last Post seqadmin  
                        Started by seqadmin, 03-08-2024, 08:03 AM
                        0 responses
                        72 views
                        0 likes
                        Last Post seqadmin  
                        Started by seqadmin, 03-07-2024, 08:13 AM
                        0 responses
                        81 views
                        0 likes
                        Last Post seqadmin  
                        Started by seqadmin, 03-06-2024, 09:51 AM
                        0 responses
                        68 views
                        0 likes
                        Last Post seqadmin  
                        Working...
                        X