Skip to content

Commit 4448b1d

Browse files
committed
preprocessing to add star_IsCell
1 parent f25d108 commit 4448b1d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pipelines/wdl/scanvi/scANVI.wdl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,25 @@ task MultiomeLabelTransfer {
128128
LOCALIZE_FLAG="--localize"
129129
fi
130130
131+
# Ensure GEX h5ad has 'star_IsCell' column (required by the script).
132+
# If missing, add it with all True so the filter is a no-op.
133+
python3 -c "
134+
import scanpy as sc
135+
import os
136+
137+
gex_path = '$GEX_FILE'
138+
# Only patch local files (not GCS paths handled by --localize)
139+
if not gex_path.startswith('gs://') and os.path.exists(gex_path):
140+
adata = sc.read_h5ad(gex_path)
141+
if 'star_IsCell' not in adata.obs.columns:
142+
print('Adding missing star_IsCell column (all True) to GEX h5ad')
143+
adata.obs['star_IsCell'] = True
144+
adata.write(gex_path)
145+
print('Patched GEX h5ad saved')
146+
else:
147+
print('star_IsCell column already present')
148+
"
149+
131150
python3 /usr/local/multiome_label_transfer.py \
132151
--gex-file "$GEX_FILE" \
133152
--atac-file "$ATAC_FILE" \

0 commit comments

Comments
 (0)