coordmath
Methods for coordinate-based math and interval manipulation.¶
Contains the following public methods:
require_same_refname()-- ensures that all provided intervals have the same reference name.get_locus_string()-- returns a formatted string for an interval (<refname>:<start>-<end>).get_closed_end()-- gets the closed end of an interval given its start and length.
Functions¶
get_closed_end ¶
Get the closed end of an interval given its start and length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
start |
|
The start position of the interval. |
required |
length |
|
The length of the interval. |
required |
Returns:
| Type | Description |
|---|---|
|
The closed end of the interval. |
Example
get_closed_end(start=10, length=5) 14
Source code in prymer/api/coordmath.py
get_locus_string ¶
Get the locus-string for an interval.
The output string will have the format <refname>:<start>-<end>
No conversion on coordinates is performed, so the output is 0-based, open-ended.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record |
|
The interval to get the locus-string for. |
required |
Returns:
| Type | Description |
|---|---|
|
A locus-string for the interval. |
Source code in prymer/api/coordmath.py
require_same_refname ¶
Require that the input intervals all have the same refname.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intervals |
|
one or more intervals |
()
|
Raises:
| Type | Description |
|---|---|
|
if the intervals do not all have the same refname. |