Plot kmer dist vs. align dist
#library("dada2"); packageVersion("dada2")
library("ggplot2"); packageVersion("ggplot2")
## [1] '1.0.1'
# System-agnostic file path
fooFile = system.file("extdata", "sam1F.fastq.gz", package="dada2")
derep1 <- derepFastq(fooFile)
## Found more than one class "file" in cache; using the first, from namespace 'BiocGenerics'
## Found more than one class "file" in cache; using the first, from namespace 'BiocGenerics'
## Found more than one class "file" in cache; using the first, from namespace 'BiocGenerics'
## Found more than one class "file" in cache; using the first, from namespace 'BiocGenerics'
## Found more than one class "file" in cache; using the first, from namespace 'BiocGenerics'
## Found more than one class "file" in cache; using the first, from namespace 'BiocGenerics'
foo <- evaluate_kmers(names(getUniques(derep1)), 5, getDadaOpt("SCORE_MATRIX"), getDadaOpt("GAP_PENALTY"), 16, 5000)
# Plot the Alignment versus Kmer distance as density plot
ggplot(data=foo, aes(x=kmer, y=align)) +
geom_bin2d(binwidth = c(0.005, 0.005)) +
geom_vline(xintercept=getDadaOpt("KDIST_CUTOFF"), linetype="dashed")
