Skip to content

Commit

Permalink
chore: fixup stale docs
Browse files Browse the repository at this point in the history
  • Loading branch information
clintval committed Aug 1, 2024
1 parent 13b7834 commit 04382f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pybedlite/bed_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def bed_fields(self) -> List[str]:

@property
def refname(self) -> str:
"""A reference sequence name."""
"""The reference name of the interval described by the record."""
return self.chrom

Check warning on line 188 in pybedlite/bed_record.py

View check run for this annotation

Codecov / codecov/patch

pybedlite/bed_record.py#L188

Added line #L188 was not covered by tests

@property
Expand Down
22 changes: 13 additions & 9 deletions pybedlite/overlap_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,9 @@
from pybedlite.bed_source import BedSource


class GenomicSpan(Protocol):
class GenomicSpan(Hashable, Protocol):
"""
A genomic span which has protected methods that must be implemented by all subclasses to give
a zero-based open-ended genomic span.
A structural type for a span on a reference sequence with zero-based open-ended coordinates.
"""

@property
Expand All @@ -100,6 +99,11 @@ def end(self) -> int:


class StrandedGenomicSpan(GenomicSpan, Protocol):
"""
A structural type for a stranded span on a reference sequence with zero-based open-ended
coordinates.
"""

@property
def negative(self) -> bool:
"""True if the interval is on the negative strand, False otherwise"""
Expand Down Expand Up @@ -177,8 +181,8 @@ def from_bedrecord(cls: Type["Interval"], record: BedRecord) -> "Interval":

GenericGenomicSpan = TypeVar("GenericGenomicSpan", bound=Union[GenomicSpan, StrandedGenomicSpan])
"""
A generic genomic feature. This type variable is used for describing the
generic type contained within the :class:`~pybedlite.overlap_detector.OverlapDetector`.
A generic genomic span. This type variable is used for describing the generic type contained within
the :class:`~pybedlite.overlap_detector.OverlapDetector`.
"""


Expand All @@ -187,16 +191,16 @@ class OverlapDetector(Generic[GenericGenomicSpan], Iterable[GenericGenomicSpan])
The overlap detector may contain any interval-like Python objects that have the following
properties:
* `chrom` or `contig` or `refname`: The reference sequence name
* `refname`: The reference sequence name
* `start`: A 0-based start position
* `end`: A 0-based exclusive end position
Interval-like Python objects may also contain strandedness information which will be used
for sorting them in :func:`~pybedlite.overlap_detector.OverlapDetector.get_overlaps` using
either of the following properties if they are present:
the following property if it is present:
* `negative (bool)`: Whether or not the feature is negative stranded or not
* `strand (BedStrand)`: The BED strand of the feature
* `strand (str)`: The strand of the feature (`"-"` for negative)
The same interval may be added multiple times, but only a single instance will be returned
when querying for overlaps.
Expand Down

0 comments on commit 04382f2

Please sign in to comment.