@@ -131,35 +131,38 @@ task MultiomeLabelTransfer {
131131 # Ensure GEX h5ad has 'star_IsCell' column and ATAC h5ad has 'gex_barcodes'
132132 # column (both required by the script). If missing, add sensible defaults.
133133 python3 -c "
134- import scanpy as sc
135- import snapatac2 as snap
134+ import anndata as ad
136135import os
137136
138137# Patch GEX: add star_IsCell if missing (makes the cell filter a no-op)
139138gex_path = '$GEX_FILE '
140139if not gex_path.startswith('gs://') and os.path.exists(gex_path):
141- gex = sc .read_h5ad(gex_path)
140+ gex = ad .read_h5ad(gex_path)
142141 if 'star_IsCell' not in gex.obs.columns:
143142 print('Adding missing star_IsCell column (all True) to GEX h5ad')
144143 gex.obs['star_IsCell'] = True
145- gex.write (gex_path)
144+ gex.write_h5ad (gex_path)
146145 print('Patched GEX h5ad saved')
147146 else:
148147 print('star_IsCell column already present')
149148
150149# Patch ATAC: add gex_barcodes if missing (uses existing obs index as barcodes)
151150atac_path = '$ATAC_FILE '
152151if not atac_path.startswith('gs://') and os.path.exists(atac_path):
153- atac = snap.read (atac_path, backed=None )
152+ atac = ad.read_h5ad (atac_path)
154153 if 'gex_barcodes' not in atac.obs.columns:
155154 print('Adding missing gex_barcodes column (copy of obs index) to ATAC h5ad')
156155 atac.obs['gex_barcodes'] = atac.obs.index
157- atac.write (atac_path)
156+ atac.write_h5ad (atac_path)
158157 print('Patched ATAC h5ad saved')
159158 else:
160159 print('gex_barcodes column already present')
161160"
162161
162+ # Symlink the gene annotation file to the working directory
163+ # (the script uses a relative path to find it)
164+ ln -sf /usr/local/gencode.v41.basic.annotation.gff3.gz .
165+
163166 python3 /usr/local/multiome_label_transfer.py \
164167 --gex-file "$GEX_FILE " \
165168 --atac-file "$ATAC_FILE " \
0 commit comments