Skip to content

Commit

Permalink
Update mmstats.R
Browse files Browse the repository at this point in the history
Fixes integer overflow when running mmstats on big assemblies. Solves issue #37
  • Loading branch information
Kirk3gaard authored May 13, 2021
1 parent b7c7a2a commit 2f7f09f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/mmstats.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ mmstats <- function(mm,

# N50
lengths <- sort(as.integer(mm$length), decreasing = TRUE)
N50 <- lengths[which(cumsum(lengths) >= lengthTotal / 2)[1]]
N50 <- lengths[which(cumsum(as.numeric(lengths)) >= lengthTotal / 2)[1]]

# essential genes
if (any(colnames(mm) == "geneID")) {
Expand Down

1 comment on commit 2f7f09f

@KasperSkytte
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks. Remember to uptick version. Website will be regenerated automatically with every commit by GitHub actions. If any changes to documentation also run a devtools::document() before commiting. For larger changes to code also run a devtools::check(). (Got tired of doing this so many times, so I made https://kasperskytte.github.io/ksatools/reference/gogoawesomepkg.html to do all important steps at once before every push)

Please sign in to comment.