Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PAE_eCLIP_count_analysis
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hentze Group
PCBP1_SERBP1
PAE_eCLIP_count_analysis
Commits
b453db9e
Commit
b453db9e
authored
1 year ago
by
Thomas Schwarzl
Browse files
Options
Downloads
Patches
Plain Diff
added replicate visualisations
#1
parent
4e935a62
Branches
patch-1
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#48462
passed with stages
in 1 minute and 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PCBP1_SERBP1.qmd
+107
-2
107 additions, 2 deletions
PCBP1_SERBP1.qmd
with
107 additions
and
2 deletions
PCBP1_SERBP1.qmd
+
107
−
2
View file @
b453db9e
...
...
@@ -89,7 +89,10 @@ out_dir_between_methods <- file.path(out_dir, "Plots_pae_vs_se")
out_dir_between_methods_by_type <- file.path(out_dir_between_methods, "by_type")
out_dir_comparisons <- file.path(out_dir, "Plots_comparisons")
out_dir_comparisons_by_type <- file.path(out_dir_comparisons, "by_type")
out_dir_comparisons_replicates <- file.path(out_dir, "Plots_replicates")
out_dir_comparisons_replicates_t <- file.path(out_dir_comparisons_replicates,
"by_type")
# directory for temporary file
tmp_dir <- "tmp"
...
...
@@ -111,8 +114,12 @@ dir.create(out_dir_between_methods, recursive = T, showWarnings = F)
dir.create(out_dir_between_methods_by_type, recursive = T, showWarnings = F)
dir.create(out_dir_comparisons, recursive = T, showWarnings = F)
dir.create(out_dir_comparisons_by_type, recursive = T, showWarnings = F)
dir.create(out_dir_comparisons_replicates, recursive = T, showWarnings = F)
dir.create(out_dir_comparisons_replicates_t, recursive = T, showWarnings = F)
dir.create(tmp_dir, showWarnings = F)
```
### Files
...
...
@@ -611,8 +618,106 @@ with_progress({
})
})
```
p
### Comparisons between replicates
Creating a list of comparisons between replicates
```{r}
#| label: select groups with multiple replicates
groups_with_multiple_replicates <- sampleInfo %>% group_by(group) %>%
summarize(n = n()) %>% dplyr::filter(n > 1) %>%
pull(group)
names(groups_with_multiple_replicates) <- groups_with_multiple_replicates
groups_with_multiple_replicates <- lapply(groups_with_multiple_replicates, function(x) {
getSampleNamesForGroup(sampleInfo, x)
})
```
```{r}
#| label: plots for replicate comparisons
with_progress({
prog <- progressor(along = names(groups_with_multiple_replicates))
tmp_plots_facet <- do_lapply(names(groups_with_multiple_replicates), function(i) {
prog()
xx = groups_with_multiple_replicates[[i]]
comp2_samples <- xx[[2]]
comp1_samples <- xx[[1]]
for(x1 in comp2_samples) {
for(y1 in comp1_samples) {
x1_file <- getFileSuffixForSampleName(sampleInfo, x1)
y1_file <- getFileSuffixForSampleName(sampleInfo, y1)
file_p <- file.path(out_dir_comparisons_replicates,
str_c(i,
"_",
x1_file,
"_",
y1_file,
".png"))
if(!file.exists(file_p)) {
p <- create_comparison_plot(vsd_anno, x1, y1)
save_plot(filename = file_p, p, base_asp = 2)
}
}
}
})
})
```
```{r}
#| label: "create_comparison_plots_by_type"
with_progress({
prog <- progressor(along = names(groups_with_multiple_replicates))
tmp_plots_facet <- do_lapply(names(groups_with_multiple_replicates), function(i) {
prog()
xx = groups_with_multiple_replicates[[i]]
comp2_samples <- xx[[2]]
comp1_samples <- xx[[1]]
for(x1 in comp2_samples) {
for(y1 in comp1_samples) {
x1_file <- getFileSuffixForSampleName(sampleInfo, x1)
y1_file <- getFileSuffixForSampleName(sampleInfo, y1)
file_p <- file.path(out_dir_comparisons_replicates_t,
str_c(i,
"_",
x1_file,
"_",
y1_file,
".png"))
p <- create_facet_plot(vsd_anno, x1, y1)
if(!file.exists(file_p)) {
save_plot(filename = file_p,
p,
base_height = 6,
base_asp = 1.8)
}
}
}
})
})
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment