Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
f7fe4373
Commit
f7fe4373
authored
Oct 17, 2014
by
Roy Storey
Browse files
always write the sequence to the current seqio - fix for creating lots of empty output files
parent
c0381e5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
modules/Bio/EnsEMBL/Hive/RunnableDB/FastaFactory.pm
modules/Bio/EnsEMBL/Hive/RunnableDB/FastaFactory.pm
+6
-4
No files found.
modules/Bio/EnsEMBL/Hive/RunnableDB/FastaFactory.pm
View file @
f7fe4373
...
...
@@ -127,14 +127,14 @@ sub write_output {
my
$chunk_size
=
0
;
# number of sequences in the current chunk
my
$chunk_name
=
$output_prefix
.
$chunk_number
.
$output_suffix
;
my
$chunk_seqio
=
Bio::
SeqIO
->
new
(
-
file
=>
'
>
'
.
$chunk_name
,
-
format
=>
'
fasta
');
while
(
my
$seq_object
=
$input_seqio
->
next_seq
)
{
$chunk_seqio
->
write_seq
(
$seq_object
);
if
((
my
$seq_length
=
$seq_object
->
length
())
+
$chunk_length
<=
$max_chunk_length
)
{
# add to the current chunk:
$chunk_seqio
->
write_seq
(
$seq_object
);
$chunk_length
+=
$seq_length
;
$chunk_size
+=
1
;
}
else
{
# dataflow the current chunk:
...
...
@@ -162,6 +162,8 @@ sub write_output {
'
chunk_length
'
=>
$chunk_length
,
'
chunk_size
'
=>
$chunk_size
},
2
);
}
else
{
unlink
$chunk_name
unless
(
stat
(
$chunk_name
))[
7
];
}
}
...
...
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