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
                      Best Practices for Single-Cell Sequencing Analysis
                      by seqadmin



                      While isolating and preparing single cells for sequencing was historically the bottleneck, recent technological advancements have shifted the challenge to data analysis. This highlights the rapidly evolving nature of single-cell sequencing. The inherent complexity of single-cell analysis has intensified with the surge in data volume and the incorporation of diverse and more complex datasets. This article explores the challenges in analysis, examines common pitfalls, offers...
                      06-06-2024, 07:15 AM
                    • seqadmin
                      Latest Developments in Precision Medicine
                      by seqadmin



                      Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

                      Somatic Genomics
                      “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
                      05-24-2024, 01:16 PM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, Yesterday, 06:58 AM
                    0 responses
                    13 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 06-06-2024, 08:18 AM
                    0 responses
                    20 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 06-06-2024, 08:04 AM
                    0 responses
                    18 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 06-03-2024, 06:55 AM
                    0 responses
                    13 views
                    0 likes
                    Last Post seqadmin  
                    Working...
                    X