Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pysam/libcalignedsegment.pxd @ 69:33d812a61356
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 17:55:14 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 69:33d812a61356 |
---|---|
1 # cython: language_level=3 | |
2 from pysam.libchtslib cimport * | |
3 | |
4 cdef extern from "htslib_util.h": | |
5 | |
6 # add *nbytes* into the variable length data of *src* at *pos* | |
7 bam1_t * pysam_bam_update(bam1_t * b, | |
8 size_t nbytes_old, | |
9 size_t nbytes_new, | |
10 uint8_t * pos) | |
11 | |
12 # now: static | |
13 int aux_type2size(int) | |
14 | |
15 char * pysam_bam_get_qname(bam1_t * b) | |
16 uint32_t * pysam_bam_get_cigar(bam1_t * b) | |
17 uint8_t * pysam_bam_get_seq(bam1_t * b) | |
18 uint8_t * pysam_bam_get_qual(bam1_t * b) | |
19 uint8_t * pysam_bam_get_aux(bam1_t * b) | |
20 int pysam_bam_get_l_aux(bam1_t * b) | |
21 char pysam_bam_seqi(uint8_t * s, int i) | |
22 | |
23 uint8_t pysam_get_qual(bam1_t * b) | |
24 uint32_t pysam_get_n_cigar(bam1_t * b) | |
25 void pysam_set_qual(bam1_t * b, uint8_t v) | |
26 void pysam_set_n_cigar(bam1_t * b, uint32_t v) | |
27 void pysam_update_flag(bam1_t * b, uint16_t v, uint16_t flag) | |
28 | |
29 | |
30 from pysam.libcalignmentfile cimport AlignmentFile, AlignmentHeader | |
31 ctypedef AlignmentFile AlignmentFile_t | |
32 | |
33 | |
34 # Note: need to declare all C fields and methods here | |
35 cdef class AlignedSegment: | |
36 | |
37 # object that this AlignedSegment represents | |
38 cdef bam1_t * _delegate | |
39 | |
40 # the header that a read is associated with | |
41 cdef readonly AlignmentHeader header | |
42 | |
43 # caching of array properties for quick access | |
44 cdef object cache_query_qualities | |
45 cdef object cache_query_alignment_qualities | |
46 cdef object cache_query_sequence | |
47 cdef object cache_query_alignment_sequence | |
48 | |
49 # add an alignment tag with value to the AlignedSegment | |
50 # an existing tag of the same name will be replaced. | |
51 cpdef set_tag(self, tag, value, value_type=?, replace=?) | |
52 | |
53 # get an alignment tag from the AlignedSegment | |
54 cpdef get_tag(self, tag, with_value_type=?) | |
55 | |
56 # return true if tag exists | |
57 cpdef has_tag(self, tag) | |
58 | |
59 # returns a valid sam alignment string | |
60 cpdef to_string(self) | |
61 | |
62 # returns a valid sam alignment string (deprecated) | |
63 cpdef tostring(self, htsfile=*) | |
64 | |
65 | |
66 cdef class PileupColumn: | |
67 cdef const bam_pileup1_t ** plp | |
68 cdef int tid | |
69 cdef int pos | |
70 cdef int n_pu | |
71 cdef AlignmentHeader header | |
72 cdef uint32_t min_base_quality | |
73 cdef kstring_t buf | |
74 cdef char * reference_sequence | |
75 | |
76 cdef class PileupRead: | |
77 cdef int32_t _qpos | |
78 cdef AlignedSegment _alignment | |
79 cdef int _indel | |
80 cdef int _level | |
81 cdef uint32_t _is_del | |
82 cdef uint32_t _is_head | |
83 cdef uint32_t _is_tail | |
84 cdef uint32_t _is_refskip | |
85 | |
86 # factory methods | |
87 cdef AlignedSegment makeAlignedSegment( | |
88 bam1_t * src, | |
89 AlignmentHeader header) | |
90 | |
91 cdef PileupColumn makePileupColumn( | |
92 const bam_pileup1_t ** plp, | |
93 int tid, | |
94 int pos, | |
95 int n_pu, | |
96 uint32_t min_base_quality, | |
97 char * reference_sequence, | |
98 AlignmentHeader header) | |
99 | |
100 cdef PileupRead makePileupRead(const bam_pileup1_t * src, | |
101 AlignmentHeader header) | |
102 | |
103 cdef uint32_t get_alignment_length(bam1_t * src) |