BiocFrame
BiocFrame provides a base BiocFrame class, intended to be a flexible data structure compared to Pandas DataFrame This would be interoperable with pandas but will support usecases in genomics.
Install
Package is published to PyPI
pip install biocframe
Usage
Lets create a BiocFrame from a dictionary
from biocframe import BiocFrame
bframe = BiocFrame(
data = {
"seqnames": [
"chr1",
"chr2",
"chr2",
"chr2",
"chr1",
"chr1",
"chr3",
"chr3",
"chr3",
"chr3",
]
* 20,
"starts": range(100, 300),
"ends": range(110, 310),
"strand": ["-", "+", "+", "*", "*", "+", "+", "+", "-", "-"] * 20,
"score": range(0, 200),
"GC": [random() for _ in range(10)] * 20,
}
)
Access Properties
Accessor methods/properties are available to access column names, row names and dims.
# find the dimensions
print(bframe.dims)
# get the column names
print(bframe.columnNames)
Setters
Using the Pythonic way to set properties
# set new column names
bframe.columnNames = [... new colnames ...]
print(bframe.columnNames)
# add or reassign columns
bframe["score"] = range(200, 400)
Slice the BiocFrame
Currently slicing is only supported by indices or names (column names or row names). A future version may implement pandas query like operations.
sliced_bframe = bframe[3:7, 2:5]
For more use cases including subset, checkout the documentation
Note
This project has been set up using PyScaffold 4.3. For details and usage information on PyScaffold see https://pyscaffold.org/.
Release files for biocframe 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| BiocFrame-0.2.4.tar.gz | 25.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| BiocFrame-0.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.5 kB
Release files / BiocFrame-0.2.4.tar.gz
| Download URL | BiocFrame-0.2.4.tar.gz |
|---|---|
| Size | 25.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9dfede39ded24b59b07c52198a2e8fd39aa72dd44a59072a058375c7753e52ce
|
|
BLAKE2b-256 checksum How to use checksums |
41a26c1420837c1ffb49c4d433ad92b8747e0f2623decc3af4e751fbca0dbf52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / BiocFrame-0.2.4-py3-none-any.whl
| Download URL | BiocFrame-0.2.4-py3-none-any.whl |
|---|---|
| Size | 8.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e32dd00662dd160645ecd346d8911193e442170055769761b1f4ec928986259
|
|
BLAKE2b-256 checksum How to use checksums |
bd0b000d91b09d2fe7b11ddefb60635606eb7ab2a1b2ab10eb496b6202e821bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|