Bio-Das-ProServer

 view release on metacpan or  search on metacpan

lib/Bio/Das/ProServer/SourceAdaptor/bed12.pm  view on Meta::CPAN

          'ori'        => $row->{'strand'},
          'score'      => $row->{'score'},
          'group_id'   => $row->{'name'},
          'feature_id' => $row->{'name'} . q[:] . ++$i,
          'type'       => $row->{'name'},
          'method'     => 'BED conversion',
        };
      }

    } else {
      push @features, {
        'segment'    => $segment,
        'start'      => $row->{'chromStart'} + 1,
        'end'        => $row->{'chromEnd'},
        'ori'        => $row->{'strand'},
        'score'      => $row->{'score'},
        'group_id'   => $row->{'name'},
        'feature_id' => $row->{'name'} . ':1',
        'type'       => $row->{'name'},
        'method'     => 'BED conversion',
      };
    }
  }

  $self->{'debug'} && printf "%s: returning %d features\n", $self->dsn, scalar @features;
  return \@features;
}

1;
__END__

=head1 NAME

Bio::Das::ProServer::SourceAdaptor::bed12

=head1 VERSION

$Revision: 688 $

=head1 SYNOPSIS

  Features by segment:
  <host>/das/<source>/features?segment=X:1,100
  
  Features by group ID:
  <host>/das/<source>/features?group_id=TRAN1
  
  Features by feature ID:
  <host>/das/<source>/features?feature_id=TRAN1:4

=head1 DESCRIPTION

Serves up features DAS responses from BED files.
See L<http://genome.ucsc.edu/goldenPath/help/customTrack.html#BED|http://genome.ucsc.edu/goldenPath/help/customTrack.html#BED>
http://genome.ucsc.edu/goldenPath/help/customTrack.html#BED
for details of the file format.

The BED and DAS formats contain an intersection of information. That is, not all
DAS fields are supported in BED, and vice versa. In order to be adapted to the
DAS protocol, some basic assumptions need to be made and some configurability is
lost. See the BUGS AND LIMITATIONS section for more details.

=head1 CONFIGURATION AND ENVIRONMENT

  [mybed]
  state       = on
  adaptor     = bed12
  path        = /data/
  filename    = example.bed
  ; coordinates -> test segment
  coordinates = NCBI_36,Chromosome,Homo sapiens -> X:1,100

=head1 DIAGNOSTICS

Run ProServer with the -debug flag.

=head1 SUBROUTINES/METHODS

=head2 build_features - Builds the DAS response

See documentation in superclass.

=head2 capabilities - Provides details of the adaptor's capabilities

This adaptor supports the 'features' command, including the 'feature-by-id' and
'group-by-id' variants.

=head2 init - Initialises the SourceAdaptor

Adds the 'bed12' transport to the source's configuration (if not already set).

=head1 SEE ALSO

=over

=item L<Bio::Das::ProServer::SourceAdaptor::Transport::bed12|Bio::Das::ProServer::SourceAdaptor::Transport::bed12>

=item L<http://genome.ucsc.edu/goldenPath/help/customTrack.html#BED|http://genome.ucsc.edu/goldenPath/help/customTrack.html#BED> BED format

=back

=head1 DEPENDENCIES

=over

=item L<Bio::Das::ProServer::SourceAdaptor|Bio::Das::ProServer::SourceAdaptor> 

=item L<Bio::Das::ProServer::SourceAdaptor::Transport::bed12|Bio::Das::ProServer::SourceAdaptor::Transport::bed12>

=item L<Carp|Carp>

=back

=head1 BUGS AND LIMITATIONS

See the BUGS AND LIMITATIONS section of
Bio::ProServer::SourceAdaptor::Transport::bed12 for details.

=head1 INCOMPATIBILITIES

None reported.

=head1 AUTHOR

Andy Jenkinson <andy.jenkinson@ebi.ac.uk>

=head1 LICENSE AND COPYRIGHT

Copyright (c) 2008 EMBL-EBI

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut



( run in 1.847 second using v1.01-cache-2.11-cpan-39bf76dae61 )