You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

101 lines
3.2 KiB

  1. import os
  2. import sys
  3. import sysconfig
  4. from pysam.libchtslib import *
  5. from pysam.libcsamtools import *
  6. from pysam.libcbcftools import *
  7. from pysam.libcutils import *
  8. import pysam.libcutils as libcutils
  9. import pysam.libcfaidx as libcfaidx
  10. from pysam.libcfaidx import *
  11. import pysam.libctabix as libctabix
  12. from pysam.libctabix import *
  13. import pysam.libctabixproxies as libctabixproxies
  14. from pysam.libctabixproxies import *
  15. import pysam.libcsamfile as libcsamfile
  16. from pysam.libcsamfile import *
  17. import pysam.libcalignmentfile as libcalignmentfile
  18. from pysam.libcalignmentfile import *
  19. import pysam.libcalignedsegment as libcalignedsegment
  20. from pysam.libcalignedsegment import *
  21. import pysam.libcvcf as libcvcf
  22. from pysam.libcvcf import *
  23. import pysam.libcbcf as libcbcf
  24. from pysam.libcbcf import *
  25. import pysam.libcbgzf as libcbgzf
  26. from pysam.libcbgzf import *
  27. from pysam.utils import SamtoolsError
  28. import pysam.Pileup as Pileup
  29. from pysam.samtools import *
  30. import pysam.config
  31. # export all the symbols from separate modules
  32. __all__ = \
  33. libchtslib.__all__ +\
  34. libcutils.__all__ +\
  35. libctabix.__all__ +\
  36. libcvcf.__all__ +\
  37. libcbcf.__all__ +\
  38. libcbgzf.__all__ +\
  39. libcfaidx.__all__ +\
  40. libctabixproxies.__all__ +\
  41. libcalignmentfile.__all__ +\
  42. libcalignedsegment.__all__ +\
  43. libcsamfile.__all__ +\
  44. ["SamtoolsError"] +\
  45. ["Pileup"]
  46. from pysam.version import __version__, __samtools_version__
  47. def get_include():
  48. '''return a list of include directories.'''
  49. dirname = os.path.abspath(os.path.join(os.path.dirname(__file__)))
  50. #
  51. # Header files may be stored in different relative locations
  52. # depending on installation mode (e.g., `python setup.py install`,
  53. # `python setup.py develop`. The first entry in each list is
  54. # where develop-mode headers can be found.
  55. #
  56. htslib_possibilities = [os.path.join(dirname, '..', 'htslib'),
  57. os.path.join(dirname, 'include', 'htslib')]
  58. samtool_possibilities = [os.path.join(dirname, '..', 'samtools'),
  59. os.path.join(dirname, 'include', 'samtools')]
  60. includes = [dirname]
  61. for header_locations in [htslib_possibilities, samtool_possibilities]:
  62. for header_location in header_locations:
  63. if os.path.exists(header_location):
  64. includes.append(os.path.abspath(header_location))
  65. break
  66. return includes
  67. def get_defines():
  68. '''return a list of defined compilation parameters.'''
  69. # ('_FILE_OFFSET_BITS', '64'),
  70. # ('_USE_KNETFILE', '')]
  71. return []
  72. def get_libraries():
  73. '''return a list of libraries to link against.'''
  74. # Note that this list does not include libcsamtools.so as there are
  75. # numerous name conflicts with libchtslib.so.
  76. dirname = os.path.abspath(os.path.join(os.path.dirname(__file__)))
  77. pysam_libs = ['libctabixproxies',
  78. 'libcfaidx',
  79. 'libcsamfile',
  80. 'libcvcf',
  81. 'libcbcf',
  82. 'libctabix']
  83. if pysam.config.HTSLIB == "builtin":
  84. pysam_libs.append('libchtslib')
  85. so = sysconfig.get_config_var('SO')
  86. return [os.path.join(dirname, x + so) for x in pysam_libs]