Skip to content

Commit

Permalink
Update documentation to reflect manual copying of directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-l-kong committed Dec 16, 2024
1 parent 97e1070 commit 4fd18fb
Showing 1 changed file with 37 additions and 20 deletions.
57 changes: 37 additions & 20 deletions templates/maldi-pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@
"\n",
"### 1.1. File paths\n",
"\n",
"The following variables are defined pointing to paths in your MALDI run.\n",
"The following variables are defined pointing to paths in your MALDI run. **Only `base_dir` should be changed, the other folders should maintain the existing names and subdirectory structure.**\n",
"\n",
"* `base_dir`: the path to your MALDI data. **Change this to match your run location**.\n",
"* `library_dir`: the path inside `base_dir` to your `\"libraries\"` folder. This will contain the master list to use for glycan matching.\n",
"* `extraction_dir`: the path inside `base_dir` to your `\"extracted\"` folder. Contains the integrated images for each filtered peak and glycan-matched peak across the slide.\n",
"* `debug_dir`: the path inside `base_dir` to your `\"debug\"` folder. Individual peak height and width info is saved here for debugging purposes.\n",
"* `imzml_dir`: the path inside `base_dir` to your `\"imzml\"` folder. This will contain the `\".imzml\"` and `\".ibd\"` files extracted from SCiLS.\n",
"* `imzml_file`: the name of the `imzml` file saved inside the `imzml_dir`. **Change this to match your imzml file name**.\n",
"* `imzml_path`: the full path to the `imzml_file`"
"* `base_dir`: the path to your MALDI data.\n",
"* `imzml_dir`: the path inside `base_dir` to your `imzml` folder. This will contain the `.imzml` and `.ibd` files extracted from SCiLS.\n",
"* `library_dir`: the path inside `base_dir` to your `libraries` folder. This will contain the master list to use for glycan matching.\n",
"* `extraction_dir`: the path inside `base_dir` to your `extracted` folder. Contains the integrated images for each filtered peak and glycan-matched peak across the slide.\n",
"* `debug_dir`: the path inside `base_dir` to your `debug` folder. Individual peak height and width info is saved here for debugging purposes."
]
},
{
Expand All @@ -70,13 +68,10 @@
"outputs": [],
"source": [
"base_dir = pathlib.Path(\"../data/panc2055\")\n",
"library_dir = base_dir / \"libraries\"\n",
"extraction_dir = base_dir / data_name / \"extracted\"\n",
"debug_dir = base_dir / data_name / \"debug\"\n",
"\n",
"imzml_dir = base_dir / \"imzml\"\n",
"imzml_file = \"panc2055.imzML\"\n",
"imzml_path = imzml_dir / data_file"
"library_dir = base_dir / \"libraries\"\n",
"extraction_dir = base_dir / \"output\" / \"extracted\"\n",
"debug_dir = base_dir / \"output\" / \"debug\""
]
},
{
Expand All @@ -95,11 +90,35 @@
"outputs": [],
"source": [
"# Create directories\n",
"for directory in [base_dir, library_dir, extraction_dir, debug_dir]:\n",
"for directory in [base_dir, imzml_dir, library_dir, extraction_dir, debug_dir]:\n",
" if not os.path.exists(directory):\n",
" directory.mkdir(parents=True, exist_ok=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**NOTE: At this point, ensure you have the following files in your folders in the following locations:**\n",
"\n",
"* .imzml/.ibd files: extracted using SCiLS. **Either explicitly point to the `imzml` subfolder when extracting, or manually copy these files to the `imzml` subfolder afterwards.**\n",
"* Master glycan list: defining a singular master glycan list is a WIP. For now, ask a lab member for the peak list to use. **This file must be manually copied into the `\"libraries\"` subfolder.**\n",
"\n",
"And define the following variable:\n",
"\n",
"* `imzml_file`: the name of the `.imzml` file in the `imzml` subfolder."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"imzml_file = \"panc2055.imzml\"\n",
"imzml_path = imzml_file / imzml_path"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -170,7 +189,7 @@
"outputs": [],
"source": [
"# define the .imzml/.ibd loader object\n",
"imz_data = ImzMLParser(data_path, include_spectra_metadata=\"full\")\n",
"imz_data = ImzMLParser(imzml_path, include_spectra_metadata=\"full\")\n",
"\n",
"# extract the spectra and threshold array\n",
"total_mass_df, thresholds = extraction.extract_spectra(\n",
Expand Down Expand Up @@ -222,9 +241,7 @@
"source": [
"### 2.2. Master library peaks\n",
"\n",
"Load the master glycan peak list, this will be used by the library matching process.\n",
"\n",
"**NOTE: Defining a singular master glycan peaklist is a WIP. For now, ask a lab member for the peak list to use. This file must be manually copied into the `\"libraries\"` subfolder.**"
"Load the master glycan peak list, this will be used by the library matching process."
]
},
{
Expand Down Expand Up @@ -661,7 +678,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.10"
"version": "3.11.9"
},
"vscode": {
"interpreter": {
Expand Down

0 comments on commit 4fd18fb

Please sign in to comment.