Skip to content

Commit

Permalink
Merge pull request #114 from uclahs-cds/Phils-replot_box
Browse files Browse the repository at this point in the history
Update plot_num_subclones_box.R
  • Loading branch information
philippaSteinberg authored Jan 22, 2024
2 parents 1b3da15 + 5373f5e commit 016c4a6
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions src/output-analysis/plotting/plot_num_subclones_box.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,41 @@ subclones.data <- read.table(file = args$file, sep = '\t', header = TRUE);
src.tool <- strsplit(args$pipeline, '-')[[1]][3];
src.colour <- pipeline.colour.scheme[src.tool];

filename <- paste0('2024_01_01-', args$pipeline, '_', args$mode, '_subclones_box.pdf');
print(filename);

### SR FUNCTION ###################################################################################
plot.sr <- function(df) {
plot <- create.boxplot(
formula = n_clones ~ patient,
data = subclones.data,
formula = patient ~ n_clones,
data = df,
filename = generate.filename(
'proj-seed',
paste0(args$pipeline, '_', args$mode, '_subclones_box'),
'pdf'
),
main = args$pipeline,
ylab.label = 'Number of Subclones',
xlab.label = 'Patient',
xlab.label = 'Number of Subclones',
ylab.label = 'Patient',
main.just = 'center',
main.x = 0.52,
ylimits = c(0.5, 9.5),
yat = seq(1, 9, 1),
xaxis.lab = patients.sr,
xlimits = c(0.5, 9.5),
xat = seq(1, 9, 1),
yaxis.lab = patients.sr,
add.stripplot = TRUE,
points.pch = 19,
points.col = 'black',
points.cex = 0.4,
points.alpha = 1,
col = src.colour,
alpha.rectangle = 0.8,
main.cex = 1.1,
xaxis.cex = 0.8,
yaxis.cex = 0.8,
xlab.cex = 1.1,
ylab.cex = 1.1,
main.cex = 1.6,
xaxis.cex = 1.6,
yaxis.cex = 1.6,
xlab.cex = 1.6,
ylab.cex = 1.6,
xaxis.tck = c(1, 0),
yaxis.tck = c(1, 0),
yaxis.tck = c(1, 0, 1),
xaxis.rot = 0,
xaxis.fontface = 1,
yaxis.fontface = 1,
Expand All @@ -67,57 +70,54 @@ plot.sr <- function(df) {
left.padding = 1,
ylab.axis.padding = 1,
description = 'Boxplot created by BoutrosLab.plotting.general',
height = 4,
width = 7
height = 8,
width = 4
);
};

### MR FUNCTION ###################################################################################
plot.mr <- function(df) {
plot <- create.boxplot(
formula = n_clones ~ patient,
data = subclones.data,
formula = patient ~ n_clones,
data = df,
filename = generate.filename(
'proj-seed',
paste0(args$pipeline, '_', args$mode, '_subclones_box'),
'pdf'
),
main = args$pipeline,
ylab.label = 'Number of Subclones',
xlab.label = 'Patient',
xlab.label = 'Number of Subclones',
ylab.label = 'Patient',
main.just = 'center',
main.x = 0.52,
ylimits = c(0.5, 9.5),
xlimits = c(0.5, 9.5),
xat = seq(1, 9, 1),
yaxis.lab = patients.mr,
yat = seq(1, 9, 1),
xaxis.lab = patients.mr,
add.stripplot = TRUE,
points.pch = 19,
points.col = 'black',
points.cex = 0.6,
points.cex = 0.4,
points.alpha = 1,
col = src.colour,
alpha.rectangle = 0.8,
main.cex = 1.1,
xaxis.cex = 0.8,
yaxis.cex = 0.8,
xlab.cex = 1.1,
ylab.cex = 1.1,
main.cex = 1.6,
xaxis.cex = 1.6,
yaxis.cex = 1.6,
xlab.cex = 1.6,
ylab.cex = 1.6,
xaxis.tck = c(1, 0),
yaxis.tck = c(1, 0),
xaxis.rot = 0,
xaxis.fontface = 1,
yaxis.fontface = 1,
top.padding = 1,
top.padding = 35,
bottom.padding = 1,
right.padding = 1,
left.padding = 1,
ylab.axis.padding = 1,
description = 'Boxplot created by BoutrosLab.plotting.general',
#legend = list(
# right = list(fun = algorithm.legends.grob)
# ),
height = 4,
width = 7
size.units = 'inches',
description = 'Boxplot created by BoutrosLab.plotting.general'
);
};

Expand All @@ -127,7 +127,7 @@ setwd(args$output);
if (args$mode == 'sr') {
plot.sr(subclones.data)
print('plotting sr')
} else {
plot.mr(subclones.data)
print('plotting mr')
};
} else {
plot.mr(subclones.data)
print('plotting mr')
};

0 comments on commit 016c4a6

Please sign in to comment.