Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
metaSNV
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Igor Costea
metaSNV
Commits
f2515cd7
Commit
f2515cd7
authored
Apr 27, 2017
by
Robin Erich Muench
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add compute_summary
parent
fff4caff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
17 deletions
+21
-17
metaSNV.py
metaSNV.py
+21
-17
No files found.
metaSNV.py
View file @
f2515cd7
...
...
@@ -91,21 +91,12 @@ def get_header(args):
f
.
close
()
args
.
ctg_len
=
args
.
project_dir
+
'/bed_header'
def
split_opt
(
args
):
if
args
.
n_splits
>
100
:
stderr
.
write
(
"Maximum number of splits is 100.
\n
"
)
exit
(
1
)
older_files
=
glob
(
args
.
project_dir
+
'/bestsplits/*'
)
if
older_files
:
stderr
.
write
(
"
\n
removing old splits.
\n
"
)
for
f
in
older_files
:
os
.
unlink
(
f
)
def
compute_summary
(
args
):
'''This information is required by metaSNV_post.py'''
cov_dir
=
path
.
join
(
args
.
project_dir
,
'cov'
)
cov_files
=
glob
(
cov_dir
+
'/*.cov'
)
project_name
=
path
.
basename
(
args
.
project_dir
)
#
project_name = path.basename(args.project_dir)
if
not
cov_files
:
if
not
args
.
print_commands
:
stderr
.
write
(
"Coverage files not found.
\n
"
)
...
...
@@ -120,20 +111,32 @@ def split_opt(args):
f
+
'.summary'
]
subprocess
.
call
(
cmd
)
print
(
"
\n
Coverage summary here: {}"
.
format
(
args
.
project_dir
))
print
(
" Average vertical genome coverage: '{}/{}.all_cov.tab'"
.
format
(
args
.
project_dir
,
project_name
))
print
(
" Horizontal genome coverage (1X): '{}/{}.all_perc.tab'"
.
format
(
args
.
project_dir
,
project_name
))
print
(
" Average vertical genome coverage: '{}/{}.all_cov.tab'"
.
format
(
args
.
project_dir
,
args
.
project_dir
))
print
(
" Horizontal genome coverage (1X): '{}/{}.all_perc.tab'"
.
format
(
args
.
project_dir
,
args
.
project_dir
))
cmd
=
[
'python'
,
'{}/src/collapse_coverages.py'
.
format
(
basedir
),
args
.
project_dir
]
subprocess
.
call
(
cmd
)
subprocess
.
call
(
cmd
)
def
split_opt
(
args
):
if
args
.
n_splits
>
100
:
stderr
.
write
(
"Maximum number of splits is 100.
\n
"
)
exit
(
1
)
older_files
=
glob
(
args
.
project_dir
+
'/bestsplits/*'
)
if
older_files
:
stderr
.
write
(
"
\n
removing old splits.
\n
"
)
for
f
in
older_files
:
os
.
unlink
(
f
)
print
(
"
\n
Calculating best database split:"
)
# usage createOptimumSplit.sh <all_cov.tab> <all_perc.tab> <geneDefinitions> <INT_NrSplits> <.outfile>
cmd
=
[
'python'
,
'{}/src/createOptimumSplit.py'
.
format
(
basedir
),
"{}/{}.all_cov.tab"
.
format
(
args
.
project_dir
,
project_name
),
"{}/{}.all_perc.tab"
.
format
(
args
.
project_dir
,
project_name
),
"{}/{}.all_cov.tab"
.
format
(
args
.
project_dir
,
args
.
project_dir
),
"{}/{}.all_perc.tab"
.
format
(
args
.
project_dir
,
args
.
project_dir
),
args
.
ctg_len
,
str
(
args
.
n_splits
),
path
.
join
(
args
.
project_dir
,
"bestsplits"
,
"best_split"
)]
...
...
@@ -258,6 +261,7 @@ SOLUTION: make\n\n'''.format(basedir))
create_directories
(
args
.
project_dir
)
compute_opt
(
args
)
compute_summary
(
args
)
get_header
(
args
)
if
args
.
n_splits
>
1
:
...
...
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