Skip to content

bhit_map fails when plates contain missing data #35

@Swarchal

Description

@Swarchal
Error in if (platemap[row, "values"] > threshold) { : 
  missing value where TRUE/FALSE needed

platetools/R/bhit_map.R

Lines 102 to 111 in 2934bd8

# calculate whether values are beyond the threshold; defined as hit or null
for (row in 1:nrow(platemap)) {
if (platemap[row, 'values'] > threshold) {
platemap$hit[row] <- "hit"
} else if (platemap[row, 'values'] < (-1*threshold)) {
platemap$hit[row] <- "neg_hit"
} else {
platemap$hit[row] <- "null"
}
}

This can be fixed with an initial if statement, checking if the value is NaN, and if so, return an NaN.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions