setwd("//wsl.localhost/Ubuntu/home/kasmanas/mSpreadComp")
getwd()
setwd("/home/kasmanas/pCloudDrive/Chapter3_DietMAGs/")
setwd("//wsl.localhost/Ubuntu/home/kasmanas/mSpreadComp")
library("optparse")
library("dplyr")
library("tidyr")
library("ggplot2")
library("data.table")
library("viridis")
library("pheatmap")
library("forcats")
#target_gene <- "Gene_id"
target_gene <- "Gene_class"
mags_data_df <- data.table::fread("test_output/genome_quality_norm/genome_data_merged.csv")
mags_data_df <- data.table::fread("test_output/03_mspread_analysis_out/genome_quality_norm/genome_data_merged.csv")
mags_data_df <- data.table::fread("test_out/03_mspread_analysis_out/genome_quality_norm/genome_data_merged.csv")
View(mags_data_df)
selected_lib <- data.table::fread("test_out/03_mspread_analysis_out/genome_quality_norm/selected_samples.csv")
gene_df <- data.table::fread("test_data/deeparg_df_format_mSpread.csv")
View(gene_df)
norm_gene_prev_df <- data.table::fread("test_out/03_mspread_analysis_out/genome_quality_norm/gene_prevalence_per_library.csv")
vf_df <- data.table::fread("test_data/victors_df_format_mSpread.csv")
View(vf_df)
patho_db <- data.table::fread("installation/dependencies/patho_ncbi_20230222_taxa.csv")
View(patho_db)
View(selected_lib)
selected_lib <- as.character(selected_lib$x)
mags_data_df <- mags_data_df %>%
filter(Library %in% selected_lib) %>%
as.data.frame(.)
gene_df <- gene_df %>%
merge.data.frame(.,
mags_data_df[,c("Library", "Genome", "Target")],
by = "Genome") %>%
filter(Library %in% selected_lib)
norm_gene_prev_df <- norm_gene_prev_df %>%
filter(Library %in% selected_lib)
View(vf_df)
View(vf_df)
vf_df <- vf_df %>%
filter(Genome %in% mags_data_df$Genome) %>%
as.data.frame(.)
mags_data_df$Genome
View(vf_df)
vf_df <- data.table::fread("test_data/victors_df_format_mSpread.csv")
vf_df$Genome
vf_df$Genome %in% mags_data_df$Genome
c(unique(mags_data_df$Genome))
length(c(unique(mags_data_df$Genome)))
vf_df <- vf_df %>%
filter(Genome %in% c(unique(mags_data_df$Genome))) %>%
as.data.frame(.)
class(c(unique(mags_data_df$Genome))
)
c(unique(mags_data_df$Genome))
as.vector(c(unique(mags_data_df$Genome)))
vf_df <- data.table::fread("test_data/victors_df_format_mSpread.csv")
vf_df_t <- vf_df %>%
filter(Genome %in% as.vector(c(unique(mags_data_df$Genome)))) %>%
as.data.frame(.)
View(vf_df)
