-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path04_DECIPHER_journal.R
More file actions
63 lines (44 loc) · 1.72 KB
/
04_DECIPHER_journal.R
File metadata and controls
63 lines (44 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
##################################################################
# CHAPTER 4. Design Primers That Yield Group-Specific Signatures #
##################################################################
# Set the dir
main_dir <- dirname(rstudioapi::getSourceEditorContext()$path)
setwd(main_dir)
# Load/install required packages
#if (!requireNamespace("BiocManager", quietly=TRUE))
#install.packages("BiocManager")
#BiocManager::install("DECIPHER")
#install.packages("RSQLServer")
#devtools::install_github('imanuelcostigan/RSQLServer')
system("hybrid-min-V")
library(DECIPHER)
library(DBI)
library(DECIPHER)
library("RSQLServer")
library("RSQLite")
library("writexl")
fas <- "Alignment/Align-SaPh/SaPh-current.414.gen"
dbConn <- dbConnect(SQLite(), ":memory:")
N <- Seqs2DB(fas, "FASTA", dbConn, "")
N # number of sequences in the database
desc <- dbGetQuery(dbConn, "select description from Seqs")$description
unique(desc)
Add2DB(data.frame(identifier=desc, stringsAsFactors=FALSE), dbConn)
# Designing primers for community fingerprinting (FLP):
TYPE <- "length"
# it is important to have a width range of lengths
MIN_SIZE <- 70 # base pairs
MAX_SIZE <- 300
# define bin boundaries for distinguishing length,
# the values below require high-resolution, but
# the bin boundaries can be redefined for lower
# resolution experiments such as gel runs
RESOLUTION <- 1
LEVELS <- 2 # presence/absence of the length
example_primers <- DesignSignatures(dbConn,
type=TYPE,
minProductSize=MIN_SIZE,
maxProductSize=MAX_SIZE,
resolution=RESOLUTION,
levels=LEVELS)
write_xlsx(example_primers, "primers.xlsx")