Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diphtOscan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Biodiversity and Epidemiology of Bacterial Pathogens
diphtOscan
Commits
73c72ea6
Commit
73c72ea6
authored
1 year ago
by
mrethore
Browse files
Options
Downloads
Patches
Plain Diff
Integron Fender Dependancies Testing & Minor Changes
parent
e813e6cc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4
Global Refactor
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
__main__.py
+21
-8
21 additions, 8 deletions
__main__.py
module/updating_database.py
+1
-6
1 addition, 6 deletions
module/updating_database.py
with
22 additions
and
14 deletions
__main__.py
+
21
−
8
View file @
73c72ea6
...
@@ -114,9 +114,7 @@ from module.utils import (
...
@@ -114,9 +114,7 @@ from module.utils import (
get_chromosome_mlst_results
,
get_chromosome_mlst_results
,
get_tox_results
,
get_tox_results
,
get_chromosome_mlst_header
,
get_chromosome_mlst_header
,
get_tox_header
,
get_tox_header
,
get_virulence
,
get_virulence_extended
,
delete_virulence_extended
,
delete_virulence_extended
,
is_non_zero_file
,
is_non_zero_file
,
armfinder_to_table
,
armfinder_to_table
,
...
@@ -134,19 +132,26 @@ def test_multiple_dependancies(dependancies:List[str]):
...
@@ -134,19 +132,26 @@ def test_multiple_dependancies(dependancies:List[str]):
print
(
f
'
/!\ Warning /!\ :
{
dependancy
}
missing in path!
'
)
print
(
f
'
/!\ Warning /!\ :
{
dependancy
}
missing in path!
'
)
sys
.
exit
(
-
1
)
sys
.
exit
(
-
1
)
def
test_required_dependancy
(
args
):
def
test_required_dependancy
(
args
):
diphtoscan_dependancies
=
[
"
mash
"
,
'
amrfinder
'
,
'
hmmsearch
'
,
'
makeblastdb
'
,
'
blastn
'
,
'
blastp
'
]
diphtoscan_dependancies
=
[
"
mash
"
,
'
amrfinder
'
,
'
hmmsearch
'
,
'
makeblastdb
'
,
'
blastn
'
,
'
blastp
'
]
joly_tree_path
=
"
diphtoscan/script/JolyTree/JolyTree.sh
"
joly_tree_path
=
"
diphtoscan/script/JolyTree/JolyTree.sh
"
joly_tree_dependancies
=
[
"
gawk
"
,
'
fastme
'
,
'
REQ
'
]
joly_tree_dependancies
=
[
"
gawk
"
,
'
fastme
'
,
'
REQ
'
]
integron_fender_dependancies
=
[
'
hmmsearch
'
,
'
cmsearch
'
,
'
prodigal
'
]
if
args
.
assemblies
==
None
:
#TODO :Ensure that dependencies are not required to update the database
return
args
print
(
"
Dependency testing
"
)
subprocess
.
run
([
"
echo
"
,
"
Dependency testing
"
]
)
test_multiple_dependancies
(
diphtoscan_dependancies
)
test_multiple_dependancies
(
diphtoscan_dependancies
)
if
args
.
integron
:
if
args
.
integron
:
rc
=
test_unique_dependency
(
"
integron_finder
"
)
rc
=
test_unique_dependency
(
"
integron_finder
"
)
test_multiple_dependancies
(
integron_fender_dependancies
)
if
rc
==
0
:
if
rc
==
0
:
args
.
integron
=
True
args
.
integron
=
True
else
:
else
:
print
(
'
/!\ Warning /!\ : integron_finder missing in path! Integron analysis not carried out.
'
)
print
(
'
/!
\
\
Warning /!
\
\
: integron_finder missing in path! Integron analysis not carried out.
'
)
args
.
integron
=
False
args
.
integron
=
False
if
args
.
tree
:
if
args
.
tree
:
...
@@ -154,13 +159,12 @@ def test_required_dependancy(args):
...
@@ -154,13 +159,12 @@ def test_required_dependancy(args):
test_multiple_dependancies
(
joly_tree_dependancies
)
test_multiple_dependancies
(
joly_tree_dependancies
)
args
.
tree
=
True
args
.
tree
=
True
else
:
else
:
print
(
'
/!\ Warning /!\ : JolyTree.sh missing in /diphtoscan/script/JolyTree/ ! Joly_tree representation not carried out.
'
)
print
(
'
/!
\
\
Warning /!
\
\
: JolyTree.sh missing in /diphtoscan/script/JolyTree/ ! Joly_tree representation not carried out.
'
)
args
.
tree
=
False
args
.
tree
=
False
print
(
'
\n
'
)
print
(
'
\n
'
)
return
args
return
args
def
parse_arguments
():
def
parse_arguments
():
parser
=
argparse
.
ArgumentParser
(
description
=
'
diphtOscan: a tool for characterising
'
parser
=
argparse
.
ArgumentParser
(
description
=
'
diphtOscan: a tool for characterising
'
'
virulence and resistance in Corynebacterium
'
,
'
virulence and resistance in Corynebacterium
'
,
...
@@ -231,7 +235,6 @@ def parse_arguments():
...
@@ -231,7 +235,6 @@ def parse_arguments():
args
.
path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
args
.
path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
args
=
test_required_dependancy
(
args
)
args
=
test_required_dependancy
(
args
)
return
args
return
args
...
@@ -245,9 +248,19 @@ if __name__ == "__main__":
...
@@ -245,9 +248,19 @@ if __name__ == "__main__":
update_database
(
args
,
MLST_db
,
TOX_db
)
update_database
(
args
,
MLST_db
,
TOX_db
)
if
args
.
assemblies
==
None
:
sys
.
exit
(
0
)
resistance_db
=
find_resistance_db
(
args
)
resistance_db
=
find_resistance_db
(
args
)
prediction_db
=
args
.
path
+
"
/data/virulence
"
prediction_db
=
args
.
path
+
"
/data/virulence
"
try
:
os
.
makedirs
(
args
.
outdir
)
print
(
"
Directory
'
%s
'
created successfully
\n
"
%
args
.
outdir
)
except
OSError
:
print
(
"
Directory
'
%s
'
can not be created
\n
"
%
args
.
outdir
)
sys
.
exit
(
0
)
dict_results
=
{}
dict_results
=
{}
data_resistance
=
pd
.
DataFrame
()
data_resistance
=
pd
.
DataFrame
()
for
genome
in
args
.
assemblies
:
for
genome
in
args
.
assemblies
:
...
...
This diff is collapsed.
Click to expand it.
module/updating_database.py
+
1
−
6
View file @
73c72ea6
...
@@ -20,9 +20,4 @@ def update_database(arguments, mlst_database:tuple, tox_database:tuple):
...
@@ -20,9 +20,4 @@ def update_database(arguments, mlst_database:tuple, tox_database:tuple):
print
(
'
bash
'
+
arguments
.
path
+
'
/data/resistance/update_database_resistance.sh
'
)
print
(
'
bash
'
+
arguments
.
path
+
'
/data/resistance/update_database_resistance.sh
'
)
os
.
system
(
'
bash
'
+
arguments
.
path
+
'
/data/resistance/update_database_resistance.sh
'
)
os
.
system
(
'
bash
'
+
arguments
.
path
+
'
/data/resistance/update_database_resistance.sh
'
)
print
(
"
... done
\n\n\n
"
)
print
(
"
... done
\n\n\n
"
)
try
:
os
.
makedirs
(
arguments
.
outdir
)
\ No newline at end of file
print
(
"
Directory
'
%s
'
created successfully
\n
"
%
arguments
.
outdir
)
except
OSError
:
print
(
"
Directory
'
%s
'
can not be created
\n
"
%
arguments
.
outdir
)
sys
.
exit
(
0
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment