Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biosyntheticSpadesRankingPipeline
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
Container registry
Model registry
Operate
Environments
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
medema-group
biosyntheticSpadesRankingPipeline
Commits
86edf50b
Commit
86edf50b
authored
7 years ago
by
Tracanna, Vittorio
Browse files
Options
Downloads
Patches
Plain Diff
Delete profile_align.py
parent
9f2b457d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
profile_align.py
+0
-42
0 additions, 42 deletions
profile_align.py
with
0 additions
and
42 deletions
profile_align.py
deleted
100644 → 0
+
0
−
42
View file @
9f2b457d
import
os
from
multiprocessing
import
Pool
,
cpu_count
import
glob
from
subprocess
import
Popen
,
PIPE
def
get_aln_files
(
query
,
db
):
aln_list
=
[]
qlist
=
[
x
for
x
in
os
.
listdir
(
query
)
if
x
.
endswith
(
"
.fasta
"
)];
dblist
=
os
.
listdir
(
db
)
for
qfile
in
qlist
:
if
qfile
in
dblist
:
aln_list
.
extend
([
qfile
])
else
:
print
qfile
+
'
is missing from db
'
return
aln_list
def
run_muscle
(
aln_file
):
if
not
os
.
path
.
isfile
(
out
+
aln_file
):
print
aln_file
muscle_pars
=
[
"
muscle
"
,
"
-profile
"
,
"
-in1
"
,
db
+
aln_file
,
"
-in2
"
,
query
+
aln_file
,
"
-out
"
,
out
+
aln_file
]
proc_muscle
=
Popen
(
muscle_pars
,
stdout
=
PIPE
,
stderr
=
PIPE
)
stdout
,
stderr
=
proc_muscle
.
communicate
()
print
stderr
return
def
launch_muscle
(
aln_files
,
cores
):
pool
=
Pool
(
cores
,
maxtasksperchild
=
32
)
pool
.
map
(
run_muscle
,
aln_files
)
pool
.
close
()
pool
.
join
()
return
if
__name__
==
'
__main__
'
:
global
query
global
db
global
out
out
=
'
/mnt/scratch/traca001/data/test/
'
query
=
'
/mnt/scratch/traca001/data/genespades_preprocess_query/domains/
'
db
=
'
/mnt/scratch/traca001/data/genespades_preprocess_raw_2/domains/
'
aln_list
=
get_aln_files
(
query
,
db
)
print
aln_list
launch_muscle
(
aln_list
,
cores
=
cpu_count
())
\ 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