Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mutalyzer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
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
Mirrors
mutalyzer
Commits
b7c8fddd
Commit
b7c8fddd
authored
10 years ago
by
Vermaat
Browse files
Options
Downloads
Patches
Plain Diff
Check batch job input field length
parent
5c098400
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
mutalyzer/File.py
+25
-4
25 additions, 4 deletions
mutalyzer/File.py
mutalyzer/website/templates/batch-jobs.html
+3
-2
3 additions, 2 deletions
mutalyzer/website/templates/batch-jobs.html
tests/test_scheduler.py
+17
-0
17 additions, 0 deletions
tests/test_scheduler.py
with
45 additions
and
6 deletions
mutalyzer/File.py
+
25
−
4
View file @
b7c8fddd
...
...
@@ -292,6 +292,7 @@ class File() :
ret
=
[]
notthree
=
[]
emptyfield
=
[]
toolong
=
[]
for
line
,
job
in
jobl
[
1
:]:
#Empty line
...
...
@@ -319,7 +320,10 @@ class File() :
inputl
=
"
~!InputFields:
"
#start with the skip flag
inputl
+=
"
|
"
.
join
(
job
)
ret
.
append
(
inputl
)
if
len
(
inputl
)
>
200
:
toolong
.
append
(
line
)
else
:
ret
.
append
(
inputl
)
#for
#Create output Message for incompatible fields
...
...
@@ -335,7 +339,13 @@ class File() :
"
The first and last column can
'
t be left empty in
"
"
%i line(s): %s.
\n
"
%
(
len
(
emptyfield
),
lines
))
errlist
=
notthree
+
emptyfield
if
any
(
toolong
):
lines
=
makeList
(
toolong
,
10
)
self
.
__output
.
addMessage
(
__file__
,
3
,
"
EBPARSE
"
,
"
Batch input field too long in %i line(s): %s.
\n
"
%
(
len
(
toolong
),
lines
))
errlist
=
notthree
+
emptyfield
+
toolong
#if
else
:
#No Header, possibly a new BatchType
...
...
@@ -353,12 +363,23 @@ class File() :
"
line(s): %s
"
%
(
len
(
errlist
),
makeList
(
errlist
)))
toolong
=
[
line
for
line
,
row
in
jobl
if
any
(
len
(
col
)
>
200
for
col
in
row
)]
if
any
(
toolong
):
self
.
__output
.
addMessage
(
__file__
,
3
,
"
EBPARSE
"
,
"
Batch input field too long in %i line(s): %s
"
%
(
len
(
toolong
),
makeList
(
toolong
)))
ret
=
[]
for
line
,
job
in
jobl
:
if
not
any
(
job
):
#Empty line
ret
.
extend
([
'
~!
'
for
_
in
range
(
columns
)])
continue
if
line
in
errlist
:
if
line
in
toolong
:
#Trim too long
ret
.
append
(
"
~!InputFields:
"
+
(
'
|
'
.
join
(
job
))[:
180
]
+
'
...
'
)
ret
.
extend
([
'
~!
'
for
_
in
range
(
columns
-
1
)])
elif
line
in
errlist
:
#Dirty Escape BatchEntries
ret
.
append
(
"
~!InputFields:
"
+
'
|
'
.
join
(
job
))
ret
.
extend
([
'
~!
'
for
_
in
range
(
columns
-
1
)])
...
...
@@ -476,7 +497,7 @@ def makeList(l, maxlen=10):
@return: a list converted to a string with comma
'
s and spaces
@rtype: unicode
"""
ret
=
"
,
"
.
join
(
i
for
i
in
l
[:
maxlen
])
ret
=
"
,
"
.
join
(
str
(
i
)
for
i
in
l
[:
maxlen
])
if
len
(
l
)
>
maxlen
:
return
ret
+
"
, ...
"
else
:
...
...
This diff is collapsed.
Click to expand it.
mutalyzer/website/templates/batch-jobs.html
+
3
−
2
View file @
b7c8fddd
...
...
@@ -15,13 +15,14 @@
</p>
<div
id=
'help'
style=
"display:none"
>
<p>
The mutalyzer batch checker accepts the following file formats
<p>
The mutalyzer batch checker accepts the following file formats
:
<ul>
<li>
Tab delimited text file / CSV file
</li>
<li>
Microsoft Excel file
</li>
<li>
OpenOffice ODS file
</li>
</ul>
and the maximum size is
<span
tal:content =
"maxSize"
></span>
megabytes.
The maximum file size is {{ max_file_size }} megabytes, and the maximum
length per entry (variant description) is 200 characters.
</p>
<h5>
We accept two types of input files, you can download examples below
</h5>
<h5>
New Style
<a
href=
"{{ url_for('.downloads', filename='batchtestnew.txt') }}"
>
Download Example File
</a></h5>
...
...
This diff is collapsed.
Click to expand it.
tests/test_scheduler.py
+
17
−
0
View file @
b7c8fddd
...
...
@@ -71,6 +71,23 @@ class TestScheduler(MutalyzerTest):
'
OK
'
]]
self
.
_batch_job_plain_text
(
variants
,
expected
,
'
syntax-checker
'
)
def
test_large_input
(
self
):
"""
Simple batch job with large input.
"""
variants
=
[
'
chr13:g.114503915delCACCTGCGGGAGGTGAGGGGCGCTGGGGACCCCCG
'
'
TATCTACACCTGCGGGAGGTGAGGGGCGCTGGGGACCCCTATATCTACACCTGAG
'
'
GGAGGTGinsTGCCTGCGGGAGGTGAGGGGCGCTGGGGACCCCCGTATCTACACC
'
'
TGCGGGAGGTGAGGGGCGCTGGGGACCCCTATATCTACACCTGAGGGAGGTG
'
]
expected
=
[[
'
InputFields: chr13:g.114503915delCACCTGCGGGAGGTGAGGGGC
'
'
GCTGGGGACCCCCGTATCTACACCTGCGGGAGGTGAGGGGCGCTGGGGACCCCT
'
'
ATATCTACACCTGAGGGAGGTGinsTGCCTGCGGGAGGTGAGGGGCGCTGGGGA
'
'
CCCCCGTATCTACACCTGCGGGAGGTGAGGG...
'
,
'
(Scheduler): Entry could not be formatted correctly,
'
'
check batch input file help for details
'
]]
self
.
_batch_job_plain_text
(
variants
,
expected
,
'
syntax-checker
'
)
@fix
(
cache
(
'
AB026906.1
'
,
'
NM_000059.3
'
))
def
test_name_checker
(
self
):
"""
...
...
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