Closed anglixue closed 1 year ago
Yep - if you use the new code in the readme, the error will be fixed. The error occured because there is a new item in list_markers
containing the new timing information Hsiao-Chi made. The new code will seperate this out.
These function have been run without errors using the new code.
> list_markers_time
$citeFuse
[1] "CD45RO-TotalSeqB" "CD45RA-TotalSeqB" "CD3-TotalSeqB" "CD4-TotalSeqB"
[5] "CD14-TotalSeqB" "CD127-TotalSeqB" "CD56-TotalSeqB" "TIGIT-TotalSeqB"
[9] "CD16-TotalSeqB" "CD19-TotalSeqB" "CD8a-TotalSeqB" "CD25-TotalSeqB"
[13] "PD-1-TotalSeqB" "CD15-TotalSeqB" "IgG1-control-TotalSeqB"
$sc2marker
[1] "IgG2b-control-TotalSeqB" "PD-1-TotalSeqB" "TIGIT-TotalSeqB" "CD127-TotalSeqB"
[5] "IgG1-control-TotalSeqB" "CD14-TotalSeqB" "CD25-TotalSeqB" "IgG2a-control-TotalSeqB"
[9] "CD19-TotalSeqB" "CD56-TotalSeqB" "CD4-TotalSeqB"
$geneBasis
[1] "CD8a-TotalSeqB" "CD16-TotalSeqB" "CD4-TotalSeqB" "CD19-TotalSeqB" "CD56-TotalSeqB" "PD-1-TotalSeqB"
[7] "CD25-TotalSeqB" NA NA NA NA NA
[13] NA NA NA
$xgBoost
[1] "CD14-TotalSeqB" "CD45RO-TotalSeqB" "CD3-TotalSeqB" "CD19-TotalSeqB"
[5] "CD4-TotalSeqB" "CD56-TotalSeqB" "CD45RA-TotalSeqB" "CD127-TotalSeqB"
[9] "CD16-TotalSeqB" "TIGIT-TotalSeqB" "CD25-TotalSeqB" "CD8a-TotalSeqB"
[13] "PD-1-TotalSeqB" "CD15-TotalSeqB" "IgG2b-control-TotalSeqB"
$consensus
[1] "CD19-TotalSeqB" "CD25-TotalSeqB" "CD4-TotalSeqB" "CD56-TotalSeqB"
[5] "PD-1-TotalSeqB" "CD127-TotalSeqB" "CD14-TotalSeqB" "CD16-TotalSeqB"
[9] "CD8a-TotalSeqB" "TIGIT-TotalSeqB" "CD15-TotalSeqB" "CD3-TotalSeqB"
[13] "CD45RA-TotalSeqB" "CD45RO-TotalSeqB" "IgG1-control-TotalSeqB"
$runtime_secs
citeFuse sc2marker geneBasis xgBoost
5.095403 4.500375 1.762664 5.292093
and the performance
> list_performance
$citeFuse
$citeFuse$xgBoost_performance
cluster TP
1 5 0.5555556
2 11 0.0000000
3 3 0.8333333
4 7 0.7142857
5 1 1.0000000
6 2 0.9411765
7 6 0.8750000
8 10 0.7500000
9 4 0.5454545
10 8 0.6666667
11 9 0.5000000
$citeFuse$geneBasis_performance
cluster TP
1 5 0.2222222
2 11 0.0000000
3 3 0.7500000
4 7 0.4285714
5 1 1.0000000
6 2 0.8823529
7 6 0.7500000
8 10 0.0000000
9 4 0.3636364
10 8 0.3333333
11 9 0.0000000
$sc2marker
$sc2marker$xgBoost_performance
cluster TP
1 5 0.4444444
2 11 0.0000000
3 3 0.7500000
4 7 0.7142857
5 1 0.8571429
6 2 0.8823529
7 6 0.8750000
8 10 0.2500000
9 4 0.5454545
10 8 0.5000000
11 9 0.5000000
$sc2marker$geneBasis_performance
cluster TP
1 5 0.2222222
2 11 0.0000000
3 3 0.7500000
4 7 0.1428571
5 1 0.9523810
6 2 0.5882353
7 6 0.8750000
8 10 0.2500000
9 4 0.5454545
10 8 0.3333333
11 9 0.5000000
$geneBasis
$geneBasis$xgBoost_performance
cluster TP
1 5 0.6666667
2 11 0.0000000
3 3 0.8333333
4 7 0.7142857
5 1 0.7142857
6 2 0.7647059
7 6 0.8750000
8 10 0.0000000
9 4 0.3636364
10 8 0.5000000
11 9 0.0000000
$geneBasis$geneBasis_performance
cluster TP
1 5 0.2222222
2 11 0.0000000
3 3 0.6666667
4 7 0.2857143
5 1 0.7619048
6 2 0.5294118
7 6 1.0000000
8 10 0.0000000
9 4 0.4545455
10 8 0.0000000
11 9 0.0000000
$xgBoost
$xgBoost$xgBoost_performance
cluster TP
1 5 0.6666667
2 11 0.0000000
3 3 0.8333333
4 7 0.7142857
5 1 1.0000000
6 2 0.8823529
7 6 0.8750000
8 10 0.0000000
9 4 0.4545455
10 8 0.6666667
11 9 0.5000000
$xgBoost$geneBasis_performance
cluster TP
1 5 0.2222222
2 11 0.0000000
3 3 0.7500000
4 7 0.4285714
5 1 1.0000000
6 2 0.8823529
7 6 0.7500000
8 10 0.0000000
9 4 0.3636364
10 8 0.3333333
11 9 0.0000000
$consensus
$consensus$xgBoost_performance
cluster TP
1 5 0.5555556
2 11 0.0000000
3 3 0.8333333
4 7 0.7142857
5 1 1.0000000
6 2 1.0000000
7 6 0.8750000
8 10 0.5000000
9 4 0.5454545
10 8 0.6666667
11 9 0.5000000
$consensus$geneBasis_performance
cluster TP
1 5 0.2222222
2 11 0.0000000
3 3 0.7500000
4 7 0.4285714
5 1 1.0000000
6 2 0.8823529
7 6 0.7500000
8 10 0.0000000
9 4 0.3636364
10 8 0.3333333
11 9 0.0000000
But the plot functions are not due to the inconsistent number of the markers
> library(ggplot2)
> plotMarkers(list_markers)
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, :
arguments imply differing number of rows: 15, 11
> plotPerformance(list_performance)
Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
polygon edge not found
In addition: There were 12 warnings (use warnings() to see them)
Have you met this with other datasets? I also tried the built-in sce
object. The first plot function is fine but the second showed the same error
Thanks Angli - did you use the latest version of plotPerformance? I got the same error with a previous version, but it should've been fixed.
Essentially, the new code in plotPerformance
is:
`
for (i in seq(1,dim(performance_df)[2],2)){
curr_df = performance_df[,c(i,i+1)]
tempSplit = unlist(lapply(as.character(colnames(curr_df)),
function (x) strsplit(x,split="[.]")[[1]]))
colnames(curr_df) = c("Clusters","TP")
curr_df$marker_method=tempSplit[[1]]
curr_df$performance_method=gsub("_performance",
"",
tempSplit[[2]])
curr_df$TP
if (i==1){
performance_plot_df = curr_df
} else{
performance_plot_df = rbind(performance_plot_df,curr_df)
}
}
`
Hi Ray,
I used the latest version.
Which dataset did you test? Maybe it's because we used different datasets?
I tried the SCE example dataset (I think you mentioned you used this, but I might of misunderstood your message). I also tried the datasets Dhruti and Hsiao-Chi originally had trouble with. Do you mind letting me know which datasets caused the error, so I can reproduce it and try to fix it?
I had errors with both the SCE example dataset and the public dataset 4. Using the SCE example dataset I can do the first plot but not the second. Using public dataset 4 neither plot function is working.
Hi Ray, Could you share the two example plots in Dropbox? I'll have a look and find the root of the error from my end.
I changed the line 108 in the wrapperPlots.R
from
axis.text.x = element_text(angle=45,hjust=1,text_size),
to
axis.text.x = element_text(angle=45,hjust=1,size=text_size),
Then the error is fixed
I believe the element_text() function recognized the wrong flag for text_size
Awesome, thanks Angli!
I just made your change to main.
Hi Team, I've run the latest version and got an error at the final step of
performanceAllMarkers()
The error message goes
Error in .check_argument_correct(dots, "genes.selection", is.character, : Check genes.selection - should be character vector