annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/lib/python3.8/site-packages/pybedtools/cbedtools.pxd @ 68:5028fdace37b

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 16:23:26 -0400
parents
children
rev   line source
jpayne@68 1 from cpython cimport bool
jpayne@68 2 from libcpp.vector cimport vector
jpayne@68 3 from libcpp.string cimport string
jpayne@68 4 from cython.operator cimport dereference as deref
jpayne@68 5
jpayne@68 6
jpayne@68 7
jpayne@68 8
jpayne@68 9
jpayne@68 10
jpayne@68 11 """
jpayne@68 12 Create Cython definitions for the Interval API defined in Interval.h
jpayne@68 13 """
jpayne@68 14 cdef extern from "bedFile.h":
jpayne@68 15 cdef enum BedLineStatus:
jpayne@68 16 BED_MALFORMED = -2
jpayne@68 17 BED_INVALID = -1
jpayne@68 18 BED_HEADER = 0
jpayne@68 19 BED_BLANK = 1
jpayne@68 20 BED_VALID = 2
jpayne@68 21
jpayne@68 22 ctypedef unsigned int CHRPOS
jpayne@68 23 ctypedef bint BOOL
jpayne@68 24
jpayne@68 25 cdef cppclass BED:
jpayne@68 26 string chrom
jpayne@68 27 CHRPOS start
jpayne@68 28 CHRPOS end
jpayne@68 29 string name
jpayne@68 30 string score
jpayne@68 31 string strand
jpayne@68 32 CHRPOS o_start # the start of an overlap with another interval
jpayne@68 33 CHRPOS o_end # the end of an overlap with another interval
jpayne@68 34 unsigned short bedType
jpayne@68 35 string file_type
jpayne@68 36 BedLineStatus status
jpayne@68 37 vector[string] fields
jpayne@68 38
jpayne@68 39 # constructors
jpayne@68 40 BED()
jpayne@68 41 BED(string chrom, CHRPOS start, CHRPOS end, string name,
jpayne@68 42 string score, string strand, vector[string] fields,
jpayne@68 43 CHRPOS o_start, CHRPOS o_end,
jpayne@68 44 unsigned short bedType, string file_type, BedLineStatus status)
jpayne@68 45
jpayne@68 46 BED(string chrom, CHRPOS start, CHRPOS end)
jpayne@68 47 BED(string chrom, CHRPOS start, CHRPOS end, string strand)
jpayne@68 48 BED(string chrom, CHRPOS start, CHRPOS end, string name,
jpayne@68 49 string score, string strand, vector[string] fields)
jpayne@68 50
jpayne@68 51 # methods
jpayne@68 52 string reportBed()
jpayne@68 53
jpayne@68 54
jpayne@68 55 cdef cppclass BedFile:
jpayne@68 56 BedFile(string)
jpayne@68 57 int Open()
jpayne@68 58 void Rewind()
jpayne@68 59 void Seek(unsigned long offset)
jpayne@68 60 void Close()
jpayne@68 61 BED GetNextBed()
jpayne@68 62 void loadBedFileIntoMap()
jpayne@68 63
jpayne@68 64 ### "all" ###
jpayne@68 65 # this version doesn't care if the strands match.
jpayne@68 66 vector[BED] FindOverlapsPerBin(BED bed, float overlapFraction)
jpayne@68 67 # if forceStrand is true, require that the strands match,
jpayne@68 68 vector[BED] FindOverlapsPerBin(BED bed, bool forceStrand, float overlapFraction)
jpayne@68 69
jpayne@68 70 ### "any" ###
jpayne@68 71 int FindAnyOverlapsPerBin(BED bed, float overlapFraction)
jpayne@68 72 # if forceStrand is true, require that the strands match,
jpayne@68 73 int FindAnyOverlapsPerBin(BED bed, bool forceStrand, float overlapFraction)
jpayne@68 74
jpayne@68 75
jpayne@68 76 ### "count" ###
jpayne@68 77 int CountOverlapsPerBin(BED bed, float overlapFraction)
jpayne@68 78 # if forceStrand is true, require that the strands match,
jpayne@68 79 int CountOverlapsPerBin(BED bed, bool forceStrand, float overlapFraction)
jpayne@68 80 string file_type
jpayne@68 81 bint _typeIsKnown
jpayne@68 82
jpayne@68 83
jpayne@68 84 cdef class Interval:
jpayne@68 85 cdef BED *_bed
jpayne@68 86 cdef object _attrs
jpayne@68 87 cpdef append(Interval self, object value)
jpayne@68 88 cpdef deparse_attrs(Interval self)