iCellR icon indicating copy to clipboard operation
iCellR copied to clipboard

'replacement has 1 row, data has 0' when creating iCellR object

Open lucas-bishop opened this issue 2 years ago • 3 comments

after reading in the all_contig_anotations.csv file as a data frame and trying to use the prep.vdj( ) function on that output, exactly the same as in the tutorial, I get this error (which seems to be related to the prep.vdj function):

my.vdj <- prep.vdj(vdj.data = my.vdj, cond.name = "NULL") Error in $<-.data.frame(tmp, "total.colonotype", value = 0L) : replacement has 1 row, data has 0

lucas-bishop avatar Jul 14 '21 03:07 lucas-bishop

@lucas-bishop Check how R is interpretting your "all_contig_anotations.csv" file, specifically the "productive" column. The formula for prep.vdj, F0039.R, includes a subset on line 22 that only keeps data if the value in the "productive" column is "True". However, when I investigated my "all_contig_anotations.csv" in RStudio, I found it was importing values in that columns as "true", "false" - the case of the first letter wasn't matching. So prep.vdj was subseting out all my data because technically R reads "True" as not equal to "true".

If that's your issue, this code worked for me

my.vdj$productive[my.vdj$productive == "true"] <- "True" My.VDJ <- prep.vdj(my.vdj)

frazzette avatar Aug 16 '21 03:08 frazzette

@frazzette If I recall correctly I think I hacked together some code to coerce the "productive" column - similar to what you've done here. Thank you for the suggestion!

lucas-bishop avatar Aug 16 '21 15:08 lucas-bishop

Hi guys,

I am a bit busy but soon will look into this. But for now, I think it's important to know that the vdj analysis is mostly about plotting the clonotypes to spot them in UMAP, tSNE or KNetL. You can do this manually (outside of iCellR) too. Get the X and Y axes from the UMAP (in the umap.data slot) and plot the cells of interest in red and rest of the cells in gray for any clonotype. Hope this helps for now but once I have more time I will fix those functions and look into them.

Reza

rezakj avatar Aug 16 '21 16:08 rezakj