Gitlab is now using https://gitlab.lcsb.uni.lu as it's primary address. Please update your bookmarks. FAQ.

Commit 4fea8c56 authored by Laura Denies's avatar Laura Denies
Browse files

update AMR_MGE.R

parent 72cf8aea
......@@ -36,7 +36,7 @@ PlasFlow <- separate(data= PlasFlow, col=label, into=c("left", "right"), sep="\\
PlasFlow <- PlasFlow %>% select(1,2)
colnames(PlasFlow) <-c("Contig_ID","PlasFlow_prediction")
PlasFlow <- PlasFlow %>% filter(Contig_ID != "contig_name")
#PlasFlow$Contig_ID <- sprintf("%010d", PlasFlow$Contig_ID)
PlasFlow$Contig_ID <- sprintf("%010d", PlasFlow$Contig_ID)
## MOBsuite
MOB_suite <- read.delim(file = snakemake@input[["MOB_suite"]], header=TRUE)
......@@ -45,7 +45,7 @@ MOB_suite$mash_neighbor_distance <- as.numeric(as.character(MOB_suite$mash_neigh
MOB_suite$MOB_suite_prediction <- if_else(MOB_suite$mash_neighbor_distance <= 0.06 , "plasmid","-")
MOB_suite <- MOB_suite %>% select(1,27) %>% filter(MOB_suite_prediction == "plasmid")
colnames(MOB_suite)<- c("Contig_ID","MOB_suite_prediction")
#MOB_suite$Contig_ID <- sprintf("%010d", MOB_suite$Contig_ID)
MOB_suite$Contig_ID <- sprintf("%010d", MOB_suite$Contig_ID)
## Combine PlasFlow and MOB_suite
Plasmid <- merge(PlasFlow, MOB_suite, by="Contig_ID", all = TRUE)
......@@ -105,6 +105,7 @@ Phage$Phage_database <- ifelse(Phage$Phage_prediction == "phage" & Phage$VirFind
ifelse(Phage$Phage_prediction == "phage" & Phage$VirFinder_prediction == "phage" & Phage$VirSorter_prediction != "phage", "DeepVirFinder",
ifelse(Phage$Phage_prediction == "phage" & Phage$VirFinder_prediction != "phage" & Phage$VirSorter_prediction == "phage", "VIRSorter","-")))
Phage <- Phage %>% select(1,6,7)
Phage$Contig_ID <- sprintf("%010d", Phage$Contig_ID)
# Combine MGEs
MGEs <- merge(Plasmid, Phage, by = "Contig_ID", all=TRUE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment