Sha256: ecf799a3464768b3507b34e301f7dab21d3e5a61129b0138aaa172af86d3c979
Contents?: true
Size: 353 Bytes
Versions: 172
Compression:
Stored size: 353 Bytes
Contents
library(magrittr) nucleotide_count <- function(input) { strand_chr <- strsplit(input, "")[[1]] nucleotides <- c("A", "C", "G", "T") if (length(strand_chr) > 0 && !all(strand_chr %in% nucleotides)) { stop("Invalid nucleotide in strand") } nucleotides %>% sapply(function(x) {sum(x == strand_chr)}) %>% as.list() }
Version data entries
172 entries across 172 versions & 1 rubygems