A minimal project for loading and filtering gene expression data using Python and Pixi.
Install Pixi from pixi.sh, then run:
pixi installLoad and filter the gene expression dataset using a codebook:
pixi run python load_data.py ./originals/reference/DevVIS_p13_subset.csv ./originals/reference/codebook_73g_ctx.txtOptionally specify an output path:
pixi run python load_data.py ./originals/reference/DevVIS_p13_subset.csv ./originals/reference/codebook_73g_ctx.txt -o ./output/filtered_genes.csvcsv_file: Path to the reference gene expression CSV file (required)codebook_file: Path to the codebook file containing gene names to keep (required)-o, --output: Path to save the filtered dataframe. Defaults tofiltered_genes.csvin the CSV file's directory (optional)
This will:
- Load gene expression data from the CSV file
- Extract gene names from the codebook file (first column before tab character)
- Filter the dataframe to keep only genes listed in the codebook
- Reorder genes to match the codebook order
- Display the number of genes loaded, filtered shape, and data preview
- Save the filtered data to the specified output path (or default location)
Run the automated script:
bash run.sh