Python: #!/usr/bin/env python3
This file contains 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
library(tidyverse) | |
#### MAKING MOCK DATA #### | |
# Some parameters for amount of data. | |
n_metabs <- 5 | |
n_tissues <- 10 | |
tissues <- purrr::map_chr(1:n_tissues, ~ paste0(sample(letters, 3), collapse="")) | |
# Make a wide table of data, adding on columns per metabolite |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# Parse a string given in "# #/# oz" into a decimal value. | |
parse_ounces <- function(val) { | |
if (val == "For glass") { return(1) } | |
if (str_detect(val, "or")) { | |
val <- str_remove(val, "or.+$") | |
} | |
val_pieces <- str_remove_all(val, "oz|slices|tsp|dash") %>% | |
str_trim() %>% |
This file contains 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
#!/usr/bin/env python3 | |
# How to get Typer to behave like it has a default command. | |
# source: https://github.com/tiangolo/typer/issues/18#issuecomment-617089716 | |
import typer | |
app = typer.Typer() | |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
pip freeze | xargs pip uninstall -y |
OlderNewer