bullkpy#

.. py:module:: bullkpy

BULLKpy: a Scanpy-inspired toolkit for bulk RNA-seq analysis in Python.

This project is inspired by Scanpy (BSD 3-Clause) and reuses some design patterns (settings/logging/plotting style) with attribution in source headers where applicable.

.. py:function:: read_counts(filename, *, sep=’\t’, orientation=’genes_by_samples’, dtype=’int64’) :module: bullkpy

Read a bulk RNA-seq count matrix and return an AnnData object.

:Parameters: * filename – Path to counts file (tsv/csv). Rows or columns must be gene IDs. * sep – Column separator (default: tab). * orientation

              - "genes_by_samples": genes in rows, samples in columns (common output of HTSeq, featureCounts)
              - "samples_by_genes": samples in rows, genes in columns
            * **dtype** -- Cast count matrix to dtype (default: int64). Set to None to disable casting.

:returns: AnnData – AnnData object with samples in .obs and genes in .var.

.. py:function:: add_metadata(adata, metadata_file, *, index_col, sep=’\t’, low_memory=False, how=’left’) :module: bullkpy

Add sample metadata to an AnnData object.

:Parameters: * adata – AnnData object with samples in .obs. * metadata_file – Path to metadata file (tsv, csv, or xlsx). * index_col – Column in metadata that matches adata.obs_names. * sep – Column separator for tsv/csv files. * low_memory – Pandas low_memory parameter * how – Merge strategy: - “left”: keep all samples in adata (default) - “inner”: keep only samples present in metadata

:returns: AnnData – The same AnnData object with updated .obs.

.. py:function:: info(msg) :module: bullkpy

Log an info-level message.

.. py:function:: warn(msg) :module: bullkpy

Log a warning-level message.

.. py:function:: debug(msg) :module: bullkpy

Log a debug-level message.

.. py:function:: error(msg) :module: bullkpy

Log an error-level message.