Commit 1bb3c5e0 authored by Laura Denies's avatar Laura Denies

Add new file

parent b1528e5d
#!/user/bin/env R
library(tidyverse)
attc <- read.delim(file = snakemake@input[["attc"]])
attc$ID <- gsub(" ","",attc$ID)
attc <- attc %>% filter(Vscore <=1)
attc$attc_prediction <- "attc"
intI <- read.table(file = snakemake@input[["intI"]], quote="\"") %>% select(3,13) %>% filter(V13 <= 1)
colnames(intI) <- c("ID","E_value")
intI$intI_prediction <- "intI"
Integrons <- merge(attc, intI, by="ID", all=TRUE) %>% select(1,3,5)
Integrons <- unique(Integrons)
Integrons$attc_prediction <- fct_explicit_na(Integrons$attc_prediction, na_level = "-")
Integrons$intI_prediction <- fct_explicit_na(Integrons$intI_prediction, na_level = "-")
Integrons$Prediction <- ifelse(Integrons$attc_prediction == "attc" & Integrons$intI_prediction == "intI", "complete",
ifelse(Integrons$attc_prediction == "attc" & Integrons$intI_prediction == "-", "intI_incomplete",
ifelse(Integrons$attc_prediction == "-" & Integrons$intI_prediction == "intI", "attc_incomplete", "incomplete")))
write.table(Integrons, file = snakemake@output[["Integrons"]], sep="\t", row.names=FALSE, quote=FALSE)
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