Skip to content
This repository was archived by the owner on Mar 31, 2022. It is now read-only.

Commit 4b58bf6

Browse files
committed
- Fix: broken assertion (#110).
- Fix: ome2histocat stripps .tiff file ending from masks (#111).
1 parent e546bd3 commit 4b58bf6

10 files changed

Lines changed: 315 additions & 366 deletions

File tree

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
docs-folder: docs/
2525
build-command: make html
26-
pre-build-command: python -m pip install --upgrade pip && pip install poetry==1.1.5 && poetry config virtualenvs.create false && poetry install
26+
pre-build-command: python -m pip install --upgrade pip && pip install poetry==1.1.6 && poetry config virtualenvs.create false && poetry install
2727
- name: Commit documentation changes
2828
run: |
2929
cp -r docs/build/html/* gh-pages/

.github/workflows/test_and_deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install dependencies
3232
run: |
3333
python -m pip install --upgrade pip
34-
pip install poetry==1.1.5
34+
pip install poetry==1.1.6
3535
poetry install
3636
env:
3737
POETRY_VIRTUALENVS_CREATE: false
@@ -55,7 +55,7 @@ jobs:
5555
- name: Install dependencies
5656
run: |
5757
python -m pip install --upgrade pip
58-
pip install poetry==1.1.5
58+
pip install poetry==1.1.6
5959
poetry install --no-dev
6060
env:
6161
POETRY_VIRTUALENVS_CREATE: false

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.1.7] - 2021-05-21
9+
- Fix: broken assertion (#110).
10+
- Fix: ome2histocat stripps .tiff file ending from masks (#111).
11+
812
## [2.1.6] - 2021-03-16
913
- Allows `mcdfolder_to_imcfolder` to convert data from sub-folders in zip file.
1014

docs/source/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Version 1.x documentation (deprecated): https://imctools.readthedocs.io
2929

3030
Preferable way to install `imctools` is via official PyPI registry. Please define package version explicitly in order to avoid incompatibilities between v1.x and v2.x versions:
3131
```
32-
pip install imctools==2.1.4
32+
pip install imctools==2.1.7
3333
```
3434
In old IMC segmentation pipelines versions 1.x should be used!
3535
```

imctools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
__author__ = """Vito Zanotelli, Anton Rau"""
88
__email__ = "vito.zanotelli@uzh.ch, anton.rau@uzh.ch"
9-
__version__ = "2.1.6"
9+
__version__ = "2.1.7"

imctools/converters/mcdfolder2imcfolder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ def mcdfolder_to_imcfolder(
7575
tic = timeit.default_timer()
7676

7777
mcdfolder_to_imcfolder(
78-
# Path("/home/anton/Downloads/20170905_Fluidigmworkshopfinal_SEAJa.zip"),
78+
Path("/home/anton/Data/ImcSegmentationPipelineV2/20191202_HuBMAP_LympNode_ED.zip"),
7979
# "/home/anton/Downloads/20170905_Fluidigmworkshopfinal_SEAJa",
8080
# "/home/anton/Data/forAnton_MCD/6505_Lympho",
81-
"/home/anton/Downloads/IMMUcan_Batch20201113_10042702-GU-VAR-TIS-01-IMC-01.zip",
81+
# "/home/anton/Downloads/IMMUcan_Batch20201113_10042702-GU-VAR-TIS-01-IMC-01.zip",
8282
# "/home/anton/Documents/merrick/IMC/20200904_MS_XRF_epithelial_panel_4_titration.zip",
8383
# "/home/anton/Documents/IMC Workshop 2019/Data/iMC_workshop_2019/20190919_FluidigmBrCa_SE",
8484
# "/home/anton/Downloads/test",

imctools/converters/ome2analysis.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ def get_metals_from_panel(
3434

3535
if panel_csv_file is not None:
3636

37-
pannel = pd.read_csv(panel_csv_file)
38-
if pannel.shape[1] > 1:
39-
selected = pannel[usedcolumn]
40-
assert selected.any() == 0 or selected.any() == 1, f"Values in 'usedcolumn' column should contain only 0/1"
41-
metals = [str(n) for s, n in zip(selected, pannel[metalcolumn]) if s]
37+
panel = pd.read_csv(panel_csv_file)
38+
if panel.shape[1] > 1:
39+
selected = panel[usedcolumn]
40+
assert selected.isin((0, 1)).all(), f"Values in 'usedcolumn' column should contain only 0/1"
41+
metals = panel.loc[selected == 1, metalcolumn].tolist()
4242
else:
43-
metals = [pannel.columns[0]] + pannel.iloc[:, 0].tolist()
43+
metals = [panel.columns[0]] + panel.iloc[:, 0].tolist()
4444

4545
if sort_channels:
4646
if metals is not None:
@@ -187,9 +187,9 @@ def omefolder_to_analysisfolder(
187187
# )
188188

189189
omefolder_to_analysisfolder(
190-
"/home/anton/Downloads/imc_folder",
190+
"/home/anton/Downloads/imc_folder_v2",
191191
"/home/anton/Downloads/analysis_folder",
192-
"/home/anton/Downloads/example_panel.csv",
192+
"/home/anton/Data/ImcSegmentationPipelineV2/hubmap_processed_v2/panel.csv",
193193
[("ilastik", "_ilastik", True), ("full", "_full", False)],
194194
metalcolumn="Metal Tag",
195195
)

imctools/converters/ome2histocat.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ def omefile_to_histocatfolder(
6868
if mask_file is not None:
6969
if isinstance(mask_file, str):
7070
mask_file = Path(mask_file)
71-
fn_mask_base = mask_file.stem
72-
fn_mask_new = output_folder / fn_mask_base
73-
shutil.copy2(mask_file, fn_mask_new)
71+
shutil.copy2(mask_file, output_folder)
7472

7573

7674
def omefolder_to_histocatfolder(
@@ -127,8 +125,9 @@ def omefolder_to_histocatfolder(
127125
tic = timeit.default_timer()
128126

129127
omefolder_to_histocatfolder(
130-
Path("/home/anton/Downloads/imc_folder/20170905_Fluidigmworkshopfinal_SEAJa"),
128+
Path("/home/anton/Downloads/imc_folder_v2/20191203_HuBMAP_LN"),
131129
Path("/home/anton/Downloads/tiff_folder"),
130+
mask_folder="/home/anton/Data/ImcSegmentationPipelineV2/hubmap_processed_v2/masks",
132131
)
133132

134133
print(timeit.default_timer() - tic)

0 commit comments

Comments
 (0)