Skip to content

Issues with preprocessing: cell_type #1

@ncborcherding

Description

@ncborcherding

Dear Dr. Song,

First off - very exciting approach and really nice system.

I saw your preprint the other day and was interested in applying it to some of the example data that you link to for nanostring. I am running into an issue during preprocessing. At first, I struggled with trying to identify the file 'matched_annotation_all.csv' from the nanostring data download. I believe this is now "X_metadata_file.csv" file for the FOV based on the calling of headers in the processing code. However, I can't seem to find the variable cell_type anywhere.

Example of my outputs:

Loading the meta data

anno = pd.read_csv(annor)
anno_f1 = anno[anno['fov'] == int(fov)]
anno_f1.columns

Index(['fov', 'Area', 'AspectRatio', 'CenterX_local_px', 'CenterY_local_px',
'CenterX_global_px', 'CenterY_global_px', 'Width', 'Height',
'Mean.MembraneStain', 'Max.MembraneStain', 'Mean.PanCK', 'Max.PanCK',
'Mean.CD45', 'Max.CD45', 'Mean.CD3', 'Max.CD3', 'Mean.DAPI',
'Max.DAPI'],
dtype='object')

1.8 get center of each cell

for i, row in anno_f1.iterrows():
    cx, cy = float(anno_f1['CenterX_local_px'][i]), float(anno_f1['CenterY_local_px'][i])
    anno_f1['CenterY_local_px'][i] = float(anno_f1['Height'][i]) - float(anno_f1['CenterY_local_px'][i])
    if cx - w < 0 or cx + w > width or cy - h < 0 or cy + h > height:
        anno_f1['cell_type'][i] = np.nan

KeyError: 'cell_type'

Am I using the correct file for the anno object? Or how/where is the cell_type variable generated?

Thanks,
Nick

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions