Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor 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
schwede
openstructure
Commits
5f7d6530
Commit
5f7d6530
authored
12 years ago
by
Gabriel Studer
Browse files
Options
Downloads
Patches
Plain Diff
some finetuning, especially in CreateDB function
parent
a12356ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/bindings/pymod/blast.py
+21
-13
21 additions, 13 deletions
modules/bindings/pymod/blast.py
with
21 additions
and
13 deletions
modules/bindings/pymod/blast.py
+
21
−
13
View file @
5f7d6530
...
@@ -130,33 +130,41 @@ class BlastError(RuntimeError):
...
@@ -130,33 +130,41 @@ class BlastError(RuntimeError):
else
:
else
:
return
self
.
brief
return
self
.
brief
def
CreateDB
(
infasta
,
dbout
,
mkdb_cmd
=
'
makeblastdb
'
):
def
CreateDB
(
infasta
,
dbout
,
mkdb_cmd
=
None
):
"""
"""
Create a blast DB from a fasta file
Create a blast DB from a fasta file
:param infasta: the pdb fasta from which the database will be created
:param infasta: the pdb fasta from which the database will be created
:type infasta: :class:`string`
:type infasta: :class:`string`
:param dbout: output location for blatDB file
:param dbout: output location for bla
s
tDB file
:type infasta: :class:`string`
:type infasta: :class:`string`
"""
"""
try
:
if
mkdb_cmd
==
None
:
exe
=
settings
.
Locate
(
'
makeblastdb
'
)
args
=
[
exe
,
'
-in
'
,
infasta
,
'
-max_file_sz 10GB -out
'
,
dbout
,
'
-dbtype
'
,
'
prot
'
]
except
:
try
:
try
:
exe
=
settings
.
Locate
(
'
forma
tdb
'
)
exe
=
settings
.
Locate
(
'
makeblas
tdb
'
)
args
=
[
exe
,
'
-i
'
,
infasta
,
'
-v
'
,
str
(
10000
),
'
-n
'
,
dbout
]
args
=
[
exe
,
'
-i
n
'
,
infasta
,
'
-max_file_sz 10GB -out
'
,
dbout
,
'
-dbtype
'
,
'
prot
'
]
except
:
except
:
raise
BlastError
(
'
could not find makeblastdb/formatdb executable
'
)
try
:
exe
=
settings
.
Locate
(
'
formatdb
'
)
args
=
[
exe
,
'
-i
'
,
infasta
,
'
-v
'
,
str
(
10000
),
'
-n
'
,
dbout
]
except
:
raise
RuntimeError
(
'
could not find makeblastdb/formatdb executable
'
)
else
:
if
os
.
path
.
basename
(
mkdb_cmd
)
==
'
makeblastdb
'
:
exe
=
settings
.
Locate
(
'
makeblastdb
'
,
explicit_file_name
=
mkdb_cmd
)
args
=
[
exe
,
'
-in
'
,
infasta
,
'
-max_file_sz 10GB -out
'
,
dbout
,
'
-dbtype
'
,
'
prot
'
]
elif
os
.
path
.
basename
(
mkdb_cmd
)
==
'
formatdb
'
:
exe
=
settings
.
Locate
(
'
formatdb
'
,
explicit_filename
=
mkdb_cmd
)
args
=
[
exe
,
'
-i
'
,
infasta
,
'
-v
'
,
str
(
10000
),
'
-n
'
,
dbout
]
else
:
raise
IOError
(
'
mkdb command must either be the path to formatdb or makeblastdb!
'
)
cmd
=
'
'
.
join
(
args
)
cmd
=
'
'
.
join
(
args
)
ost
.
LogInfo
(
'
creating blast DB (%s)
'
%
cmd
)
ost
.
LogInfo
(
'
creating blast DB (%s)
'
%
cmd
)
stderr
=
os
.
system
(
cmd
)
os
.
system
(
cmd
)
print
stderr
print
"
finished creating blast DB
"
def
BlastVersion
(
blast_location
=
None
):
def
BlastVersion
(
blast_location
=
None
):
"""
"""
...
@@ -169,7 +177,7 @@ def BlastVersion(blast_location=None):
...
@@ -169,7 +177,7 @@ def BlastVersion(blast_location=None):
try
:
try
:
blast_exe
=
settings
.
Locate
(
'
blastall
'
,
explicit_file_name
=
blast_location
)
blast_exe
=
settings
.
Locate
(
'
blastall
'
,
explicit_file_name
=
blast_location
)
except
:
except
:
raise
Blast
Error
(
'
could not find blast executable
'
)
raise
Runtime
Error
(
'
could not find blast executable
'
)
if
os
.
path
.
basename
(
blast_exe
)
==
'
blastall
'
:
if
os
.
path
.
basename
(
blast_exe
)
==
'
blastall
'
:
args
=
[
blast_exe
]
args
=
[
blast_exe
]
...
...
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