bdaisley / isolateR

Automated processing of Sanger sequencing data, taxonomic profiling, and generation of microbial strain libraries
Other
9 stars 1 forks source link

isoQC step sometimes does not fail sequences below the trim threshold #6

Closed vancurens closed 5 months ago

vancurens commented 5 months ago

The attached sample sequences result in a PASS in the isoQC step (leading to their inclusion in the taxonomy and library steps) despite having a trimmed sequencing length below the set threshold (400). isoQC_badtrimlen.zip

Example command:

isoQC.S4 <- isoQC(input=in1,
                  export_html=TRUE,
                  export_csv=TRUE,
                  export_fasta=TRUE,
                  verbose=FALSE,
                  min_phred_score = 20,
                  min_length = 400,
                  sliding_window_cutoff = NULL,
                  sliding_window_size = 15,
                  date=NULL)

Output: image

bdaisley commented 5 months ago

Traced this error back to a wrong not equal to call in the following lines of the "isoQC_function.R" code:

101  if(!is.null(min_length)){
102      min_length <- 200
103    }

This resulted in min_length being overwritten when it was anything other than NULL, which is opposite of the expected behaviour. Corrected to the following:

101  if(is.null(min_length)){
102      min_length <- 200
103    }

Fixed in commit db2c0d0