2017-08-18 20:04:01 +00:00
|
|
|
# scriptTemplate.R
|
|
|
|
#
|
|
|
|
# Purpose:
|
|
|
|
# Version:
|
|
|
|
# Date:
|
|
|
|
# Author:
|
|
|
|
#
|
|
|
|
# Input:
|
|
|
|
# Output:
|
|
|
|
# Dependencies:
|
|
|
|
#
|
|
|
|
# ToDo:
|
|
|
|
# Notes:
|
2017-10-29 03:05:53 +00:00
|
|
|
#
|
2017-08-18 20:04:01 +00:00
|
|
|
# ==============================================================================
|
|
|
|
|
|
|
|
setwd("<your/project/directory>")
|
|
|
|
|
|
|
|
# ==== PARAMETERS ============================================================
|
|
|
|
# Define and explain all parameters. No "magic numbers" in your code below.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==== PACKAGES ==============================================================
|
2019-01-08 07:11:25 +00:00
|
|
|
# Check that required packages have been installed. Install if needed.
|
2017-08-18 20:04:01 +00:00
|
|
|
|
2019-01-08 07:11:25 +00:00
|
|
|
if (! requireNamespace("seqinr", quietly=TRUE)) {
|
2017-10-29 03:05:53 +00:00
|
|
|
install.packages("seqinr")
|
2017-08-18 20:04:01 +00:00
|
|
|
}
|
2017-10-29 03:05:53 +00:00
|
|
|
# Package information:
|
|
|
|
# library(help = seqinr) # basic information
|
|
|
|
# browseVignettes("seqinr") # available vignettes
|
|
|
|
# data(package = "seqinr") # available datasets
|
|
|
|
|
2019-01-08 07:11:25 +00:00
|
|
|
# Note: use package functions with the :: operator - eg.
|
|
|
|
# seqinr::aaa("K")
|
2017-10-29 03:05:53 +00:00
|
|
|
|
2017-08-18 20:04:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ==== FUNCTIONS =============================================================
|
|
|
|
|
|
|
|
# Define functions or source external files
|
|
|
|
source("<myUtilityFunctionsScript.R>")
|
|
|
|
|
|
|
|
myFunction <- function(a, b=1) {
|
|
|
|
# Purpose:
|
|
|
|
# Describe ...
|
|
|
|
# Parameters:
|
|
|
|
# a: ...
|
|
|
|
# b: ...
|
|
|
|
# Value:
|
|
|
|
# result: ...
|
2017-10-29 03:05:53 +00:00
|
|
|
|
2017-08-18 20:04:01 +00:00
|
|
|
# code ...
|
2017-10-29 03:05:53 +00:00
|
|
|
|
2017-08-18 20:04:01 +00:00
|
|
|
return(result)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==== PROCESS ===============================================================
|
|
|
|
# Enter the step-by-step process of your project here. Strive to write your
|
|
|
|
# code so that you can simply run this entire file and re-create all
|
|
|
|
# intermediate results.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==== TESTS =================================================================
|
|
|
|
# Enter your function tests here...
|
|
|
|
|
|
|
|
|
|
|
|
# [END]
|