I encountered the error in calculate_frequency with R 4.0 version when running the demo, specifically a missing value error for the dataframe. There were two places I needed to correct to make the demo run. I would suggest two small edits in the run_nanopolish.R script. The first place is df <- read.table(args[1], header = TRUE, sep="\t", stringsAsFactors = TRUE), if not setting the stringsAsFactors to True, the df$Chr <- as.character(levels(df$Chr))[df$Chr] and
df$Strand <- as.character(levels(df$Strand))[df$Strand] would return missing values for the columns. The second issue is df_m <-count(df[df$Log.like.ratio > 0, ], c("Chr", "Pos","Strand")) and
df_unm <- count(df[df$Log.like.ratio < 0, ], c("Chr", "Pos","Strand")), need to use name space plyr::count() for the correct count function.
Hi,
I encountered the error in calculate_frequency with R 4.0 version when running the demo, specifically a missing value error for the dataframe. There were two places I needed to correct to make the demo run. I would suggest two small edits in the run_nanopolish.R script. The first place is
df <- read.table(args[1], header = TRUE, sep="\t", stringsAsFactors = TRUE)
, if not setting the stringsAsFactors to True, thedf$Chr <- as.character(levels(df$Chr))[df$Chr]
anddf$Strand <- as.character(levels(df$Strand))[df$Strand]
would return missing values for the columns. The second issue isdf_m <-count(df[df$Log.like.ratio > 0, ], c("Chr", "Pos","Strand"))
anddf_unm <- count(df[df$Log.like.ratio < 0, ], c("Chr", "Pos","Strand"))
, need to use name spaceplyr::count()
for the correct count function.Thanks,