ZJUFanLab / bulk2space

a spatial deconvolution method based on deep learning frameworks, which converts bulk transcriptomes into spatially resolved single-cell expression profiles
GNU General Public License v3.0
110 stars 23 forks source link

model.train_df_and_spatial_deconvolution error #10

Closed zhangqi234 closed 1 year ago

zhangqi234 commented 1 year ago

Hi, thanks for coming up with this useful tool. When I conducted the model.train_df_and_spatial_deconvolution function to decompose ST data into spatially resolved single-cell transcriptomics data, I found the error like "pandas.errors.MergeError: No common columns to perform merge on. Merge options: left_on=None, right_on=None, left_index=False, right_index=False". I don't know what caused this error.

1668324980352

AlexUOM commented 1 year ago

Hi, I am also experiencing an error with the model.train_df_and_spatial_deconvolution function. In my case the error is ValueError: no types given as you can see below: Immagine 2022-11-13 132113

I am running the pdac tutorial with all the pre-provided data. Hope you can help with this.

ForwardYang98 commented 1 year ago

Hi, thanks for coming up with this useful tool. When I conducted the model.train_df_and_spatial_deconvolution function to decompose ST data into spatially resolved single-cell transcriptomics data, I found the error like "pandas.errors.MergeError: No common columns to perform merge on. Merge options: left_on=None, right_on=None, left_index=False, right_index=False". I don't know what caused this error.

1668324980352

Hi, it seems there are some errors in your data format. You could refer to the Tutorial Handbook to check the format of input again.

ForwardYang98 commented 1 year ago

ValueError: no types given

Hi, I have run the PDAC tutorial successfully again just now. I guess there are some errors in the format of your data, maybe you could check it by following the Tutorial Handbook

AlexUOM commented 1 year ago

Hi, I have run the PDAC tutorial successfully again just now. I guess there are some errors in the format of your data, maybe you could check it by following the Tutorial Handbook

Thank you for your feedback. I double checked again the format of the data as you adviced and everything is looking fine.

Here is a quick look of how the 4 input files for model.train_df_and_spatial_deconvolution look like (using .head()) generate_sc_data: Immagine 2022-11-14 103118

generate_sc_meta: Immagine 2022-11-14 103118

st_data.csv: Immagine 2022-11-14 103118

st_meta.csv: Immagine 2022-11-14 103118

Is this what they are supposed to look like? I suspect the files that throw the error are the st reference files (either st_meta or st_data, not sure which one).

ForwardYang98 commented 1 year ago

Hi, I have run the PDAC tutorial successfully again just now. I guess there are some errors in the format of your data, maybe you could check it by following the Tutorial Handbook

Thank you for your feedback. I double checked again the format of the data as you adviced and everything is looking fine.

Here is a quick look of how the 4 input files for model.train_df_and_spatial_deconvolution look like (using .head()) generate_sc_data: Immagine 2022-11-14 103118

generate_sc_meta: Immagine 2022-11-14 103118

st_data.csv: Immagine 2022-11-14 103118

st_meta.csv: Immagine 2022-11-14 103118

Is this what they are supposed to look like? I suspect the files that throw the error are the st reference files (either st_meta or st_data, not sure which one).

According to the screenshots you provided, the column number of st_data (428 columns) is not same as the row number of st_meta (429 rows). The spots in st_data and st_meta are supposed to be same for Bulk2Space, as shown below: st_data.shape (19104, 428) st_meta.shape (428, 3)

AlexUOM commented 1 year ago

The number of rows and columns in the files is different you are correct. To resume, st_meta has 428 rows x 4 columns: Immagine 2022-11-14 155021

...while st_data has 19104 rows x 429 columns : Immagine 2022-11-14 155137

The reason why st_data has an extra column is because it counts the first column (without a name) that contains the gene names. Could this be the reason of the error?

ForwardYang98 commented 1 year ago

The number of rows and columns in the files is different you are correct. To resume, st_meta has 428 rows x 4 columns: Immagine 2022-11-14 155021

...while st_data has 19104 rows x 429 columns : Immagine 2022-11-14 155137

The reason why st_data has an extra column is because it counts the first column (without a name) that contains the gene names. Could this be the reason of the error?

Yes. You could set the first column (gene names) as the index and then try it again.