Skip to content

Commit

Permalink
Fix regex counting of tabs in read_report (fixes #74)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbreitwieser committed Apr 13, 2021
1 parent 5f05969 commit 8dd99bb
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 37 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: pavian
Type: Package
Title: Visualize and analyze metagenomics classification results
Version: 1.0.0
Version: 1.1.0
URL: https://github.com/fbreitwieser/pavian
BugReports: https://github.com/fbreitwieser/pavian/issues
Authors@R: person("Florian P", "Breitwieser", email = "[email protected]", role = c("aut", "cre"))
Expand All @@ -20,6 +20,6 @@ Remotes: github::fbreitwieser/sankeyD3,
github::fbreitwieser/shinyFileTree
License: GPL-3
LazyData: TRUE
RoxygenNote: 6.1.1
RoxygenNote: 7.1.0
VignetteBuilder: knitr
NeedsCompilation: no
4 changes: 3 additions & 1 deletion R/datainput-read_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ read_report <- function(myfile, has_header=NULL, check_file = FALSE) {
is_metaphlan_fmt <- grepl("Metaphlan2_Analysis$", first.line)
is_krakenu_fmt <- grepl("^.?%\treads\ttaxReads\tkmers", first.line)
is_kaiju_fmt <- grepl("^ *%\t *reads", first.line)
ntabs <- as.numeric(regexpr('\t', first.line))

ntabs <- lengths(regmatches(first.line, gregexpr("\t", first.line)))

nrows <- ifelse(isTRUE(check_file), 5, -1)
if (!is_krakenu_fmt && is_kaiju_fmt) {
cont <- readLines(myfile)
Expand Down
16 changes: 13 additions & 3 deletions man/comparisonModule.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions man/dataInputModule.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions man/dataInputModuleUI.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/filter_taxa.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions man/merge_reports2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions man/read_report2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/read_sample_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions man/read_server_directory1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions man/reportOverviewModule.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions man/runApp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions man/sampleModule.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified tests/testthat/read_report/ref_output/k2uniq-report-res.rds
Binary file not shown.

0 comments on commit 8dd99bb

Please sign in to comment.