ChristopherBarrington / helpr

tools to make r life easier
https://christopherbarrington.github.io/helpr
0 stars 0 forks source link

write params file function #1

Closed ChristopherBarrington closed 3 years ago

ChristopherBarrington commented 3 years ago
#+ write_parameters_table_and_sbatch_parameters
parameter_sets %>% write.table(file='parameters.csv', sep=',', quote=FALSE, row.names=FALSE, col.names=FALSE)
sprintf(fmt='#SBATCH --array 1-%d:1', nrow(parameter_sets)) %>% message()
sprintf(fmt="IFS=',' read %s <<< $(head -n ${SLURM_ARRAY_TASK_ID} parameters.csv | tail -n 1)", {colnames(parameter_sets) %>% str_flatten(collapse=' ') %>% str_to_upper()}) %>% message()