data2intelligence / SpaCET

Spatial Cellular Estimator for Tumors
GNU General Public License v3.0
42 stars 4 forks source link

Error in create.SpaCET.object.10X #4

Open maki8080 opened 1 year ago

maki8080 commented 1 year ago

Hi, I specified the standard output folder of the 10x SpaCET Ranger (with the "filtered_feature_bc_matrix" and "spatial" folders) in visiumPath. As with the dataset in the tutorial, The "filtered_feature_bc_matrix" folder includes "barcodes.tsv.gz", "features.tsv.gz", and"matrix.mtx.gz".

The "spatial" folder includes “tissue_positions_list.csv” , “tissue_lowres_image.png”, and “scalefactors_json.json”

Then, I ran "create.SpaCET.object.10X", but the following error returned.

visiumPath <- file.path("C23_spacet") SpaCET_obj <- SpaCET::create.SpaCET.object.10X(visiumPath = visiumPath) Error in .rowNamesDF<-(x, value = value) : duplicate 'row.names' are not allowed In addition: Warning message: non-unique values when setting 'row.names': ‘0x0’, ‘0x1’, ‘0x10’, ‘0x11’, ‘0x12’, ‘0x13’, ‘0x14’, ‘0x15’, ‘0x16’, ‘0x17’, ‘0x18’, ‘0x19’, ‘0x2’, ‘0x20’, ‘0x21’, ‘0x22’, ‘0x23’, ‘0x24’, ‘0x25’, ‘0x26’, ‘0x27’, ‘0x28’, ‘0x29’, ‘0x3’, ‘0x30’, ‘0x31’, ‘0x32’, ‘0x33’, ‘0x34’, ‘0x35’, ‘0x36’, ‘0x37’, ‘0x38’, ‘0x39’, ‘0x4’, ‘0x40’, ‘0x41’, ‘0x42’, ‘0x43’, ‘0x44’, ‘0x45’, ‘0x46’, ‘0x47’, ‘0x48’, ‘0x49’, ‘0x5’, ‘0x50’, ‘0x51’, ‘0x52’, ‘0x53’, ‘0x54’, ‘0x55’, ‘0x56’, ‘0x57’, ‘0x58’, ‘0x59’, ‘0x6’, ‘0x60’, ‘0x61’, ‘0x62’, ‘0x63’, ‘0x64’, ‘0x65’, ‘0x66’, ‘0x67’, ‘0x68’, ‘0x69’, ‘0x7’, ‘0x70’, ‘0x71’, ‘0x72’, ‘0x73’, ‘0x74’, ‘0x75’, ‘0x76’, ‘0x77’, ‘0x8’, ‘0x9’, ‘1x10’, ‘1x11’, ‘1x1 [... truncated]

I would appreciate it if you could tell me how to fix this problem.

Best regards, Maki

beibeiru commented 1 year ago

Hi, Maki,

This is so weird. Would you please deposit your data (i.e., filtered_feature_bc_matrix and spatial folders) in the following link.

Best, Beibei

maki8080 commented 1 year ago

Hi, Beibei,

Thank you for your reply. I noticed that my "issue_positions_list.csv" is partly different from the data in turorial and that the column names are not specified.

It worked by specifying the barcode column as the column name. Thanks for your kindness.

Best, Maki

d-muenter commented 1 year ago

Hi Beibei,

thanks for this great tool!

Just a few additional comments regarding a similar issue:

  1. In my case, the "tissue_positions_list.csv" in the Space Ranger output was just called "tissue_positions.csv" which produced an error. This was fixable by renaming the file, but maybe worth including this naming scheme in future versions
  2. After fixing this, createSpaCET.object.10X() still produced the following error:

Error in barcode[, "pxl_row_in_fullres"] * jsonFile$tissue_lowres_scalef : non-numeric argument to binary operator

After reading Maki's comments, I noticed that in my case the "tissue_positions_list.csv" did have column names while the respective file from the 10X breast cancer example data did not have column names. Deleting this first row of column names from my file made createSpaCET.object.10X() run without producing any errors.

Best regards, Daniel

beibeiru commented 1 year ago

Hi, Daniel,

Thanks a lot for your comments.

I notice that there are several tiny changes in the output of the latest Space Ranger (version 2.0).

  1. "tissue_positions_list.csv" -> "tissue_positions.csv"
  2. add column names in "tissue_positions.csv"

I have fixed it in the SpaCET, which is able to read both the old and new output of Space Ranger automatically.

Thanks.

Best, Beibei