Skip to content

Commit

Permalink
remove sample prefix from sample number
Browse files Browse the repository at this point in the history
removes discrepancies in "sample_" prefix removal
  • Loading branch information
kartva committed Jan 31, 2024
1 parent 73b44f2 commit 319dce4
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
18 changes: 9 additions & 9 deletions server/scripts/Librarian/.Rhistory
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ mutate(lib_type = gsub("DNase-Hypersensitivity", "DNase-HS", lib_type)) %>%
ggplot(aes(UMAP1,UMAP2)) +
geom_point(size = 1.5, aes(colour = lib_type, group = SRR)) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), colour = "black", shape = 1, size = 5, stroke = 3) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = gsub("sample_","", sample)), size = 6, nudge_x = 1, nudge_y = 1) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = sample), size = 6, nudge_x = 1, nudge_y = 1) +
theme_bw(base_size = 14) +
theme(legend.title = element_text(size = 12)) +
#ylim(-10, 10) +
Expand Down Expand Up @@ -149,7 +149,7 @@ theme(legend.title = element_blank(), axis.title = element_blank(), panel.backgr
geom_tile(aes(fill = percentage)) +
scale_fill_viridis_c(option = "inferno", direction = -1) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), fill = "black", colour = "#609CE1", shape = 1, size = 3, stroke = 1 ) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = gsub("sample_","", sample)), size = 3, nudge_x = 2, nudge_y = 1) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = sample), size = 3, nudge_x = 2, nudge_y = 1) +
ggtitle("percent of library per tile") +
facet_wrap(facets = "library_type", ncol = 5) +
theme(text = element_text(family = "sans"), aspect.ratio = 0.8, panel.background = element_rect(fill = "#feffe9"), panel.grid = element_blank(), plot.title = element_text(size = 14, hjust = 0.5)) -> umap_grid_tile_long_plot
Expand All @@ -169,7 +169,7 @@ pivot_longer(5:last_col(), names_to = "library_type", values_to = "percent") ->
## Plotting grid stats as heatmap
test_percentage %>%
mutate(library_type = factor(library_type, levels = sort(unique(library_type), decreasing = TRUE))) %>%
mutate(sample = gsub("sample_", "", sample)) %>%
mutate(sample = sample) %>%
ggplot(aes(sample, library_type, fill = percent)) +
geom_tile() +
scale_fill_gradient(low = "white", high = "red") +
Expand Down Expand Up @@ -251,7 +251,7 @@ mutate(lib_type = gsub("DNase-Hypersensitivity", "DNase-HS", lib_type)) %>%
ggplot(aes(UMAP1,UMAP2)) +
geom_point(size = 1.5, aes(colour = lib_type, group = SRR)) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), colour = "black", shape = 1, size = 5, stroke = 3) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = gsub("sample_","", sample)), size = 6, nudge_x = 1, nudge_y = 1) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = sample), size = 6, nudge_x = 1, nudge_y = 1) +
theme_bw(base_size = 14) +
theme(legend.title = element_text(size = 12)) +
#ylim(-10, 10) +
Expand Down Expand Up @@ -307,7 +307,7 @@ theme(legend.title = element_blank(), axis.title = element_blank(), panel.backgr
geom_tile(aes(fill = percentage)) +
scale_fill_viridis_c(option = "inferno", direction = -1) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), fill = "black", colour = "#609CE1", shape = 1, size = 3, stroke = 1 ) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = gsub("sample_","", sample)), size = 3, nudge_x = 2, nudge_y = 1) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = sample), size = 3, nudge_x = 2, nudge_y = 1) +
ggtitle("percent of library per tile") +
facet_wrap(facets = "library_type", ncol = 5) +
theme(text = element_text(family = "sans"), aspect.ratio = 0.8, panel.background = element_rect(fill = "#feffe9"), panel.grid = element_blank(), plot.title = element_text(size = 14, hjust = 0.5)) -> umap_grid_tile_long_plot
Expand All @@ -321,7 +321,7 @@ left_join(grid_tile_corr_percentages) %>%
pivot_longer(5:last_col(), names_to = "library_type", values_to = "percent") -> test_percentage
test_percentage %>%
mutate(library_type = factor(library_type, levels = sort(unique(library_type), decreasing = TRUE))) %>%
mutate(sample = gsub("sample_", "", sample)) %>%
mutate(sample = sample) %>%
ggplot(aes(sample, library_type, fill = percent)) +
geom_tile() +
scale_fill_gradient(low = "white", high = "red") +
Expand Down Expand Up @@ -398,7 +398,7 @@ mutate(lib_type = gsub("DNase-Hypersensitivity", "DNase-HS", lib_type)) %>%
ggplot(aes(UMAP1,UMAP2)) +
geom_point(size = 1.5, aes(colour = lib_type, group = SRR)) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), colour = "black", shape = 1, size = 5, stroke = 3) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = gsub("sample_","", sample)), size = 6, nudge_x = 1, nudge_y = 1) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = sample), size = 6, nudge_x = 1, nudge_y = 1) +
theme_bw(base_size = 14) +
theme(legend.title = element_text(size = 12)) +
#ylim(-10, 10) +
Expand Down Expand Up @@ -462,7 +462,7 @@ theme(legend.title = element_blank(), axis.title = element_blank(), panel.backgr
geom_tile(aes(fill = percentage)) +
scale_fill_viridis_c(option = "inferno", direction = -1) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), fill = "black", colour = "#609CE1", shape = 1, size = 3, stroke = 1 ) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = gsub("sample_","", sample)), size = 3, nudge_x = 2, nudge_y = 1) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = sample), size = 3, nudge_x = 2, nudge_y = 1) +
ggtitle("percent of library per tile") +
facet_wrap(facets = "library_type", ncol = 5) +
theme(text = element_text(family = "sans"), aspect.ratio = 0.8, panel.background = element_rect(fill = "#feffe9"), panel.grid = element_blank(), plot.title = element_text(size = 14, hjust = 0.5)) -> umap_grid_tile_long_plot
Expand All @@ -482,7 +482,7 @@ pivot_longer(5:last_col(), names_to = "library_type", values_to = "percent") ->
## Plotting grid stats as heatmap
test_percentage %>%
mutate(library_type = factor(library_type, levels = sort(unique(library_type), decreasing = TRUE))) %>%
mutate(sample = gsub("sample_", "", sample)) %>%
mutate(sample = sample) %>%
ggplot(aes(sample, library_type, fill = percent)) +
geom_tile() +
scale_fill_gradient(low = "white", high = "red") +
Expand Down
6 changes: 3 additions & 3 deletions server/scripts/Librarian/Librarian_offline_analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ compositions_umap_results %>%
ggplot(aes(UMAP1,UMAP2)) +
geom_point(size = 1.5, aes(colour = lib_type, group = SRR)) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), colour = "black", shape = 1, size = 5, stroke = 3) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = gsub("sample_","", sample)), size = 6, nudge_x = 1, nudge_y = 1) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = sample), size = 6, nudge_x = 1, nudge_y = 1) +
theme_bw(base_size = 14) +
theme(legend.title = element_text(size = 12)) +
#ylim(-10, 10) +
Expand Down Expand Up @@ -204,7 +204,7 @@ umap_grid_tile_long %>%
geom_tile(aes(fill = percentage)) +
scale_fill_viridis_c(option = "inferno", direction = -1) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), fill = "black", colour = "#609CE1", shape = 1, size = 3, stroke = 1 ) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = gsub("sample_","", sample)), size = 3, nudge_x = 2, nudge_y = 1) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = sample), size = 3, nudge_x = 2, nudge_y = 1) +
ggtitle("percent of library per tile") +
facet_wrap(facets = "library_type", ncol = 5) +
theme(text = element_text(family = "sans"), aspect.ratio = 0.8, panel.background = element_rect(fill = "#feffe9"), panel.grid = element_blank(), plot.title = element_text(size = 14, hjust = 0.5)) -> umap_grid_tile_long_plot
Expand Down Expand Up @@ -236,7 +236,7 @@ test_grid %>%
test_percentage %>%
mutate(library_type = factor(library_type, levels = sort(unique(library_type), decreasing = TRUE))) %>%
mutate(sample = gsub("sample_", "", sample)) %>%
mutate(sample = sample) %>%
ggplot(aes(sample, library_type, fill = percent)) +
geom_tile() +
scale_fill_gradient(low = "white", high = "red") +
Expand Down
6 changes: 3 additions & 3 deletions server/scripts/Librarian/librarian_offline_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ compositions_umap_results %>%
ggplot(aes(UMAP1,UMAP2)) +
geom_point(size = 1.5, aes(colour = lib_type, group = SRR)) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), colour = "black", shape = 1, size = 5, stroke = 3) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = gsub("sample_","", sample)), size = 6, nudge_x = 1, nudge_y = 1) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = sample), size = 6, nudge_x = 1, nudge_y = 1) +
theme_bw(base_size = 14) +
theme(legend.title = element_text(size = 12)) +
#ylim(-10, 10) +
Expand Down Expand Up @@ -195,7 +195,7 @@ umap_grid_tile_long %>%
geom_tile(aes(fill = percentage)) +
scale_fill_viridis_c(option = "inferno", direction = -1) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), fill = "black", colour = "#609CE1", shape = 1, size = 3, stroke = 1 ) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = gsub("sample_","", sample)), size = 3, nudge_x = 2, nudge_y = 1) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = sample), size = 3, nudge_x = 2, nudge_y = 1) +
ggtitle("percent of library per tile") +
facet_wrap(facets = "library_type", ncol = 5) +
theme(text = element_text(family = "sans"), aspect.ratio = 0.8, panel.background = element_rect(fill = "#feffe9"), panel.grid = element_blank(), plot.title = element_text(size = 14, hjust = 0.5)) -> umap_grid_tile_long_plot
Expand Down Expand Up @@ -227,7 +227,7 @@ test_grid %>%

test_percentage %>%
mutate(library_type = factor(library_type, levels = sort(unique(library_type), decreasing = TRUE))) %>%
mutate(sample = gsub("sample_", "", sample)) %>%
mutate(sample = sample) %>%
ggplot(aes(sample, library_type, fill = percent)) +
geom_tile() +
scale_fill_gradient(low = "white", high = "red") +
Expand Down
6 changes: 3 additions & 3 deletions server/scripts/Librarian_analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ compositions_umap_results %>%
ggplot(aes(UMAP1,UMAP2)) +
geom_point(size = 1.5, aes(colour = lib_type, group = SRR)) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), colour = "black", shape = 1, size = 5, stroke = 3) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = gsub("sample_","", sample)), size = 6, nudge_x = 1, nudge_y = 1) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = sample), size = 6, nudge_x = 1, nudge_y = 1) +
theme_bw(base_size = 14) +
theme(legend.title = element_text(size = 12)) +
#ylim(-10, 10) +
Expand Down Expand Up @@ -199,7 +199,7 @@ umap_grid_tile_long %>%
geom_tile(aes(fill = percentage)) +
scale_fill_viridis_c(option = "inferno", direction = -1) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), fill = "black", colour = "#609CE1", shape = 1, size = 3, stroke = 1 ) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = gsub("sample_","", sample)), size = 3, nudge_x = 2, nudge_y = 1) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = sample), size = 3, nudge_x = 2, nudge_y = 1) +
ggtitle("percent of library per tile") +
facet_wrap(facets = "library_type", ncol = 5) +
theme(text = element_text(family = "sans"), aspect.ratio = 0.8, panel.background = element_rect(fill = "#feffe9"), panel.grid = element_blank(), plot.title = element_text(size = 14, hjust = 0.5)) -> umap_grid_tile_long_plot
Expand All @@ -226,7 +226,7 @@ test_grid %>%
test_percentage %>%
mutate(library_type = factor(library_type, levels = sort(unique(library_type), decreasing = TRUE))) %>%
mutate(sample = gsub("sample_", "", sample)) %>%
mutate(sample = sample) %>%
ggplot(aes(sample, library_type, fill = percent)) +
geom_tile() +
scale_fill_gradient(low = "white", high = "red") +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ compositions_umap_results %>%
ggplot(aes(UMAP1,UMAP2)) +
geom_point(size = 1.5, aes(colour = lib_type, group = SRR)) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), colour = "black", shape = 1, size = 5, stroke = 3) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = gsub("sample_","", sample)), size = 6, nudge_x = 1, nudge_y = 1) +
geom_text(data = test_coordinates, aes(UMAP1, UMAP2, label = sample), size = 6, nudge_x = 1, nudge_y = 1) +
theme_bw(base_size = 14) +
theme(legend.title = element_text(size = 12)) +
#ylim(-10, 10) +
Expand Down Expand Up @@ -180,7 +180,7 @@ umap_grid_tile_long %>%
geom_tile(aes(fill = percentage)) +
scale_fill_viridis_c(option = "inferno", direction = -1) +
geom_point(data = test_coordinates, aes(UMAP1, UMAP2), fill = "black", colour = "#609CE1", shape = 1, size = 3, stroke = 1 ) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = gsub("sample_","", sample)), size = 3, nudge_x = 2, nudge_y = 1) +
geom_text(data = test_coordinates, aes(x=UMAP1, y=UMAP2, label = sample), size = 3, nudge_x = 2, nudge_y = 1) +
ggtitle("percent of library per tile") +
facet_wrap(facets = "library_type", ncol = 5) +
theme(text = element_text(family = "sans"), aspect.ratio = 0.8, panel.background = element_rect(fill = "#feffe9"), panel.grid = element_blank(), plot.title = element_text(size = 14, hjust = 0.5)) -> umap_grid_tile_long_plot
Expand All @@ -207,7 +207,7 @@ test_grid %>%

test_percentage %>%
mutate(library_type = factor(library_type, levels = sort(unique(library_type), decreasing = TRUE))) %>%
mutate(sample = gsub("sample_", "", sample)) %>%
mutate(sample = sample) %>%
ggplot(aes(sample, library_type, fill = percent)) +
geom_tile() +
scale_fill_gradient(low = "white", high = "red") +
Expand Down
2 changes: 1 addition & 1 deletion server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub fn serialize_comps_for_script(comp: Vec<FileComp>) -> String {
// substitute tabs in sample names with spaces
c.name = c.name.replace('\t', " ");

write!(&mut ser, "sample_{:02}\t{}\t", i + 1, c.name).unwrap(); // this unwrap never fails
write!(&mut ser, "{:02}\t{}\t", i + 1, c.name).unwrap(); // this unwrap never fails
c.comp
.lib
.into_iter()
Expand Down

0 comments on commit 319dce4

Please sign in to comment.