Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 

104 Zeilen
2.9 KiB

  1. from pysam.libchtslib cimport *
  2. cdef extern from "htslib_util.h":
  3. # add *nbytes* into the variable length data of *src* at *pos*
  4. bam1_t * pysam_bam_update(bam1_t * b,
  5. size_t nbytes_old,
  6. size_t nbytes_new,
  7. uint8_t * pos)
  8. # now: static
  9. int aux_type2size(int)
  10. char * pysam_bam_get_qname(bam1_t * b)
  11. uint32_t * pysam_bam_get_cigar(bam1_t * b)
  12. uint8_t * pysam_bam_get_seq(bam1_t * b)
  13. uint8_t * pysam_bam_get_qual(bam1_t * b)
  14. uint8_t * pysam_bam_get_aux(bam1_t * b)
  15. int pysam_bam_get_l_aux(bam1_t * b)
  16. char pysam_bam_seqi(uint8_t * s, int i)
  17. uint8_t pysam_get_qual(bam1_t * b)
  18. uint32_t pysam_get_n_cigar(bam1_t * b)
  19. void pysam_set_qual(bam1_t * b, uint8_t v)
  20. void pysam_set_n_cigar(bam1_t * b, uint32_t v)
  21. void pysam_update_flag(bam1_t * b, uint16_t v, uint16_t flag)
  22. from pysam.libcalignmentfile cimport AlignmentFile, AlignmentHeader
  23. ctypedef AlignmentFile AlignmentFile_t
  24. # Note: need to declare all C fields and methods here
  25. cdef class AlignedSegment:
  26. # object that this AlignedSegment represents
  27. cdef bam1_t * _delegate
  28. # the header that a read is associated with
  29. cdef readonly AlignmentHeader header
  30. # caching of array properties for quick access
  31. cdef object cache_query_qualities
  32. cdef object cache_query_alignment_qualities
  33. cdef object cache_query_sequence
  34. cdef object cache_query_alignment_sequence
  35. # add an alignment tag with value to the AlignedSegment
  36. # an existing tag of the same name will be replaced.
  37. cpdef set_tag(self, tag, value, value_type=?, replace=?)
  38. # add an alignment tag with value to the AlignedSegment
  39. # an existing tag of the same name will be replaced.
  40. cpdef get_tag(self, tag, with_value_type=?)
  41. # return true if tag exists
  42. cpdef has_tag(self, tag)
  43. # returns a valid sam alignment string
  44. cpdef to_string(self)
  45. # returns a valid sam alignment string (deprecated)
  46. cpdef tostring(self, htsfile=*)
  47. cdef class PileupColumn:
  48. cdef const bam_pileup1_t ** plp
  49. cdef int tid
  50. cdef int pos
  51. cdef int n_pu
  52. cdef AlignmentHeader header
  53. cdef uint32_t min_base_quality
  54. cdef kstring_t buf
  55. cdef char * reference_sequence
  56. cdef class PileupRead:
  57. cdef int32_t _qpos
  58. cdef AlignedSegment _alignment
  59. cdef int _indel
  60. cdef int _level
  61. cdef uint32_t _is_del
  62. cdef uint32_t _is_head
  63. cdef uint32_t _is_tail
  64. cdef uint32_t _is_refskip
  65. # factory methods
  66. cdef AlignedSegment makeAlignedSegment(
  67. bam1_t * src,
  68. AlignmentHeader header)
  69. cdef PileupColumn makePileupColumn(
  70. const bam_pileup1_t ** plp,
  71. int tid,
  72. int pos,
  73. int n_pu,
  74. uint32_t min_base_quality,
  75. char * reference_sequence,
  76. AlignmentHeader header)
  77. cdef PileupRead makePileupRead(const bam_pileup1_t * src,
  78. AlignmentHeader header)
  79. cdef uint32_t get_alignment_length(bam1_t * src)