Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
4629ab16
Commit
4629ab16
authored
13 years ago
by
Kieron Taylor
Browse files
Options
Downloads
Patches
Plain Diff
Undo redundant changes. See FASTASerializer for better-behaved new serializer.
parent
bc9e84d2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Utils/SeqDumper.pm
+14
-30
14 additions, 30 deletions
modules/Bio/EnsEMBL/Utils/SeqDumper.pm
with
14 additions
and
30 deletions
modules/Bio/EnsEMBL/Utils/SeqDumper.pm
+
14
−
30
View file @
4629ab16
...
...
@@ -115,8 +115,6 @@ sub new {
foreach
my
$p
(
sort
keys
%
{
$params
||
{}})
{
$self
->
{
$p
}
=
$params
->
{
$p
};
# TODO: Figure out what this might have been for
# Why are we sorting prior to putting it back into a hash?
}
return
$self
;
...
...
@@ -283,15 +281,12 @@ sub is_enabled {
Arg [1] : Bio::EnsEMBL::Slice slice
The slice to dump
Arg [
2
] : string $format
Arg [
1
] : string $format
The name of the format to dump
Arg [
3
] : (optional) $outfile
Arg [
2
] : (optional) $outfile
The name of the file to dump to. If no file is specified STDOUT
is used
Arg [4] : (optional) Sequence string for EMBL format
Arg [5] : (optional) Additional metadata, e.g. for custom FASTA headers
Example : $seq_dumper->dump($slice, 'EMBL');
$seq_dumper->dump($slice, 'FASTA', $filehandle, undef, $custom_header);
Description: Dumps a region of a genome specified by the slice argument into
an outfile of the format $format
Returntype : none
...
...
@@ -302,7 +297,7 @@ sub is_enabled {
sub
dump
{
my
(
$self
,
$slice
,
$format
,
$outfile
,
$seq
,
$metadata
)
=
@_
;
my
(
$self
,
$slice
,
$format
,
$outfile
,
$seq
)
=
@_
;
$format
||
throw
("
format arg is required
");
$slice
||
throw
("
slice arg is required
");
...
...
@@ -314,22 +309,18 @@ sub dump {
}
my
$FH
;
if
(
ref
(
$outfile
)
eq
"
IO::File
")
{
$FH
=
$outfile
;}
else
{
$FH
=
IO::
File
->
new
;;
if
(
$outfile
)
{
$FH
->
open
("
>>
$outfile
")
or
throw
("
Could not open file
$outfile
");
}
else
{
my
$FH
=
IO::
File
->
new
;;
if
(
$outfile
)
{
$FH
->
open
("
>>
$outfile
")
or
throw
("
Could not open file
$outfile
");
}
else
{
$FH
=
\
*STDOUT
;
#mod_perl did not like the following
#$FH->fdopen(fileno(STDOUT), "w")
# or throw("Could not open currently selected output filehandle " .
# "for writing");
}
}
&$dump_handler
(
$self
,
$slice
,
$FH
,
$seq
,
$metadata
);
&$dump_handler
(
$self
,
$slice
,
$FH
,
$seq
);
$FH
->
close
if
(
$outfile
);
#close if we were writing to a file
}
...
...
@@ -685,6 +676,7 @@ sub _dump_feature_table {
my
$FORMAT
=
shift
;
#use only the core database to dump features (except for bloody snps)
my
$lite
=
$slice
->
adaptor
->
db
->
remove_db_adaptor
('
lite
');
my
$meta
=
$slice
->
adaptor
->
db
->
get_MetaContainer
;
...
...
@@ -904,6 +896,7 @@ sub _dump_feature_table {
}
}
$slice
->
adaptor
->
db
->
add_db_adaptor
('
lite
',
$lite
)
if
$lite
;
}
...
...
@@ -935,11 +928,8 @@ sub transcript_to_codon_start {
Arg [1] : Bio::EnsEMBL::Slice
Arg [2] : IO::File $FH
Arg [4] : String, Custom header
Example : $seq_dumper->dump_fasta($slice, $FH);
Example : $seq_dumper->dump_fasta($slice, $FH, $metadata);
Description: Dumps an FASTA flat file to an open file handle
Capable of specifying a customised header for rare cases.
Returntype : none
Exceptions : none
Caller : dump
...
...
@@ -950,7 +940,6 @@ sub dump_fasta {
my
$self
=
shift
;
my
$slice
=
shift
;
my
$FH
=
shift
;
my
$metadata
=
shift
;
my
$id
=
$slice
->
seq_region_name
;
my
$seqtype
=
'
dna
';
...
...
@@ -959,14 +948,7 @@ sub dump_fasta {
my
$start
=
1
;
my
$end
=
$slice
->
length
();
my
$header
;
if
(
$metadata
)
{
#TODO Finish this method
$header
=
$metadata
;
}
else
{
$header
=
"
>
$id
$seqtype
:
$idtype
$location
\n
";}
my
$header
=
"
>
$id
$seqtype
:
$idtype
$location
\n
";
$self
->
print
(
$FH
,
$header
);
#set the formatting to FASTA
...
...
@@ -984,6 +966,8 @@ sub dump_fasta {
}
}
=head2 features2location
Arg [1] : listref of Bio::EnsEMBL::SeqFeatures
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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