BiocFrame
This package implements a lite weight data frame like class (comparable to Pandas DataFrame) but supports more flexible column types, e.g: nested columns.
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.15
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.15.tar.gz | 27.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| BiocFrame-0.2.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.6 kB
Release files / BiocFrame-0.2.15.tar.gz
| Download URL | BiocFrame-0.2.15.tar.gz |
|---|---|
| Size | 27.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0611723ad14887acab1e453799c054055afac814776ffda0d1c110e3d1cb4a4
|
|
BLAKE2b-256 checksum How to use checksums |
a8459c88bbc3ca850dd3ee9776913233755756b2f0c20f5a59fdc01b51bb3946
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|
Release files / BiocFrame-0.2.15-py3-none-any.whl
| Download URL | BiocFrame-0.2.15-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e86682a9362a101807289fc8371af4b28c0787972b3eb8cf7449b9f0fb0a3c24
|
|
BLAKE2b-256 checksum How to use checksums |
814d1353750905558b731fa8a9d3763181a0c29557016acb8ff7152152661912
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.17
|