jpayne@68: # cython: language_level=3 jpayne@68: from pysam.libcalignmentfile cimport AlignedSegment, AlignmentFile jpayne@68: jpayne@68: ################################################# jpayne@68: # Compatibility Layer for pysam < 0.8 jpayne@68: jpayne@68: # import all declarations from htslib jpayne@68: from pysam.libchtslib cimport * jpayne@68: jpayne@68: cdef class AlignedRead(AlignedSegment): jpayne@68: pass jpayne@68: jpayne@68: cdef class Samfile(AlignmentFile): jpayne@68: pass jpayne@68: jpayne@68: # import the conversion functions jpayne@68: cdef extern from "htslib_util.h": jpayne@68: jpayne@68: # add *nbytes* into the variable length data of *src* at *pos* jpayne@68: bam1_t * pysam_bam_update(bam1_t * b, jpayne@68: size_t nbytes_old, jpayne@68: size_t nbytes_new, jpayne@68: uint8_t * pos) jpayne@68: jpayne@68: # now: static jpayne@68: int aux_type2size(int) jpayne@68: jpayne@68: char * pysam_bam_get_qname(bam1_t * b) jpayne@68: uint32_t * pysam_bam_get_cigar(bam1_t * b) jpayne@68: uint8_t * pysam_bam_get_seq(bam1_t * b) jpayne@68: uint8_t * pysam_bam_get_qual(bam1_t * b) jpayne@68: uint8_t * pysam_bam_get_aux(bam1_t * b) jpayne@68: int pysam_bam_get_l_aux(bam1_t * b) jpayne@68: char pysam_bam_seqi(uint8_t * s, int i) jpayne@68: jpayne@68: uint16_t pysam_get_bin(bam1_t * b) jpayne@68: uint8_t pysam_get_qual(bam1_t * b) jpayne@68: uint8_t pysam_get_l_qname(bam1_t * b) jpayne@68: uint16_t pysam_get_flag(bam1_t * b) jpayne@68: uint32_t pysam_get_n_cigar(bam1_t * b) jpayne@68: void pysam_set_bin(bam1_t * b, uint16_t v) jpayne@68: void pysam_set_qual(bam1_t * b, uint8_t v) jpayne@68: void pysam_set_l_qname(bam1_t * b, uint8_t v) jpayne@68: void pysam_set_flag(bam1_t * b, uint16_t v) jpayne@68: void pysam_set_n_cigar(bam1_t * b, uint32_t v) jpayne@68: void pysam_update_flag(bam1_t * b, uint16_t v, uint16_t flag)