Announcement

Collapse

Welcome to the New Seqanswers!

Welcome to the new Seqanswers! We'd love your feedback, please post any you have to this topic: New Seqanswers Feedback.
See more
See less

tabix error on Mac

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • tabix error on Mac

    In the course of getting VCF tools running on Mac (OSX), I stumbled upon what appears to be a Mac-specific problem with tabix. The VCFtools merge-vcf perl script calls tabix <filename.vcf> -l . The '-l' option is not listed in the tabix manual document, but it is supposed to list the sequence names stored in the index of the bgzipped vcf file that gets created via 'tabix -p vcf <filename.vcf.gz>' . Whether running merge-vcf or running tabix directly on the bgzipped versions of the VCFtools example files (as well as on my own data), on a Mac I get the following error:

    '[main] invalid region: unknown target name or minus interval.'

    But, when I run the same exact commands on a Linux machine....everything works fine, no errors at all.

    No related posts to date as far as I can tell, but is anyone else aware of this issue, and is there any plan to correct it in the future?
    Adam H. Freedman
    Dept. of OEB, Harvard University

  • #2
    Try changing the perl script from calling this:

    tabix <filename.vcf> -l

    to call this instead:

    tabix -l <filename.vcf>

    Comment


    • #3
      thanks. didn't change the perl script yet, but, yes, running tabix -l <filename> on the command line instead of tabix <filename> -l solves the problem. very odd behavior on the Mac's part though...or perhaps it is more accurate to say better behavior on Linux's part.
      Adam H. Freedman
      Dept. of OEB, Harvard University

      Comment


      • #4
        Tabix parses its command line options with getopt(). On Linux, you get GNU getopt() which, as a convenient extension to the standard behaviour, accepts options intermixed with arguments such as filenames. On Mac OS, unless you take steps to compile tabix with GNU getopt() yourself, you get the standard behaviour -- which doesn't.

        Taking advantage of this non-portable extension is a wee bug in vcftools's Vcf.pm (and also vcf-isec), and I've pointed Petr at this thread, so hopefully it'll get fixed in svn soon. (And in the meantime, as maubp showed, it's not too hard to patch it yourself )

        -- John

        Comment


        • #5
          Originally posted by adamhfreedman View Post
          thanks. didn't change the perl script yet, but, yes, running tabix -l <filename> on the command line instead of tabix <filename> -l solves the problem. very odd behavior on the Mac's part though...or perhaps it is more accurate to say better behavior on Linux's part.
          Yes, this annoys me regularly (e.g. "ls *.py -l" has to be typed as "ls -l *.py"). This is a Mac OS X design choice that affects command line parsing [although there are workarounds, see John's post above].
          Last edited by maubp; 10-26-2010, 12:52 AM. Reason: Correction

          Comment

          Working...
          X