|
From: Heng Li <lh...@sa...> - 2011-07-01 01:49:29
|
Sorry, I do not know enough about Windows. You may consider pysam.
Heng
On Jun 23, 2011, at 3:35 PM, Jake Christiansen wrote:
> When attempting to run tabix from a python program in eclipse ide, my program throws errors. Python version is 2.6, tabix version is 0.2.5, running on Windows 7. The errors thrown are as follows:
> File "C:\Users\jcc7\workspace\GeneZoom\src\genezoom.py", line 113, in main
> vcf = vcfReader( options.vcf_file )
> File "C:\Users\jcc7\workspace\GeneZoom\src\vcfutils.py", line 75, in __init__
> self._vcf = tabix.Tabix(filename)
> File "C:\Python26\lib\tabix.py", line 50, in __init__
> self.tabix = tabix_init();
> File "C:\Python26\lib\tabix.py", line 32, in tabix_init
> tabix = load_shared_library('tabix')
> File "C:\Python26\lib\tabix.py", line 22, in load_shared_library
> candidates = glob.glob(_path+'/lib'+lib+suf);
> UnboundLocalError: local variable 'suf' referenced before assignment
> Exception AttributeError: "Tabix instance has no attribute 'tabix'" in <bound method Tabix.__del__ of <tabix.Tabix instance at 0x034A91C0>> ignored
>
> genezoom.py is my own program, which attempts to define a vcfReader through vcfutils, by using tabix. But the error is within tabix itself, in the following code:
> def load_shared_library(lib, _path='.', ver='*'):
> """Search for and load the tabix library. The
> expectation is that the library is located in
> the current directory (ie. "./")
> """
> # find from the system path
> path = find_library(lib)
> if (path == None): # if fail, search in the custom directory
> s = platform.system()
> if (s == 'Darwin'): suf = ver+'.dylib'
> elif (s == 'Linux'): suf = '.so'+ver
> candidates = glob.glob(_path+'/lib'+lib+suf);
> if (len(candidates) == 1): path = candidates[0]
> else: return None
> cdll.LoadLibrary(path)
> return CDLL(path)
>
> The error thrown is due to the fact that I am running Windows 7, and not using a Darwin or Linux operating system, thus "suf" is never initialized. Is there a way to get this to work, or is there a link to a Windows-viable version (did I just accidentally download the Mac/Linux version instead of the Windows version)?
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2_______________________________________________
> Samtools-help mailing list
> Sam...@li...
> https://lists.sourceforge.net/lists/listinfo/samtools-help
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.
|