BiocFrame
This package provides a data frame representation similar to a pandas DataFrame, with
support for nested column types.
Install
Package is published to PyPI
pip install biocframe
Usage
Lets create a BiocFrame from a dictionary
from random import random
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.column_names)
Setters
Using the Pythonic way to set properties
# set new column names
bframe.column_names = [..., new_column_names, ...]
print(bframe.column_names)
# 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.5. For details and usage information on PyScaffold see https://pyscaffold.org/.
Release files for biocframe 0.3.3
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.3.3.tar.gz | 30.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| BiocFrame-0.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.4 kB
Release files / BiocFrame-0.3.3.tar.gz
| Download URL | BiocFrame-0.3.3.tar.gz |
|---|---|
| Size | 30.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb7b629a20c4fa8541dc5f22eaf0671a525b8281d9e6b48c0c5b634c8283b36f
|
|
BLAKE2b-256 checksum How to use checksums |
d0de665120ca8928b4a8b6782cfb9465bdf179e37f5af8a8519f2f95bf4a4ca9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|
Release files / BiocFrame-0.3.3-py3-none-any.whl
| Download URL | BiocFrame-0.3.3-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e78e0b264dbae214620926921cf1de1dbf66295f4d24efd0490079c9747808a8
|
|
BLAKE2b-256 checksum How to use checksums |
3980d985f5d1762d137eb2f293c1c4b621b4d1d5d70ec0139c3e4b44460c0a50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.18
|