| Summary | Included libraries | Package variables | Synopsis | Description | General documentation | Methods |
| _initialize | Description | Code |
| use_score | Description | Code |
| name | Description | Code |
| description | Description | Code |
| write_feature | No description | Code |
| next_feature | No description | Code |
| _initialize | code | next | Top |
Title : _initialize
Function: initializes BED for reading/writing (currently write-only)
Args : all optional:
name description
----------------------------------------------------------
-name the name for the BED track, stored in header
name defaults to localtime()
-description the description for the BED track, stored in
header. defaults to localtime().
-use_score whether or not the score attribute of
features should be used when rendering them.
the higher the score the darker the color.
defaults to 0 (false) |
| use_score | code | prev | next | Top |
Title : use_score Usage : $obj->use_score($newval) Function: should score be used to adjust feature color when rendering? set to true if so. Example : Returns : value of use_score (a scalar) Args : on set, new value (a scalar or undef, optional) |
| name | code | prev | next | Top |
Title : name Usage : $obj->name($newval) Function: name of BED track Example : Returns : value of name (a scalar) Args : on set, new value (a scalar or undef, optional) |
| description | code | prev | next | Top |
Title : description Usage : $obj->description($newval) Function: description of BED track Example : Returns : value of description (a scalar) Args : on set, new value (a scalar or undef, optional) |
| _initialize | description | prev | next | Top |
my($self,%arg) = @_; $self->SUPER::_initialize(%arg); $self->name($arg{-name} || scalar(localtime())); $self->description($arg{-description} || scalar(localtime())); $self->use_score($arg{-use_score} || 0); $self->_print(sprintf('track name="%s" description="%s" useScore=%d', $self->name, $self->description, $self->use_score ? 1 : 0 ) );}
| use_score | description | prev | next | Top |
my $self = shift; return $self->{'use_score'} = shift if @_; return $self->{'use_score'};}
| name | description | prev | next | Top |
my $self = shift; return $self->{'name'} = shift if @_; return $self->{'name'};}
| description | description | prev | next | Top |
my $self = shift; return $self->{'description'} = shift if @_; return $self->{'description'};}
| write_feature | description | prev | next | Top |
my($self,$feature) = @_; $self->throw("only Bio::SeqFeature::Annotated objects are writeable") unless $feature->isa('Bio::SeqFeature::Annotated'); my $chrom = $feature->seq_id || ''; my $chrom_start = $feature->start || 0; my $chrom_end = $feature->stop || 0; #try to make a reasonable name}
my $name = undef; if(my @v = ($feature->annotation->get_Annotations('Name'))){ $name = $v[0]; $self->warn("only using first of feature's multiple names: ".join ',', map {$_->value} @v) if scalar(@v) > 1; } elsif(my @v = ($feature->annotation->get_Annotations('ID'))){ $name = $v[0]; $self->warn("only using first of feature's multiple IDs: ".join ',', map {$_->value} @v) if scalar(@v) > 1; } else { $name = 'anonymous'; } my $score = $feature->score || 0; my $strand = $feature->strand == 0 ? '-' : '+'; #default to +
my $thick_start = ''; #not implemented, used for CDS
my $thick_end = ''; #not implemented, used for CDS
my $reserved = 0; my $block_count = ''; #not implemented, used for sub features
my $block_sizes = ''; #not implemented, used for sub features
my $block_starts = ''; #not implemented, used for sub features
$self->_print(join("\t",($chrom,$chrom_start,$chrom_end,$name,$score,$strand,$thick_start,$thick_end,$reserved,$block_count,$block_sizes, $block_starts))); $self->write_feature($_) foreach $feature->get_SeqFeatures();
| next_feature | description | prev | next | Top |
shift->throw_not_implemented();}
| FEEDBACK | Top |
| Mailing Lists | Top |
bioperl-l@bioperl.org - General discussion http://bioperl.org/MailList.shtml - About the mailing lists
| Reporting Bugs | Top |
http://bugzilla.bioperl.org/
| AUTHOR - Allen Day | Top |
| CONTRIBUTORS | Top |
| APPENDIX | Top |