nki-ccb / ppbc Goto Github PK
View Code? Open in Web Editor NEWPost-partum breast cancer
License: MIT License
Post-partum breast cancer
License: MIT License
Handy to have just one function for processing outcome data, now that we have a "final" metadata file. outcome.R
is the more robust of the two existing options and will also be used in the RNAseq pipeline post refactor. Both run and produce the desired result; low priority task.
This is already WIP under the refactor branch. Incorporating a new metadata file requires a substantial rework of older notebooks. Where necessary, the code will be rewritten for legibility and polish as well as compatibility with the new file. Some reorganization is also taking place (i.e. RNAseq reports go in reports/rnaseq
instead of reports
).
Pertains to model_density.R.
# Also perform total aggregation on combined tumor and stroma
totals <- region %>% group_by(t_number, panel, cell_type, batch) %>%
summarise(area = sum(area), n = sum(n), .groups = "drop") %>%
mutate(classifier_label = "Total", .before = everything()) %>%
group_by(classifier_label) %>%
mutate(
area = ensure_one_value(area), # Fill in area when n==0
classifier_label = factor(classifier_label, levels = c("Stroma", "Tumor", "Total"))
) %>%
mutate(density = if_else(n==0, 0, n / area))
bind_rows(region, totals)
}
Unnecessarily copied code. How about
density_total <- density_per_region %>%
group_by(t_number, panel, cell_type, batch, .drop=F) %>%
summarize(n = sum(n), area = ensure_one_value(area)) %>%
mutate(classifier_label = 'Total')
the density calculation from area and n can also be shared:
bind_rows(region, totals) %>%
mutate(density = if_else(n==0, 0, n / area))
Originally posted by @tychobismeijer in #2 (comment)
All of Hanne's work is outside the git repo and based upon a mix of (mostly untracked) output files, sometimes with manual edits in Excel or similar. These need to be incorporated into version control before the project is reproducible.
Reworking the existing code to accept the "final" metadata file is a prerequisite, as her notebooks are based upon it.
Tumor is sometimes listed as "tumor" in the classifier label field. This should be fixed in the code that loads the data, not in model_density.R. It is not specific for density.
Originally posted by @tychobismeijer in #2 (comment)
Find out why this sample is not working and fix or decide to exclude the sample permanently.
rule invbf_time_density:
input:
density_outcome = "data/vectra/processed/density_ppbc.Rds",
rmd="reports/spatial/06b_inv_time_density.Rmd",
script="src/rmarkdown.R"
params:
min_cell_count = 20000,
Snakemake will not rerun if the parameters are changed. If they are in a seperate file, in input, it will rerun as expected.
Originally posted by @tychobismeijer in #2 (comment)
Remove duplication and modularize regression functions for later reuse.
It doesn't look like there's a seed set during the null model's random Poisson distribution. @tychobismeijer would you be opposed to setting a seed so that the results are 100% reproducible when the code is rerun?
Installation of renv fails for me, so this needs to be fixed or documented how installation is supposed to work.
Retrieving 'https://cloud.r-project.org/src/contrib/Archive/apeglm/apeglm_1.12.0.tar.gz' ...
Warning: failed to find source for 'bbmle 1.0.24' in package repositories
Warning: failed to find source for 'numDeriv 2020.2-1' in package repositories
Warning: failed to retrieve 'https://cloud.r-project.org/src/contrib/Archive/numDeriv/numDeriv_2020.2-1.tar.gz' [error code 22]
Warning: failed to retrieve 'https://cloud.r-project.org/src/contrib/Archive/apeglm/apeglm_1.12.0.tar.gz' [error code 22]
Error: failed to retrieve package '[email protected]'
In addition: Warning messages:
1: curl: (22) The requested URL returned error: 404
2: failed to find source for 'bbmle 1.0.24' in package repositories
3: curl: (22) The requested URL returned error: 404
4: curl: (22) The requested URL returned error: 404
Traceback (most recent calls last):
9: renv:::restore()
8: renv_restore_run_actions(project, diff, current, lockfile, rebuild)
7: retrieve(packages)
6: handler(package, renv_retrieve_impl(package))
5: renv_retrieve_impl(package)
4: renv_retrieve_bioconductor(record)
3: renv_retrieve_repos(record)
2: stopf("failed to retrieve package '%s'", renv_record_format_remote(record))
1: stop(sprintf(fmt, ...), call. = call.)
Execution halted
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.