| 1 |
from __future__ import absolute_import |
| 2 |
|
| 3 |
from pysam.libchtslib cimport bam1_t, bam_endpos |
| 4 |
from pysam.libcsamfile cimport aux_type2size |
| 5 |
from pysam.libcalignedsegment cimport AlignedSegment |
| 6 |
|
| 7 |
import pysam |
| 8 |
|
| 9 |
|
| 10 |
cpdef build_read(): |
| 11 |
cdef AlignedSegment read = pysam.AlignedSegment() |
| 12 |
read.query_name = "hello" |
| 13 |
read.query_sequence = "ACGT" |
| 14 |
read.reference_start = 10 |
| 15 |
read.cigarstring = "4M" |
| 16 |
|
| 17 |
# Test calling htslib function |
| 18 |
cdef bam1_t *calign = read._delegate |
| 19 |
print(bam_endpos(calign)) |
| 20 |
|
| 21 |
# Test calling pysam htslib_util function |
| 22 |
print(aux_type2size(12)) |
| 23 |
|
| 24 |
return read |