Repository navigation
feat: export an R script that reproduces the app - #149
Merged
Merged
Conversation
The Export page shows and downloads an R script that repeats the analysis of the app: load_rcc() with the settings of the object, or the example data, then normalise() with the method, background and thresholds chosen in the app. The thresholds are written into the script and read back with read_thresholds(), so it is one file.
The thresholds come from thresholds_yaml(), which write_thresholds() now uses too, and the example data is recognised from a cached fingerprint of its load time and samples, which normalise() leaves alone.
An unknown instrument is left to load_rcc(), the folder the object was loaded from is kept unless it was an upload, and the script says that it loads every file of the folder.
…he script The R script for an upload says which columns the sample sheet needs, and its tests no longer depend on where they run.
An object reopened in a later session can hold a folder that no longer exists, so the script asks for the path instead.
mcanouil
marked this pull request as ready for review
October 15, 2026 13:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Export page now has a "Reproduce in R" card.
It shows an R script that repeats the analysis of the app, and downloads it as
nacho-reproduce.R.The script loads the data with
load_rcc()and the settings stored in the object, then callsnormalise()with the method, background and number of RUVg factors chosen in the app.The thresholds set in the app are written into the script as YAML and read back with
read_thresholds(), so the script is a single file.For the example data, it starts from
GSE74821and runs as it is.For other data, it keeps the folder the object was loaded from, or asks for the paths when the files were uploaded or the folder is gone, and names the sample sheet columns.
The tests run the generated script and check that it gives the same counts, quality-control table and thresholds as the app.
write_thresholds()now builds its text with a new internalthresholds_yaml(), which the script uses too.