QihuangZhang / CeLEry

CeLEry: cell location recovery in single-cell RNA sequencing
MIT License
26 stars 3 forks source link

A mistake in code paper notebooks #5

Open mossishahi opened 7 months ago

mossishahi commented 7 months ago

On the provided notebook here for the training of CeLEry on MERFISH data of Mouse brain, in 7'th and 8'th cells, when you take left brain as training and right brain as testing, you have passed Qdata as both training and test data. Is it a mistake? Moreover, can you please explain this scnipt of the code in 6'th cell that how you predict coords for test data from the coordinates of training data?

data_train = Qdata.copy()
traindata = (data_train.X.A if issparse(data_train.X) else data_train.X)
tdatax = np.expand_dims(traindata, axis = 0)
tdata_rs = np.swapaxes(tdatax, 1, 2)
test_cord = cel.wrap_gene_location(tdata_rs, data_train.obs[['x_cord', 'y_cord']])

I was also wondering to ask about this line of the code in the above-mentioned notebook: pred_cord[:,0] = 1-pred_cord[:,0] I cannot get the point behind this line.

thanks

QihuangZhang commented 7 months ago

It is because we are using the left brain as training and the right brain as testing. In that way, the direct predicted locations are still in the space of left brain. And in order to map the predicted locations to the righthand space, we need to add pred_cord[:,0] = 1-pred_cord[:,0].