caokai1073 / uniPort

a unified single-cell data integration framework by optimal transport
MIT License
30 stars 3 forks source link

Error in batch_scale when the cell number can be divided by chunk_size #5

Open AprilYuge opened 1 year ago

AprilYuge commented 1 year ago

I encountered errors saying 'ValueError: Found array with 0 sample(s) (shape=(0, 2000)) while a minimum of 1 is required by MaxAbsScaler.' when my cell number can be divided by the default chunk_size. I think line 185 in function.py should be changed from 'for i in range(len(idx)//chunk_size+1):' to 'for i in range(int(np.ceil(len(idx)/chunk_size))):'.

caokai1073 commented 1 year ago

Thanks for pointing this out! I'll check and correct it.