Skip to content

Commit

Permalink
Merge pull request #48 from finddx/sample-classification
Browse files Browse the repository at this point in the history
summarise_function fix write.csv
  • Loading branch information
m-mburu authored Jul 24, 2024
2 parents 267eb73 + eed426b commit ecb3692
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 19 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ Config/fusen/version: 0.6.0
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2

2 changes: 1 addition & 1 deletion R/samples_distributed_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ samples_distributed_summary <- function(df,
stop("please provide a path to save your file")
}
stopifnot("Directory provided does not exists"= dir.exists(dirname(path_name)))
utils::write.csv(dff, file = path_name)
utils::write.csv(dff, file = path_name, row.names = FALSE)
}
dff

Expand Down
1 change: 1 addition & 0 deletions dev/config_fusen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,4 @@ sample_selections.Rmd:
check: true
document: true
overwrite: ask
clean: ask
2 changes: 1 addition & 1 deletion dev/sample_selections.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,7 @@ samples_distributed_summary <- function(df,
stop("please provide a path to save your file")
}
stopifnot("Directory provided does not exists"= dir.exists(dirname(path_name)))
utils::write.csv(dff, file = path_name)
utils::write.csv(dff, file = path_name, row.names = FALSE)
}
dff
Expand Down
74 changes: 58 additions & 16 deletions vignettes/sample-selections-vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,22 @@ knitr::opts_chunk$set(
)
```

```{r setup}
```{r}
library(findBiobankR)
```

<!-- WARNING - This vignette is generated by {fusen} from dev/sample_selections.Rmd: do not edit by hand -->



<!--
You need to run the 'description' chunk in the '0-dev_history.Rmd' file before continuing your code there.
-->



# convert_os_df_to_wide


```{r example-convert_os_df_to_wide}
library(data.table)
library(dplyr)
Expand All @@ -49,8 +51,18 @@ clin_specs <- convert_os_df_to_wide(clinical_df = tb_data,
knitr::kable(clin_specs[1:10, ])
```








# select_one_aliquot




```{r example-select_one_aliquot}
library(data.table)
library(dplyr)
Expand Down Expand Up @@ -89,8 +101,16 @@ samples_list <- list(c("TB0990100010101001", "TB0990100010101002", "TB0990100010
select_one_aliquot(samples_list, aliquot_number = 2)
```








# select_many_aliquots


```{r example-select_many_aliquots}
samples_list <- list(c("TB0990100010101001", "TB0990100010101002", "TB0990100010101003"),
Expand All @@ -107,22 +127,20 @@ aliquots_selected <- select_many_aliquots(samples_list,
aliquots_selected
```

# select_and_shuffle_dt



# select_and_shuffle_dt



```{r example-select_and_shuffle_dt}
#select_and_shuffle_dt()
```





# select_patients_per_group


```{r example-select_patients_per_group}
library(data.table)
Expand Down Expand Up @@ -156,6 +174,8 @@ clin_specs_2 <- select_patients_per_group(df = clin_specs,
```



# selected_aliquots_df

```{r example-selected_aliquots_df}
Expand Down Expand Up @@ -187,6 +207,8 @@ selected_aliquots_df(clin_specs,
ppid_col = "ppid")
```



# make_clean_os_names

```{r example-make_clean_os_names}
Expand All @@ -201,6 +223,8 @@ nms_os <- c("Participant_PPID", "Visit_Visit Site",
make_clean_os_names(nms_os)
```



# read_os_data

```{r example-read_os_data}
Expand All @@ -209,8 +233,12 @@ tb_specs <- system.file("extdata", "tb_specs.csv",
read_os_data(path_name = tb_specs)
```




# append_check_col


```{r example-append_check_col}
library(data.table)
Expand Down Expand Up @@ -256,6 +284,10 @@ df_send <- append_check_col(selected_samples = selected_samples,
df_send
```





# process_save_selected_aliquots

```{r example-process_save_selected_aliquots}
Expand Down Expand Up @@ -311,6 +343,9 @@ process_save_selected_aliquots(file_path = path_name,
```




# create_save_workbook

```{r example-create_save_workbook}
Expand Down Expand Up @@ -340,6 +375,11 @@ unlink(path_name)
```






# gen_clinical_data

```{r example-gen_clinical_data}
Expand Down Expand Up @@ -396,8 +436,11 @@ gen_clinical_data(clinical_data = tb_data,
```



# samples_distributed_summary


```{r example-samples_distributed_summary}
library(data.table)
library(dplyr)
Expand Down Expand Up @@ -461,28 +504,23 @@ samples_distributed_summary(df =list_dfs$clinical_data ,
order_col = "Total")
```

# mark_all_duplicates





# mark_all_duplicates


```{r example-mark_all_duplicates}
vec <- c("apple", "banana", "apple", "cherry", "banana")
mark_all_duplicates(vec)
```





# create_folders





```{r example-create_folders}
path_name <- tempfile(pattern = "main_folder") %>%
normalizePath(winslash = "/")
Expand All @@ -495,7 +533,11 @@ create_folders(path_name, c("archive", "temp", "shared"), "_dir")
```











0 comments on commit ecb3692

Please sign in to comment.