{"id":21543,"library":"loompy","title":"loompy","description":"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.","status":"active","version":"3.0.8","language":"python","source_language":"en","source_url":"https://github.com/linnarsson-lab/loompy","tags":["loom","single-cell","RNA-seq","bioinformatics","hdf5"],"install":[{"cmd":"pip install loompy","lang":"bash","label":"Install loompy"}],"dependencies":[],"imports":[{"note":"LoomFile is not a top-level class; use loompy.connect() or loompy.create()","wrong":"from loompy import LoomFile","symbol":"loompy","correct":"import loompy"},{"note":"connect is a function, not a module; import the package and use it as attribute","wrong":"from loompy import connect","symbol":"connect","correct":"import loompy; ds = loompy.connect('file.loom')"}],"quickstart":{"code":"import loompy\nimport numpy as np\n# Create a minimal loom file\nrow_attrs = {'Gene': ['A', 'B']}\ncol_attrs = {'CellID': ['cell1', 'cell2']}\nmatrix = np.array([[1, 2], [3, 4]], dtype='float32')\nloompy.create('test.loom', matrix, row_attrs, col_attrs)\n# Read it back\fts = loompy.connect('test.loom')\nprint(fts.shape)\nfts.close()","lang":"python","description":"Create a Loom file with a small matrix and read it back."},"warnings":[{"fix":"Migrate from LoomFile('file.loom', 'r') to loompy.connect('file.loom'), and from creating with LoomFile('file.loom', 'w') to loompy.create().","message":"loompy 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.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use mode='r+' to read/write without truncation, or check file existence beforehand.","message":"When opening a Loom file in write mode using connect() with mode='w', the file is overwritten. Ensure you have a backup.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace with loompy.connect() for reading/writing and loompy.create() for creating new files.","message":"Some older API methods like loompy.LoomFile and loompy.File are deprecated in 3.0.x and may be removed in future versions.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install with pip install loompy","cause":"loompy is not installed.","error":"ModuleNotFoundError: No module named 'loompy'"},{"fix":"Use loompy.connect() to open files and loompy.create() to create them.","cause":"Using the deprecated LoomFile class which was removed in version 3.0.0.","error":"AttributeError: module 'loompy' has no attribute 'LoomFile'"},{"fix":"Check that the file path is correct and the file exists.","cause":"Trying to read a file that does not exist.","error":"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)"},{"fix":"Ensure that the number of rows in the matrix equals the length of row attribute values, and columns equal length of column attributes.","cause":"The dimensions of the matrix do not match the number of row attributes.","error":"ValueError: Shape mismatch. Matrix has shape (100, 200) but row_attrs has length 50"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}