Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • samtools mpileup multiple bam files

    Hi,
    I am trying to run samtools mpileup on multiple bam files but for some reason I am getting the error "view: invalid option -- 'b'" and I end up with an empty bcf file.

    This is my code:
    samtools mpileup -uf ref.fa sample1_sorted.bam sample2_sorted.bam sample3_sorted.bam | bcftools view -bvcg - > group_var.raw.bcf

    I have indexed the reference and all bam files using samtools and all files are in the same directory. Why would the b option be invalid? If I remove all bam files except one, the analysis works.

    Thank you!
    Last edited by lizzi; 04-08-2014, 03:59 AM.

  • #2
    I cannot figure out what is wrong. I get the same error if I use a single bam file as well so that is not the problem.

    Again, this is the error I get,
    " view: invalid option -- 'b'

    About: VCF/BCF conversion, view, subset and filter VCF/BCF files.
    Usage: bcftools view [options] <in.vcf.gz> [region1 [...]]"

    I have done this before with the same files and there was no issue. I cannot figure out what the problem could be. If anyone has any ideas, it would be greatly appreciated.

    Comment


    • #3
      I just tried something very simple - converting a bcf file to vcf.
      bcftools view file.bcf > file.vcf and received this error
      [vcf.c:643 bcf_hdr_read] invalid BCF2 magic string: only BCFv2.2 is supported.
      Failed to open or the file not indexed: file.bcf
      Is there a problem with bcftools? All of this worked for me just yesterday, the files are all the same, so I cannot figure out what is wrong. If anyone has any idea what this could mean or what could be wrong, it would help me a lot.

      Thank you!

      Comment


      • #4
        Did you use picard tools at any of the steps in your workflow?

        Comment


        • #5
          No, I have only used samtools.

          Comment


          • #6
            Which version are you using?

            Comment


            • #7
              I am using version 0.1.18 on the university supercomputer. We also have 0.1.16 and 0.1.8. I have tried repeating these tasks with the other versions too, but I get the same errors.

              Comment


              • #8
                Strange, I can't find that error in the source code anywhere. You might try the command on a computer with a single known version of samtools (preferably the latest version, 0.1.19) to see if you can reproduce the problem.

                Comment


                • #9
                  Thank you for checking for me and trying to help.
                  I actually just did that, downloaded the latest version to my computer and don't have any trouble with those commands. Perhaps the program on the supercomputer has been corrupted in some way.

                  Thank you again.

                  Comment


                  • #10
                    Se my answer here https://www.biostars.org/p/122528/
                    Data analysis www.persmed.eu

                    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