@@ -58,7 +58,7 @@ contigChunks <- function(pileup, chunkSize) {
5858# ' 100 bp windows/bins.
5959# ' @param chunkSize If `mode`="genome" OR if `mode`="metagenome" and `chunkContigs`=TRUE,
6060# ' chunk the genome or contigs, respectively, into smaller subsets for pattern-matching.
61- # ' `chunkSize` determines the size (in bp) of each 'chunk'. Default is 50000 .
61+ # ' `chunkSize` determines the size (in bp) of each 'chunk'. Default is 100000 .
6262# ' @keywords internal
6363genomeChunks <- function (pileup , chunkSize ) {
6464 refName <- rep(NA , nrow(pileup ))
@@ -99,10 +99,13 @@ genomeChunks <- function(pileup, chunkSize) {
9999# ' 100 bp windows/bins.
100100# ' @param windowSize The number of basepairs to average read coverage values over.
101101# ' @param mode Either "genome" or "metagenome"
102+ # ' @param chunkContigs TRUE or FALSE, If TRUE and `mode`="metagenome", contigs longer
103+ # ' than the `chunkSize` will be 'chunked' into smaller subsets and pattern-matching
104+ # ' will be performed on each subset. Default is FALSE.
102105# ' @param verbose TRUE or FALSE. Print progress messages to console. Default is TRUE.
103106# ' @importFrom stringr str_extract
104107# ' @keywords internal
105- linkChunks <- function (bestMatchList , pileup , windowSize , mode , verbose ){
108+ linkChunks <- function (bestMatchList , pileup , windowSize , mode , chunkContigs , verbose ){
106109 potLink <- rep(NA , length(bestMatchList ))
107110 refNames <- vapply(seq_along(bestMatchList ), function (i ){bestMatchList [[i ]][[8 ]]}, character (1 ))
108111 classifVector <- vapply(seq_along(bestMatchList ), function (i ){
@@ -111,7 +114,7 @@ linkChunks <- function(bestMatchList, pileup, windowSize, mode, verbose){
111114 startPos <- bestMatchList [[i ]][[4 ]]
112115 endPos <- bestMatchList [[i ]][[5 ]]
113116 pileupSubset <- pileup [which(pileup [, 1 ] == refName ), ]
114- pileupSubset <- changewindowSize(pileupSubset , windowSize , mode )
117+ pileupSubset <- changewindowSize(pileupSubset , windowSize , chunkContigs , mode )
115118 if (grepl(" chunk" , refName ) == FALSE ) {
116119 " NoChunk"
117120 } else if (classification == " NoPattern" ) {
@@ -140,7 +143,7 @@ linkChunks <- function(bestMatchList, pileup, windowSize, mode, verbose){
140143 classifDf [rightIdx ,3 ] <- " no"
141144 }
142145 }
143- if (verbose == TRUE ){
146+ if (verbose ){
144147 if (" link" %in% classifDf [,3 ]){
145148 linkIdxs <- which(classifDf [,3 ] == " link" )
146149 lapply(seq_along(linkIdxs ), function (x ){
0 commit comments