Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
OpenFold
Commits
28b9e2b6
Commit
28b9e2b6
authored
Dec 05, 2023
by
Dingquan Yu
Browse files
moved pase_msa_file into tools subfolder
parent
e72e4e62
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
openfold/data/tools/parse_msa_files.py
openfold/data/tools/parse_msa_files.py
+2
-2
No files found.
openfold/data/parse_msa_files.py
→
openfold/data/
tools/
parse_msa_files.py
View file @
28b9e2b6
import
os
,
multiprocessing
,
argparse
,
pickle
,
tempfile
,
concurrent
import
os
,
multiprocessing
,
argparse
,
pickle
,
tempfile
,
concurrent
import
multiprocessing.pool
# Need to import multiprocessing.pool first otherwise multiprocessing.pool.Pool cannot be called
import
multiprocessing.pool
# Need to import multiprocessing.pool first otherwise multiprocessing.pool.Pool cannot be called
from
openfold.data
import
parsers
from
openfold.data
import
parsers
from
concurrent.futures
import
Thread
PoolExecutor
from
concurrent.futures
import
Process
PoolExecutor
def
parse_stockholm_file
(
alignment_dir
:
str
,
stockholm_file
:
str
):
def
parse_stockholm_file
(
alignment_dir
:
str
,
stockholm_file
:
str
):
path
=
os
.
path
.
join
(
alignment_dir
,
stockholm_file
)
path
=
os
.
path
.
join
(
alignment_dir
,
stockholm_file
)
...
@@ -26,7 +26,7 @@ def run_parse_all_msa_files_multiprocessing(stockholm_files: list, a3m_files: li
...
@@ -26,7 +26,7 @@ def run_parse_all_msa_files_multiprocessing(stockholm_files: list, a3m_files: li
msa_results
=
{}
msa_results
=
{}
a3m_tasks
=
[(
alignment_dir
,
f
)
for
f
in
a3m_files
]
a3m_tasks
=
[(
alignment_dir
,
f
)
for
f
in
a3m_files
]
sto_tasks
=
[(
alignment_dir
,
f
)
for
f
in
stockholm_files
]
sto_tasks
=
[(
alignment_dir
,
f
)
for
f
in
stockholm_files
]
with
Thread
PoolExecutor
()
as
executor
:
with
Process
PoolExecutor
(
max_workers
=
len
(
a3m_tasks
)
+
len
(
sto_tasks
)
)
as
executor
:
a3m_futures
=
{
executor
.
submit
(
parse_a3m_file
,
*
task
):
task
for
task
in
a3m_tasks
}
a3m_futures
=
{
executor
.
submit
(
parse_a3m_file
,
*
task
):
task
for
task
in
a3m_tasks
}
sto_futures
=
{
executor
.
submit
(
parse_stockholm_file
,
*
task
):
task
for
task
in
sto_tasks
}
sto_futures
=
{
executor
.
submit
(
parse_stockholm_file
,
*
task
):
task
for
task
in
sto_tasks
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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