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
80188582
Commit
80188582
authored
13 years ago
by
Kieron Taylor
Browse files
Options
Downloads
Patches
Plain Diff
Added custom header override method. Updated documentation to reflect this.
parent
2ae8a3e6
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/IO/FASTASerializer.pm
+25
-2
25 additions, 2 deletions
modules/Bio/EnsEMBL/Utils/IO/FASTASerializer.pm
with
25 additions
and
2 deletions
modules/Bio/EnsEMBL/Utils/IO/FASTASerializer.pm
+
25
−
2
View file @
80188582
...
...
@@ -46,6 +46,9 @@ Bio::EnsEMBL::Utils::IO::FASTASerializer
Custom headers are set by supplying an anonymous subroutine to new(). Custom
header code must accept a Slice or Bio::PrimarySeqI compliant object as
argument and return a string.
The custom header method can be overridden later through set_custom_header()
but this is not normally necessary.
=cut
...
...
@@ -116,9 +119,10 @@ sub new {
=head2 print_metadata
Arg [1] : Bio::EnsEMBL::Slice
Description: Printing header lines into FASTA files.
Description: Printing header lines into FASTA files. Usually handled
internally to the serializer.
Returntype : None
Caller : print_
slice
Caller : print_
Seq
=cut
sub
print_metadata
{
...
...
@@ -202,5 +206,24 @@ sub chunk_factor {
return
$self
->
{'
chunk_factor
'}
}
=head2 set_custom_header
Arg [1] : CODE reference
Description: Set the custom header function. Normally this is done at
construction time, but can be overridden here.
Returntype :
=cut
sub
set_custom_header
{
my
$self
=
shift
;
my
$new_header_function
=
shift
;
if
(
$new_header_function
and
ref
(
$new_header_function
)
eq
"
CODE
"
)
{
$self
->
{'
custom_header
'}
=
$new_header_function
;
}
else
{
throw
("
Custom header function required by reference.
\n
See documentation for FASTASerializer for correct usage.
")
}
}
1
;
\ No newline at end of file
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