library(kmerclust) library(tidyverse) args <- commandArgs(trailingOnly = TRUE) print(args) load(file = paste0(args[1], ".Rdata")) res <- count %>% dplyr::select(count_m, count_f) %>% mutate( count_m = round(count_m), count_f = round(count_f) ) %>% dplyr::filter(count_m + count_f > 0) %>% as.matrix() %>% em_bipoiss_clust(nbatch = 100, max_iter = 1000) save(res, file = paste0(args[1], "_clust_", args[3], ".Rdata")) #count %>% # mutate( # count_m = round(count_m), # count_f = round(count_f) # ) %>% # dplyr::filter(count_m + count_f > 0) %>% # dplyr::mutate(chromosome = res$chromosome) %>% # dplyr::select(name, chromsome) %>% # write_csv2(file = paste0(args[1], "_clust_", args[3], ".csv"))