diff --git a/bin/cdhit_wrapper.R b/bin/cdhit_wrapper.R index 38b863a..dead7b7 100644 --- a/bin/cdhit_wrapper.R +++ b/bin/cdhit_wrapper.R @@ -1,5 +1,5 @@ #! /bin/Rscript -library("optparse") +if (!require(optparse)) install.packages("optparse"); library(optparse) option_list <- list( make_option(opt_str = c("-i", "--input"), default = NULL, help = "Input bed-file. Fourth column is expected to contain names, last column must be sequences.", metavar = "character"), @@ -71,6 +71,8 @@ opt <- parse_args(opt_parser) #' #' @details If there is a header supplied other then the default data.table naming scheme ('V1', 'V2', etc.) it will be kept and extended. #' +#' @author Hendrik Schultheis +#' cdhitest <- function(input, identity = 0.8, coverage = 8, output = "cluster.bed", clean = TRUE, threads = 1, global = 0, band_width = 20, memory = 800, word_length = 3, throw_away_sequences = 5, length_dif_cutoff_shorter_p = 0, length_dif_cutoff_shorter_n = 999999, alignment_coverage_longer_p = 0, alignment_coverage_longer_n = 99999999, alignment_coverage_shorter_p = 0, alignment_coverage_shorter_n = 99999999, max_unmatched_longer_p = 1, max_unmatched_shorter_p = 1, max_unmatched_both_n = 99999999, fast_cluster = 1, strand = 0, match = 2, mismatch = -2, gap = -6, gap_ext = -1, sort_cluster_by_size = 1) { if (system("which cd-hit-est", ignore.stdout = FALSE) != 0) { stop("Required program CD-HIT not found! Please check whether it is installed.") diff --git a/bin/reduce_sequence.R b/bin/reduce_sequence.R index 53ac69f..5834b04 100644 --- a/bin/reduce_sequence.R +++ b/bin/reduce_sequence.R @@ -1,5 +1,5 @@ #! /bin/Rscript -library("optparse") +if (!require(optparse)) install.packages("optparse"); library(optparse) option_list <- list( make_option(opt_str = c("-i", "--input"), default = NULL, help = "Input bed-file. Last column must be sequences.", metavar = "character"), @@ -35,6 +35,8 @@ opt <- parse_args(opt_parser) #' #' @details If there is a header supplied other then the default data.table naming scheme ('V1', 'V2', etc.) it will be kept. #' +#' @author Hendrik Schultheis +#' reduce_sequence <- function(input, kmer = 10, motif = 10, output = "reduced.bed", threads = NULL, clean = TRUE, minoverlap_kmer = kmer - 1, minoverlap_motif = ceiling(motif / 2), min_seq_length = max(c(motif, kmer)), motif_occurrence = 1) { if (system("which jellyfish", ignore.stdout = TRUE) != 0) { stop("Required program jellyfish not found! Please check whether it is installed.")