-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Major updates #34
Major updates #34
Changes from 10 commits
0b9390e
2d16ab2
991cd8d
4d411de
03881d6
a8d6271
8c7ced8
eae3bc1
d2a2d87
e7791d8
8839fc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: GAMBLR.helpers build check | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_KEEP_PKG_SOURCE: yes | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Conda | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Create conda environment | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: r | ||
channels: conda-forge,defaults | ||
python-version: 3.11 | ||
auto-activate-base: false | ||
environment-file: envs/r.yaml | ||
|
||
- name: Build package | ||
run: | ||
Rscript -e "devtools::install()" | ||
|
||
- name: Check package | ||
run: | ||
Rscript -e "devtools::check(vignettes = FALSE, args = '--no-examples')" | ||
|
||
- name: Upload check results | ||
if: failure() | ||
uses: actions/upload-artifact@main | ||
with: | ||
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | ||
path: check |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ Imports: | |
ggthemes, | ||
philentropy, | ||
readr, | ||
reshape2, | ||
stringr, | ||
tibble, | ||
tidyr, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
#' @title Cache output. | ||
#' | ||
#' @description TODO. | ||
#' | ||
#' @param result_df TODO. | ||
#' @param function_name TODO. | ||
#' @param clobber_mode TODO. | ||
#' @param get_existing TODO. | ||
#' @param function_params TODO. | ||
#' @param additional_details TODO. | ||
#' | ||
#' @return file | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see earlier comment regarding what to return |
||
#' | ||
#' @export | ||
cache_output = function(result_df, | ||
function_name, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
#' maf1, | ||
#' regions_bed = grch37_ashm_regions | ||
#' ) | ||
#' #' calculate_tmb( | ||
#' calculate_tmb( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The title of this function should probably be "calculate tumour mutation burden", to be more intuitive and self-explanatory There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks - Updated the title! |
||
#' maf1, | ||
#' regions_bed = grch37_ashm_regions, | ||
#' subset_to_nonSyn = FALSE | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,33 @@ | ||
#helper function to get the unmatched normals from the main config | ||
#' @title Get unmatched normals. | ||
#' | ||
#' @description Helper function to get the unmatched normals from the main | ||
#' config. | ||
#' | ||
#' @param seq_type_filter Seq type key from config for which to return the | ||
#' unmatched normals for. | ||
#' | ||
#' @return data frame | ||
#' | ||
#' @import dplyr tidyr tibble | ||
#' @export | ||
get_unmatched_normals = function(seq_type_filter){ | ||
a = check_config_value(config::get("unmatched_normal_ids")) | ||
df = melt(a,value.name="normal_sample_id") %>% | ||
rename(c("genome_build"="L3","seq_type"="L2","unix_group"="L1")) %>% | ||
dplyr::filter(seq_type == seq_type_filter) | ||
return(df) | ||
a <- check_config_value(config::get("unmatched_normal_ids")) | ||
df <- a %>% | ||
as.data.frame( | ||
check.names = FALSE | ||
) %>% | ||
t %>% | ||
as.data.frame() %>% | ||
tibble::rownames_to_column("rownames") %>% | ||
tidyr::separate( | ||
rownames, | ||
into = c("unix_group", "seq_type", "genome_build"), | ||
sep = "\\." | ||
) %>% | ||
dplyr::select( | ||
"normal_sample_id" = "V1", | ||
genome_build, seq_type, unix_group | ||
) %>% | ||
dplyr::filter(seq_type == seq_type_filter) | ||
return(df) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should say "nothing" for the return or (better yet) make functions like this one return the "full path to the file that was written"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, added this to this function and other similar functions that were writing files