| 1 |
import os |
| 2 |
import sysconfig |
| 3 |
|
| 4 |
from pysam.libchtslib import * |
| 5 |
import pysam.libchtslib as libchtslib |
| 6 |
from pysam.libcsamtools import * |
| 7 |
from pysam.libcbcftools import * |
| 8 |
from pysam.libcutils import * |
| 9 |
import pysam.libcutils as libcutils |
| 10 |
import pysam.libcfaidx as libcfaidx |
| 11 |
from pysam.libcfaidx import * |
| 12 |
import pysam.libctabix as libctabix |
| 13 |
from pysam.libctabix import * |
| 14 |
import pysam.libctabixproxies as libctabixproxies |
| 15 |
from pysam.libctabixproxies import * |
| 16 |
import pysam.libcsamfile as libcsamfile |
| 17 |
from pysam.libcsamfile import * |
| 18 |
import pysam.libcalignmentfile as libcalignmentfile |
| 19 |
from pysam.libcalignmentfile import * |
| 20 |
import pysam.libcalignedsegment as libcalignedsegment |
| 21 |
from pysam.libcalignedsegment import * |
| 22 |
import pysam.libcvcf as libcvcf |
| 23 |
from pysam.libcvcf import * |
| 24 |
import pysam.libcbcf as libcbcf |
| 25 |
from pysam.libcbcf import * |
| 26 |
import pysam.libcbgzf as libcbgzf |
| 27 |
from pysam.libcbgzf import * |
| 28 |
from pysam.utils import SamtoolsError |
| 29 |
import pysam.Pileup as Pileup |
| 30 |
from pysam.samtools import * |
| 31 |
import pysam.config |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
__all__ = ( |
| 36 |
libchtslib.__all__ + |
| 37 |
libcutils.__all__ + |
| 38 |
libctabix.__all__ + |
| 39 |
libcvcf.__all__ + |
| 40 |
libcbcf.__all__ + |
| 41 |
libcbgzf.__all__ + |
| 42 |
libcfaidx.__all__ + |
| 43 |
libctabixproxies.__all__ + |
| 44 |
libcalignmentfile.__all__ + |
| 45 |
libcalignedsegment.__all__ + |
| 46 |
libcsamfile.__all__ + |
| 47 |
["SamtoolsError"] + |
| 48 |
["Pileup"] |
| 49 |
) |
| 50 |
from pysam.version import __version__, __samtools_version__ |
| 51 |
|
| 52 |
|
| 53 |
def get_include(): |
| 54 |
'''return a list of include directories.''' |
| 55 |
dirname = os.path.abspath(os.path.join(os.path.dirname(__file__))) |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
htslib_possibilities = [os.path.join(dirname, '..', 'htslib'), |
| 64 |
os.path.join(dirname, 'include', 'htslib')] |
| 65 |
samtool_possibilities = [os.path.join(dirname, '..', 'samtools'), |
| 66 |
os.path.join(dirname, 'include', 'samtools')] |
| 67 |
|
| 68 |
includes = [dirname] |
| 69 |
for header_locations in [htslib_possibilities, samtool_possibilities]: |
| 70 |
for header_location in header_locations: |
| 71 |
if os.path.exists(header_location): |
| 72 |
includes.append(os.path.abspath(header_location)) |
| 73 |
break |
| 74 |
|
| 75 |
return includes |
| 76 |
|
| 77 |
|
| 78 |
def get_defines(): |
| 79 |
'''return a list of defined compilation parameters.''' |
| 80 |
|
| 81 |
|
| 82 |
return [] |
| 83 |
|
| 84 |
|
| 85 |
def get_libraries(): |
| 86 |
'''return a list of libraries to link against.''' |
| 87 |
|
| 88 |
|
| 89 |
dirname = os.path.abspath(os.path.join(os.path.dirname(__file__))) |
| 90 |
pysam_libs = ['libctabixproxies', |
| 91 |
'libcfaidx', |
| 92 |
'libcsamfile', |
| 93 |
'libcvcf', |
| 94 |
'libcbcf', |
| 95 |
'libctabix'] |
| 96 |
if pysam.config.HTSLIB == "builtin": |
| 97 |
pysam_libs.append('libchtslib') |
| 98 |
|
| 99 |
so = sysconfig.get_config_var('EXT_SUFFIX') |
| 100 |
return [os.path.join(dirname, x + so) for x in pysam_libs] |