r result$config$op_full_name

Uses vsearch to cluster sequences. Only the centroids of clusters above a specified threshold are reported.

opts_chunk$set(echo=FALSE)
opts_chunk$set(warning=FALSE)
opts_chunk$set(fig.pos = 'H')
options(scipen=99)

library(MotifBinner2)

if (!exists('result'))
{
  stop('no result variable')
}
if (class(result) != 'vsearchCluster')
{
  stop('class of result variable incorrect')
}
fig.cap1 <- "Figure: Number of clusters by cluster size. The y axis counts the number of clusters of the size given on the x-axis. Note the log scale on the y-axis."
fig.cap2 <- "Figure: Number of clusters by cluster size. The y axis counts the number of clusters of the size given on the x-axis. Note the log scale on both axes."
figure_path <- paste('figure_', result$config$op_full_name, '/', sep = '')

Identity threshold: r result$config$op_args$id

Number of clusters: r sum(result$metrics$per_read_metrics$is_centroid)

centroid_details <- subset(result$metrics$per_read_metrics, is_centroid == 1)
cluster_sizes <- data.frame(
  size = as.numeric(names(table(centroid_details$size))),
  n_clus = as.numeric(table(centroid_details$size))
  )
print(ggplot(cluster_sizes, aes(x = size, y = n_clus)) + 
      geom_point() + 
      scale_y_log10() + 
      labs(x = 'Cluster Size',
           y = 'Number of Clusters')
      )
print(ggplot(cluster_sizes, aes(x = size, y = n_clus)) + 
      geom_point() + 
      scale_y_log10() + 
      scale_x_log10() + 
      labs(x = 'Cluster Size',
           y = 'Number of Clusters')
      )
kable_summary(result$summary)

timingTable(result)


HIVDiversity/MotifBinner2 documentation built on May 6, 2019, 6:44 p.m.