Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmorin committed Nov 2, 2024
1 parent ed3a6a7 commit 95abbb3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions R/circular_CN_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ circular_CN_plot = function(pretty_CN_heatmap_output,
}
region1 = names(pretty_CN_heatmap_output$cumulative_gain)[i]
region2 = names(pretty_CN_heatmap_output$cumulative_gain)[j]
chunks1 = region_to_chunks(region1)
chunks2 = region_to_chunks(region2)
chunks1 = GAMBLR.data::region_to_chunks(region1)
chunks2 = GAMBLR.data::region_to_chunks(region2)
if(chunks1$chromosome == chunks2$chromosome){
print(paste("skipping",region1,region2,correlations[i,j]))
next;
Expand Down Expand Up @@ -173,7 +173,7 @@ circular_CN_plot = function(pretty_CN_heatmap_output,
label_end = c()
label_text = c()
for(i in c(1:length(bins_to_label))){
chunks = region_to_chunks(bins_to_label[i])
chunks = GAMBLR.data::region_to_chunks(bins_to_label[i])

if(!bins_to_label[i] %in% bin_names){
message(paste("NOT FOUND:",bins_to_label[i],labels[i]))
Expand All @@ -188,7 +188,7 @@ circular_CN_plot = function(pretty_CN_heatmap_output,

ci = get_chrom_and_index(bins_to_label[i])

print(paste(bins_to_label[i],i,ci[[1]],ci[[2]],label))
#print(paste(bins_to_label[i],i,ci[[1]],ci[[2]],label))

if(!is.null(ci[[2]])){
x = c(x,ci[[2]])
Expand All @@ -201,17 +201,17 @@ circular_CN_plot = function(pretty_CN_heatmap_output,
}

}
print(label_chrom)
print(label_start)
print(label_text)
#print(label_chrom)
#print(label_start)
#print(label_text)
label_bed = data.frame(chr=label_chrom,
start=as.integer(label_start),
end=as.integer(label_end),
value1=label_text)


if(ideogram){
print(tail(label_bed))
#print(tail(label_bed))

}else{
circos.trackPlotRegion(chroms_u_nochr, ylim = c(0, max(pretty_CN_heatmap_output$cumulative_gain)),
Expand All @@ -232,12 +232,12 @@ circular_CN_plot = function(pretty_CN_heatmap_output,
if(ideogram){
these_gains = pretty_CN_heatmap_output$cumulative_gain
gain_df = data.frame(region=names(these_gains),value1=unname(these_gains))
print(head(gain_df))
#print(head(gain_df))
gain_df = data.frame(region=names(these_gains),value1=unname(these_gains)) %>%
separate(region,into=c("chr","coords"),sep=":") %>%
separate(coords,into=c("start","end"),sep="-") %>%
mutate(start=as.integer(start),end=as.integer(end))
print(head(gain_df))
#print(head(gain_df))
circos.genomicTrack(gain_df, panel.fun = function(region, value, ...) {
circos.genomicLines(region, value, type = "l",area=T, col =gain_col, ...)
})
Expand All @@ -264,7 +264,7 @@ circular_CN_plot = function(pretty_CN_heatmap_output,
separate(region,into=c("chr","coords"),sep=":") %>%
separate(coords,into=c("start","end"),sep="-") %>%
mutate(start=as.integer(start),end=as.integer(end))
print(head(loss_df))
#print(head(loss_df))
circos.genomicTrack(loss_df, panel.fun = function(region, value, ...) {
circos.genomicLines(region, value, type = "l",area=T, col = del_col, ...)
})
Expand Down

0 comments on commit 95abbb3

Please sign in to comment.