Question about define subpopulations of aneuploid tumor cells

Open
#82 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
r

Research direction

Start with the supplied R plotting snippet, focusing on the legend(...) call and the treecut_number <- 4 workflow, then reproduce the reported error. Done means the legend behavior is explained and the issue is resolved or the required usage is documented for defining these subpopulations.

Written by the indexing model from the issue text.

Description

I have tried to define subpopulations of aneuploid tumor cells by changing the parameter with following command, but errors happend in "legend" with "Error in rep_len(col, n.leg) : attempt to replicate non-vector". I am not familiar with R package, could you please offer some help?

treecut_number<-4
hc.umap <- cutree(hcc,treecut_number)
rbPal6 <- colorRampPalette(RColorBrewer::brewer.pal(n = 8, name = "Dark2")[1:treecut_number])
subpop <- rbPal6(treecut_number)[as.numeric(factor(hc.umap))]
cells <- rbind(subpop,subpop)

legend_names<-paste("c",1:treecut_number,sep="")
png(paste(out_dir,"/copykat_05.heatmap.png",sep=""),width = 4006, height =4006,res=400)
heatmap.3(t(tumor.mat),dendrogram="r", distfun = function(x) parallelDist::parDist(x,threads =20, method = "euclidean"),
hclustfun = function(x) hclust(x, method="ward.D2"),
ColSideColors=chr1,RowSideColors=cells,Colv=NA, Rowv=TRUE,
notecol="black",col=my_palette,breaks=col_breaks, key=TRUE,
keysize=1, density.info="none", trace="none",
cexRow=0.1,cexCol=0.1,cex.main=1,cex.lab=0.1,
symm=F,symkey=F,symbreaks=T,cex=1, cex.main=4, margins=c(10,10))
legend("topright", paste("c",names(table(hc.umap)),sep=""), pch=15,col=colorRampPalette(RColorBrewer::brewer.pal(n = 8, name = "Dark2")[1:treecut_number]), cex=0.9, bty='n')
dev.off()

Dominant language
R
Stars
305
Forks
66
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from navinlabcode/copykat

All issues in navinlabcode/copykat

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.