Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Laura Denies
PathoFact
Commits
4fea8c56
Commit
4fea8c56
authored
Jul 21, 2020
by
Laura Denies
Browse files
update AMR_MGE.R
parent
72cf8aea
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/AMR_MGE.R
View file @
4fea8c56
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment