comprna / METEORE

Automatic DNA methylation detection from nanopore tools and their consensus model
MIT License
72 stars 18 forks source link

Error in rule calculate_frequency some suggestions #4

Closed xpli2020 closed 3 years ago

xpli2020 commented 3 years ago

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, 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.

Thanks,

zakayuen commented 3 years ago

Thank you for your suggestion. This would help other people who have the same problem. Fixed in 84ef573

Zaka