CostaLab / CrossTalkeR

R package to do the Ligand Receptor Analysis Visualization
https://costalab.github.io/CrossTalkeR/
MIT License
41 stars 10 forks source link

Error in final code "Error in parse(text = x, srcfile = src) : attempt to use zero-length variable name" #35

Closed dengay closed 2 years ago

dengay commented 3 years ago

Hi. I shouldn't have closed the last session. Sorry. I am new to github and to reporting issues. I have successfully run your code before and obtained 2 htmls (as well as 3 rds files). This time, the code seems to run well until the end and I cannot figure out what I am doing wrong and more importantly, where to look. I realize that it probably is some spelling or backtick problem?, but I cannot catch it. I am using identical code to whatever worked before. I have tried changing backticks, starting R and Rstudio again, reinstalling crosstalker and rerunning code to arrive at filtered_corrected.csvs. I also engaged 'knitr' just in case. I am using R 4.1.0, Rstudio 1.4.1 on a macbook pro OS 11.4

I will add that everything runs fine with report=FALSE but error persists with genes=NA, report=TRUE

I'm sorry for such a trivial problem but, as before, any help would be much appreciated.

I have attached a sample of the final code with error:

paths <- c('CTR' = '~/Desktop/s1_filtered_corrected.csv',

  • 'EXP' = '~/Desktop/s2_filtered_corrected.csv') genes1 <- c('TGFB1', 'FGFR2', 'TNF') data <- generate_report(paths,
  • genes=genes1,
  • out_path='~/Desktop/',
  • threshold = 0,
  • out_file='All_DG.html') Reading Files CTR "~/Desktop/soft_filtered_corrected.csv" EXP "~/Desktop/stiff_filtered_corrected.csv" Create a Differential Table Calculating CCI Ranking EXP_x_CTR

Calculating GCI Ranking EXP_x_CTR Annotating the top Cell Genes 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns 'select()' returned 1:many mapping between keys and columns Defining templates Generating Report Preparing Single Phenotype Report Printing CCI CTR Printing CCI EXP

Table PCA CGI CTR_ggi

Quitting from lines 5-26 (./Single_Condition_cgi.Rmd)

PCA CGI

Here, a Principal Component Analysis (PCA) was done using the cell-gene interaction topological measures.High ranked observations (>=2$\sigma^{2}$) are labeled and each measure contribution is placed in the coordinate system

PCA Tables

Quitting from lines NA-46 (./Single_Condition_cgi.Rmd) Quitting from lines NA-46 (./Single_Condition_cgi.Rmd) Error in parse(text = x, srcfile = src) : attempt to use zero-length variable name In addition: Warning messages: 1: In eattrs[[name]][index] <- value : number of items to replace is not a multiple of replacement length 2: Removed 281 rows containing missing values (geom_label_repel). 3: Removed 291 rows containing missing values (geom_label_repel).

dengay commented 3 years ago

Hi. I see that I have the LRObj which contains the single analyses but am lacking a way to do the integrated analysis. Is there any code I can run using this obj to generate the final files? Are there any additional packages I may not have turned on to run the original code? Thanks

jsnagai commented 3 years ago

@dengay Many thanks for your question. Could you try to set genes to NULL instead of NA. We also have a development version which is close to be released. You can find it: https://github.com/CostaLab/CrossTalkeR/tree/devel. If you use this, please be aware that the input have changed. And, there a python notebook to cast the old version input to the new one.

Best

dengay commented 3 years ago

Hi. Many thanks for this response. I had tried genes=NULL, just sloppy in response. Let me try your new code and I will get back. I feel that I am just missing some small detail. Very frustrating! Thanks for this. Best