MinSNPs Workflow"

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(minSNPs)
library(BiocParallel) # optional, but needed for parallel processing

Reading & processing input for further analysis

read_fasta is provided as a way to read fasta file, equivalent function, e.g., from Biostrings and read.fasta from seqinr can be used.

isolates_from_default <- read_fasta(
  system.file("extdata", "Chlamydia_mapped.fasta", package = "minSNPs"))
processed_from_default <- process_allele(isolates_from_default)

Subsequent analyses can use output from process_allele.

Identifying SNPs with high Simpson's index

high_d_snps <- find_optimised_snps(seqc = processed_from_default,
  metric = "simpson", number_of_result = 1, max_depth = 1,
  included_positions = c(), excluded_positions = c())

Identifying SNPs discriminating a group of interest

discriminating_snps <- find_optimised_snps(seqc = processed_from_default,
  metric = "percent", number_of_result = 1, max_depth = 1,
  included_positions = c(), excluded_positions = c(),
  goi = c("A_D213", "H_S1432"))

Displaying/saving result

cat("High D SNPs\n")
output_result(high_d_snps)
cat("SNPws discriminating against A_D213, H_S1432\n")
output_result(discriminating_snps)
output_result(high_d_snps, view = "csv",
  file_name = "high_d_snps.csv")
output_result(discriminating_snps, view = "csv",
  file_name = "discriminating_snps.csv")


Try the minSNPs package in your browser

Any scripts or data that you put into this service are public.

minSNPs documentation built on May 29, 2024, 2:48 a.m.