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