Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scripts
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
UNLOCK
scripts
Commits
af4dae74
Commit
af4dae74
authored
3 years ago
by
Jasper Koehorst
Browse files
Options
Downloads
Patches
Plain Diff
size bug fix
parent
39167e17
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
medaka/medaka.py
+12
-5
12 additions, 5 deletions
medaka/medaka.py
with
12 additions
and
5 deletions
medaka/medaka.py
+
12
−
5
View file @
af4dae74
...
...
@@ -20,9 +20,10 @@ def parse_arguments():
parser
.
add_argument
(
"
-i
"
,
"
--input
"
,
help
=
"
input fast(a/q) file
"
,
required
=
True
)
parser
.
add_argument
(
"
-r
"
,
"
--reference
"
,
help
=
"
reference fasta file
"
,
required
=
True
)
parser
.
add_argument
(
"
-t
"
,
"
--threads
"
,
help
=
"
Number of threads to use
"
,
nargs
=
'
?
'
,
default
=
2
,
type
=
int
)
parser
.
add_argument
(
"
-m
"
,
help
=
"
fill MD tag
"
)
#
parser.add_argument("-m", help = "fill MD tag")
parser
.
add_argument
(
"
-p
"
,
help
=
"
output file prefix (default: reads)
"
,
nargs
=
'
?
'
,
default
=
"
reads
"
,
type
=
str
)
parser
.
add_argument
(
"
-c
"
,
"
--contig-chunks
"
,
help
=
"
Number of contigs per medaka_consensus step
"
,
nargs
=
'
?
'
,
default
=
100
,
type
=
int
)
parser
.
add_argument
(
"
-s
"
,
"
--size-chunks
"
,
help
=
"
Maximum size in bases for a chunk
"
,
nargs
=
'
?
'
,
default
=
10000
,
type
=
int
)
parser
.
add_argument
(
"
--model
"
,
help
=
"
Model definition, default is equivalent to r941_min_fast_g303.
"
,
default
=
"
r941_min_fast_g303
"
)
# Adding optional argument for ....
# ...
...
...
@@ -74,19 +75,25 @@ def medaka_consensus(args):
else
:
reader
=
open
(
args
.
reference
)
# Chunk based on number of chunks and genome size
size
=
0
chunk
=
0
for
line
in
reader
:
if
type
(
line
)
!=
str
:
line
=
line
.
decode
(
'
ascii
'
).
strip
()
line
=
line
.
decode
(
'
ascii
'
)
line
=
line
.
strip
()
if
line
.
startswith
(
"
>
"
):
header
=
line
.
strip
(
"
>
"
).
strip
()
if
chunk
not
in
chunks
:
chunks
[
chunk
]
=
set
()
if
len
(
chunks
[
chunk
])
>
args
.
contig_chunks
:
if
len
(
chunks
[
chunk
])
>
args
.
contig_chunks
or
size
>
args
.
size_chunks
:
size
=
0
chunk
=
chunk
+
1
chunks
[
chunk
]
=
set
()
chunks
[
chunk
].
add
(
header
)
else
:
size
=
size
+
len
(
line
)
reader
.
close
()
# Run this in parallel for each chunk by number of threads / 2
...
...
@@ -120,7 +127,7 @@ def medaka_consensus(args):
# # wait for jobs, then collate results
# medaka stitch results/*.hdf polished.assembly.fasta
def
medaka_stich
(
args
):
arguments
=
[
"
medaka
"
,
"
stitch
"
,
"
--threads
"
,
str
(
args
.
threads
),
"
results/*.hdf
"
,
args
.
reference
,
"
polished_
"
+
args
.
reference
]
arguments
=
[
"
medaka
"
,
"
stitch
"
,
"
--threads
"
,
str
(
args
.
threads
),
"
results/*.hdf
"
,
args
.
reference
,
"
polished_
"
+
os
.
path
.
basename
(
args
.
reference
)
]
print
(
arguments
)
command
=
'
'
.
join
(
map
(
str
,
arguments
))
print
(
"
>
"
,
command
)
...
...
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