Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • vinodhsri
    Junior Member
    • Nov 2011
    • 2

    ERROR: [bcf_sync] incorrect number of fields..

    Has anyone encountered this error ('[bcf_sync] incorrect number of fields (0 != 5)') and found a solution already:


    vcfutils.pl splitchr -l 50000000 ucsc.hg19.fasta.fai | xargs -i echo samtools mpileup -I -C50 -m3 -F0.0002 -DSuf ucsc.hg19.fasta -r {} -b bam.list | bcftools view -bcvg - /> part-{}.bcf

    [bcf_sync] incorrect number of fields (0 != 5) at 0:0
    [afs] 0:0.000
    xargs: echo: terminated by signal 13

    Appreciate your advice.

    vsri
  • sflink
    Junior Member
    • Oct 2010
    • 1

    #2
    I get the same error message with a command like:

    nohup samtools mpileup -uf ref.fa s1.bam s2.bam

    but it runs fine without the 'nohup'. Have you tried the command sequence without the pipes?

    Comment

    • Mark.hz
      Member
      • Mar 2009
      • 18

      #3
      I ran into this problem as well, using mpileup/bcftools (samtools-0.1.18) to call variants from 19 bam files.
      I willl try to run it wiiltout nohup.

      Comment

      • Mark.hz
        Member
        • Mar 2009
        • 18

        #4
        Still have this problem when doing bcftools view for a bcf file (mpileup generated):[bcf_sync] incorrect number of fields (6 != 5) at 7:1396330564
        Any help?

        Comment

        • colindaven
          Senior Member
          • Oct 2008
          • 417

          #5
          This is weird. I've used Samtools a lot before on bacterial references and never had this problem, yet on some human exomes it happens. Mpileup runs fine and then I repeatedly get

          [bcf_sync] incorrect number of fields (0 != 5) at 0:0

          Reinstalling/updating samtools and bcftools doesn't seem to help.

          Comment

          • brentp
            Member
            • Apr 2010
            • 72

            #6
            usually this happens if your bcf file is truncated.

            Comment

            • colindaven
              Senior Member
              • Oct 2008
              • 417

              #7
              Actually, I think it wasn't truncated, but something added by nohup.

              When I don't use nohup to run the mpileup command bcftools seems to work fine.

              Comment

              • Mark.hz
                Member
                • Mar 2009
                • 18

                #8
                I still got the error message without nohup: "[bcf_sync] incorrect number of fields (6 != 5) at 7:1396330564"

                Comment

                • salturki
                  Member
                  • May 2008
                  • 12

                  #9
                  I just had the same error and by adding '-u' option to 'samtools mplieup' part of the pipeline , this solved the issue in my case.
                  Last edited by salturki; 04-23-2012, 10:18 AM.

                  Comment

                  • kweber2
                    Member
                    • Aug 2010
                    • 10

                    #10
                    Make sure you're using the correct reference genome

                    In case anyone else encounters this same problem ("[bcf_sync] incorrect number of fields (6 != 5)..."), here's another possible solution:

                    I was having this problem with multiple files, but then I realized I was using the wrong reference fasta as the argument to the mpileup -f option. It wasn't the same reference fasta that was used to create the bam files. When I switched to the correct one, the problem went away.

                    Comment

                    • wangli
                      Member
                      • Apr 2012
                      • 48

                      #11
                      I also had the problem when using nohup. Without nohup. it goes well.

                      Comment

                      • mmartin
                        Member
                        • Aug 2009
                        • 73

                        #12
                        The problem occurs when nohup is used with a Unix pipe.

                        I've just sent this reply to the samtools-help mailing list.

                        nohup merges stdout and stderr of the command that it runs. bcftools then
                        doesn't know what to do with the input data since it also contains messages
                        such as "[mpileup] 1 samples in 1 input files".

                        To avoid the problem, you can run the command like this:

                        nohup samtools mpileup ... 2> stderr.txt | bcftools ... - > out.raw.bcf &

                        But I strongly suggest you try the 'screen' program. It is less fragile and
                        much more powerful than nohup. This is the briefest introduction I could find: http://www.askbjoernhansen.com/2006/...ix_screen.html

                        Comment

                        • Elsie
                          Member
                          • Mar 2011
                          • 85

                          #13
                          I'm getting this error with this command
                          samtools mpileup -D -S -u -f hg19.fasta child.bam father.bam mother.bam | bcftools view -vcgT trioauto -s sample.txt - > samtoolsCLR.vcf
                          The resulting vcf file just has the INFO and FORMAT ## lines, then:
                          #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT
                          [bcf_sync] incorrect number of fields (0 != 5) at 0:0
                          [afs] 0:0.000
                          I am using the correct fa reference file.
                          My samples file looks like:
                          child.bam
                          father.bam
                          mother.bam

                          Any advice appreciated.

                          Comment

                          • Elsie
                            Member
                            • Mar 2011
                            • 85

                            #14
                            Solved my own problem, simple typo in samples file I missed.

                            Comment

                            • Sacrolfur
                              Member
                              • Oct 2013
                              • 13

                              #15
                              I had the same problem. I think the problen is that bcftools works with bcf-file but you don't specify for samtools to output bcf. So you should add to samtools mpileup command argument -g.

                              Hope this was helpful.

                              Comment

                              Latest Articles

                              Collapse

                              • mylaser
                                Reply to Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                                by mylaser
                                Kheloyar – Everything You Need to Know About Kheloyaar Login and Kheoyar Id
                                If you are looking for an online gaming platform that offers a user-friendly experience, Kheloyar has become a name that many users search for. Whether you're interested in creating a new account, accessing your dashboard through Kheloyaar Login, or learning how to obtain a Kheoyar Id, understanding the platform's features and account process is essential.
                                This guide explains everything you need to know about...
                                Yesterday, 01:13 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-09-2026, 10:04 AM
                              0 responses
                              17 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-08-2026, 10:08 AM
                              0 responses
                              10 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-07-2026, 11:05 AM
                              0 responses
                              24 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-02-2026, 11:08 AM
                              0 responses
                              31 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...