Registry / data / loompy

loompy

JSON →
library3.0.8pypypi✓ verified 85d ago

A Python library for working with Loom file format (version 3.0.8), which is used for storing single-cell RNA-seq data. It supports reading, writing, and creating Loom files with sparse matrices, variable-length string attributes, and provides a command-line tool for creating Loom files from FASTQ. Release cadence is irregular.

pip install loompy
INSTALL
IMPORT
SIG · LOOMPY
L
loompy
datapythonv3.0.8
Install
12.2s avg
Import
5050ms
Disk
434MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 12.2s · import 5.050s · 429MB
434MB installed
● package 434MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

loompy
import loompy
from loompy import LoomFile
LoomFile is not a top-level class; use loompy.connect() or loompy.create()
connect
import loompy; ds = loompy.connect('file.loom')
from loompy import connect
connect is a function, not a module; import the package and use it as attribute

Create a Loom file with a small matrix and read it back.

import loompy import numpy as np # Create a minimal loom file row_attrs = {'Gene': ['A', 'B']} col_attrs = {'CellID': ['cell1', 'cell2']} matrix = np.array([[1, 2], [3, 4]], dtype='float32') loompy.create('test.loom', matrix, row_attrs, col_attrs) # Read it back ts = loompy.connect('test.loom') print(fts.shape) fts.close()
loom --version
Debug
Known issues
breakingloompy 3.0.0 introduced a major API overhaul: old classes like LoomFile are replaced with connect(), create(), etc. Code written for loompy 2.x will not run without modification.
fix
Migrate from LoomFile('file.loom', 'r') to loompy.connect('file.loom'), and from creating with LoomFile('file.loom', 'w') to loompy.create().
affects: >=3.0.0
gotchaWhen opening a Loom file in write mode using connect() with mode='w', the file is overwritten. Ensure you have a backup.
fix
Use mode='r+' to read/write without truncation, or check file existence beforehand.
affects: all
deprecatedSome older API methods like loompy.LoomFile and loompy.File are deprecated in 3.0.x and may be removed in future versions.
fix
Replace with loompy.connect() for reading/writing and loompy.create() for creating new files.
affects: >=3.0.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'loompy'
loompy is not installed.
fix
Install with pip install loompy
AttributeError: module 'loompy' has no attribute 'LoomFile'
Using the deprecated LoomFile class which was removed in version 3.0.0.
fix
Use loompy.connect() to open files and loompy.create() to create them.
OSError: Unable to open file (unable to open file: name = 'test.loom', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
Trying to read a file that does not exist.
fix
Check that the file path is correct and the file exists.
ValueError: Shape mismatch. Matrix has shape (100, 200) but row_attrs has length 50
The dimensions of the matrix do not match the number of row attributes.
fix
Ensure that the number of rows in the matrix equals the length of row attribute values, and columns equal length of column attributes.
Upgrade
Version history
3.0.8latest on PyPI · released Jan 10, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
loompy — pip install loompy · libregistry