Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • LeonDK
    Member
    • Sep 2014
    • 69

    Problems installing bcftools and fixref plugin for using Sanger Imputation Service

    Dear all,

    I am trying to use the Sanger imputation service (https://imputation.sanger.ac.uk/), but I get the following error:
    "Reference allele mismatch at 1:752566 .. REF_SEQ:'G' vs VCF:'A'"

    According to this link https://imputation.sanger.ac.uk/?resources=1, this can be fixed by installing bcftools and using the fixref plugin available here https://github.com/pd3/bcftools/blob...ugins/fixref.c

    However, after installing bcftools, there are no plugins:
    Code:
    bcftools plugin -vl
    plugin directory /usr/local/libexec/bcftools .. ok
    
    No functional bcftools plugins were found. The environment variable BCFTOOLS_PLUGINS is not set.
    I have downloaded fixref.c and placed it in /usr/local/libexec/bcftools but still nok luck. If I try to compile fixref.c I get:
    Code:
    gcc fixref.c 
    fixref.c:84:22: fatal error: bcftools.h: No such file or directory
     #include "bcftools.h"
                          ^
    compilation terminated.
    Despite bcftools being installed:
    Code:
    which bcftools 
    /usr/local/bin/bcftools
    Not really sure what to do here?
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    Did you compile bcftools yourself? If so you should have the bcftools.h header file available in the source code that you downloaded. You can edit the fixref.c file to include full path to the bcftools.h file and see if you can get the plug-in to compile.

    Comment

    • LeonDK
      Member
      • Sep 2014
      • 69

      #3
      Okay, so I got the plugins to install, by going to https://samtools.github.io/bcftools/ and then issuing the following commands:
      Code:
       git clone --branch=develop git://github.com/samtools/htslib.git
      git clone --branch=develop git://github.com/samtools/bcftools.git
      git clone --branch=develop git://github.com/samtools/samtools.git
      cd bcftools; make
      cd ../samtools; make
      Followed by:
      Code:
      cd ../bcftools; sudo make install
      cd ../samtools; sudo make install
      Then I get the plugins:
      Code:
      bcftools plugin -lv | head
      
      -- GTisec --
      Count genotype intersections across all possible sample subsets in a vcf file.
      
      -- color-chrs --
      Color shared chromosomal segments, requires phased GTs.
      
      -- counts --
      A minimal plugin which counts number of samples, SNPs,
      INDELs, MNPs and total number of sites.
      But I still cannot compile the fixref.c plugin:
      Code:
      cd /usr/local/libexec/bcftools/ ; sudo gcc -shared -o fixref.so -fPIC fixref.c
      fixref.c:84:22: fatal error: bcftools.h: No such file or directory
       #include "bcftools.h"
                            ^
      compilation terminated.

      Comment

      • GenoMax
        Senior Member
        • Feb 2008
        • 7142

        #4
        See where the bcftools source was put locally. bcftools.h should be in the top level directory. Edit the fixref.x source to include path to that file.

        #include "/path_to/bcftools.h"

        Comment

        • LeonDK
          Member
          • Sep 2014
          • 69

          #5
          Originally posted by GenoMax View Post
          See where the bcftools source was put locally. bcftools.h should be in the top level directory. Edit the fixref.x source to include path to that file.

          #include "/path_to/bcftools.h"
          Thank you, that worked with respect to getting fixref.c compiled into fixref.so, like so:
          Code:
          sudo gcc -shared -o fixref.so -fPIC fixref.c
          however, unfortunately I am not quite there yet:
          Code:
          $ bcftools plugin fixref
          Could not initialize fixref, version string not found

          Comment

          • GenoMax
            Senior Member
            • Feb 2008
            • 7142

            #6
            Check the syntax for using the plugin at the link you included above. It appears to go something like this.

            Code:
            bcftools +fixref file.bcf -- -f ref.fa

            Comment

            • LeonDK
              Member
              • Sep 2014
              • 69

              #7
              Originally posted by GenoMax View Post
              Check the syntax for using the plugin at the link you included above. It appears to go something like this.

              Code:
              bcftools +fixref file.bcf -- -f ref.fa
              Thanks a lot for input GenoMax! It's getting late in my part of the world, i will continue working on the issue tomorrow...

              Comment

              • LeonDK
                Member
                • Sep 2014
                • 69

                #8
                Originally posted by GenoMax View Post
                Check the syntax for using the plugin at the link you included above. It appears to go something like this.

                Code:
                bcftools +fixref file.bcf -- -f ref.fa
                It's not flying, despite using the stated syntax, I still get
                Code:
                Could not initialize fixref, version string not found
                I cannot find any elaboration on the fixref plugin on Sanger. I have tried to look in the source code, but I cannot seem to identify the error.

                Thanks for input, I will try to mail the source code author and ask.

                Comment

                • LeonDK
                  Member
                  • Sep 2014
                  • 69

                  #9
                  I have checked out the "Plugins troubleshooting:" at https://samtools.github.io/bcftools/bcftools.html with no luck.

                  So far unfortunately, I am stuck. I have written Sanger and the author and I am currently awaiting an answer. Should I get one, I will return to this thread with it for any future reference...

                  Comment

                  • jmarshall
                    Samtools maintainer
                    • Jul 2009
                    • 39

                    #10
                    Originally posted by LeonDK View Post
                    Thank you, that worked with respect to getting fixref.c compiled into fixref.so, like so:
                    Code:
                    sudo gcc -shared -o fixref.so -fPIC fixref.c
                    That only partially compiled it (to be precise, it did not link it).

                    To compile this plugin properly, you need to reproduce the commands that are used to compile the other plugins. So you should drop fixref.c into your bcftools-x.y.z/plugins source directory, and use a command like:

                    Code:
                    gcc -fPIC -shared -O2 -I. -I../htslib -o plugins/fixref.so version.c plugins/fixref.c
                    to compile it (which you run from the parent bcftools-x.y.z source code directory).

                    Comment

                    • LeonDK
                      Member
                      • Sep 2014
                      • 69

                      #11
                      Originally posted by jmarshall View Post
                      That only partially compiled it (to be precise, it did not link it).

                      To compile this plugin properly, you need to reproduce the commands that are used to compile the other plugins. So you should drop fixref.c into your bcftools-x.y.z/plugins source directory, and use a command like:

                      Code:
                      gcc -fPIC -shared -O2 -I. -I../htslib -o plugins/fixref.so version.c plugins/fixref.c
                      to compile it (which you run from the parent bcftools-x.y.z source code directory).
                      You sir, are my new hero!

                      Code:
                      $ cd ~/tmp/bcftools/
                      $ wget https://raw.githubusercontent.com/pd3/bcftools/develop/plugins/fixref.c
                      $ gcc -fPIC -shared -O2 -I . -I ../htslib/ -o fixref.so version.c fixref.c
                      $ mv fixref.so /usr/local/libexec/bcftools/
                      $ bcftools plugin fixref -h
                      
                      About: This tool helps to determine and fix strand orientation.
                             Currently the following modes are recognised:
                                 flip  .. flips non-ambiguous SNPs and ignores the rest
                                 stats .. converts from Illumina TOP strand to fwd
                                 top   .. converts from Illumina TOP strand to fwd
                      Might I suggest that a little more information on how to properly install the fixref-plugin is added? Alternatively it could come bundled with bcftools, now that it is explicitly suggested as part of the Sanger Imputation Service?

                      Thanks again!

                      Comment

                      • jmarshall
                        Samtools maintainer
                        • Jul 2009
                        • 39

                        #12
                        I expect that it will indeed be bundled within the next bcftools release.

                        Comment

                        • Petr
                          Junior Member
                          • Oct 2011
                          • 6

                          #13
                          Glad that it worked for you in the end.

                          Just a note, you don't need to invoke gcc directly, here is a slightly simpler version:

                          Code:
                          $ cd ~/tmp/bcftools
                          $ wget -O plugins/fixref.c https://raw.githubusercontent.com/pd3/bcftools/develop/plugins/fixref.c
                          $ make
                          $ mv plugins/fixref.so /usr/local/libexec/bcftools/
                          $ bcftools +fixref -h

                          Comment

                          • Petr
                            Junior Member
                            • Oct 2011
                            • 6

                            #14
                            I see that people are repeatedly struggling with the installation. Because of the rapid development of bcftools and htslib, best is to get the latest development version of both using the instructions described at this page http://samtools.github.io/bcftools.

                            In short:
                            Code:
                                git clone git://github.com/samtools/htslib.git
                                git clone git://github.com/samtools/bcftools.git
                                cd bcftools; make
                            The clone command above is used to create a local copy of the remote repository and needs to be run only once. Whenever the latest snapshot from github is needed, use instead the pull command:

                            Code:
                                cd htslib; git pull
                                cd ../bcftools; git pull
                                make clean
                                make
                            IMPORTANT: In order to use the BCFtools plugins, this environment variable must be set to point to the correct location:

                            Code:
                                export BCFTOOLS_PLUGINS=/path/to/bcftools/plugins
                            Verify by running

                            Code:
                                /path/to/bcftools/bcftools plugin -l
                                /path/to/bcftools/bcftools +fixref -h
                            The first command should print the list of available plugins (all *.so files in the plugins directory) and the second should print the usage help text for fixref.

                            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...
                              Today, 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
                            22 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...