Commit f98ca87f authored by aditya.bhagwat's avatar aditya.bhagwat
Browse files

Fix read_bowtie_results: for mismatch=0 case

parent 9c0e2819
......@@ -151,7 +151,8 @@ read_bowtie_results <- function(outfile){
outfile,
col.names = c('readname', 'strand', 'target', 'position',
'readseq', 'quality', 'matches', 'mismatches'))
dt[ , mismatch := stringi::stri_count_fixed(mismatches, '>')]
dt[ is.na(mismatches), mismatch := 0]
dt[!is.na(mismatches), mismatch := stringi::stri_count_fixed(mismatches, '>')]
results <- dt %>%
extract( , .N, keyby = .(readname, mismatch)) %>%
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment