Skip to content

Commit

Permalink
added another threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
marinawitherell committed Aug 2, 2023
1 parent 553185b commit 9ce117b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/sendsketch_filter.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,19 @@

# Options
ani_threshold <- 90
complt_threshold <- 70

# Parse inputs
args = commandArgs(trailingOnly = TRUE)
data <- read.csv(args[1], skip = 2, header = TRUE, sep = '\t')

# Format table
data$ANI <- as.numeric(sub(pattern = "%", replacement = "", fixed = TRUE, data$ANI))
data$Complt <- as.numeric(sub(pattern = "%", replacement = "", fixed = TRUE, data$Complt))

# Filter table by match quality
data <- data[data$ANI > ani_threshold, ]
data <- data[data$Complt > complt_threshold, ]

# Extract taxon info
data$genus <- gsub(".*g:(.+);s:.*", "\\1", data$taxonomy)
Expand Down

0 comments on commit 9ce117b

Please sign in to comment.