Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

128 lignes
2.6 KiB

  1. from libc.stdint cimport int8_t, int16_t, int32_t, int64_t
  2. from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t
  3. from libc.stdlib cimport malloc, calloc, realloc, free
  4. from libc.string cimport memcpy, memcmp, strncpy, strlen, strdup
  5. from libc.stdio cimport FILE, printf
  6. # Note: this replaces python "open"!
  7. cdef extern from "fcntl.h":
  8. int open(char *pathname, int flags)
  9. cdef extern from "unistd.h" nogil:
  10. ctypedef int ssize_t
  11. ssize_t read(int fd, void *buf, size_t count)
  12. int close(int fd)
  13. from pysam.libchtslib cimport hts_idx_t, hts_itr_t, htsFile, \
  14. tbx_t, kstring_t, BGZF, HTSFile
  15. # These functions are put here and not in chtslib.pxd in order
  16. # to avoid warnings for unused functions.
  17. cdef extern from "pysam_stream.h" nogil:
  18. ctypedef struct kstream_t:
  19. pass
  20. ctypedef struct kseq_t:
  21. kstring_t name
  22. kstring_t comment
  23. kstring_t seq
  24. kstring_t qual
  25. kseq_t *kseq_init(BGZF *)
  26. int kseq_read(kseq_t *)
  27. void kseq_destroy(kseq_t *)
  28. kstream_t *ks_init(BGZF *)
  29. void ks_destroy(kstream_t *)
  30. # Retrieve characters from stream until delimiter
  31. # is reached placing results in str.
  32. int ks_getuntil(kstream_t *,
  33. int delimiter,
  34. kstring_t * str,
  35. int * dret)
  36. cdef class tabix_file_iterator:
  37. cdef BGZF * fh
  38. cdef kstream_t * kstream
  39. cdef kstring_t buffer
  40. cdef size_t size
  41. cdef Parser parser
  42. cdef int fd
  43. cdef int duplicated_fd
  44. cdef infile
  45. cdef __cnext__(self)
  46. cdef class TabixFile(HTSFile):
  47. # pointer to index structure
  48. cdef tbx_t * index
  49. cdef readonly object filename_index
  50. cdef Parser parser
  51. cdef encoding
  52. cdef class Parser:
  53. cdef encoding
  54. cdef parse(self, char * buffer, int len)
  55. cdef class asTuple(Parser):
  56. cdef parse(self, char * buffer, int len)
  57. cdef class asGTF(Parser):
  58. pass
  59. cdef class asGFF3(Parser):
  60. pass
  61. cdef class asBed(Parser):
  62. pass
  63. cdef class asVCF(Parser):
  64. pass
  65. cdef class TabixIterator:
  66. cdef hts_itr_t * iterator
  67. cdef TabixFile tabixfile
  68. cdef kstring_t buffer
  69. cdef encoding
  70. cdef int __cnext__(self)
  71. cdef class TabixIteratorParsed(TabixIterator):
  72. cdef Parser parser
  73. cdef class GZIterator:
  74. cdef object _filename
  75. cdef BGZF * gzipfile
  76. cdef kstream_t * kstream
  77. cdef kstring_t buffer
  78. cdef int __cnext__(self)
  79. cdef encoding
  80. cdef class GZIteratorHead(GZIterator):
  81. pass
  82. cdef class GZIteratorParsed(GZIterator):
  83. cdef Parser parser
  84. # Compatibility Layer for pysam < 0.8
  85. cdef class Tabixfile(TabixFile):
  86. pass