[ensembl-dev] slice adaptor

Bert Overduin bert at ebi.ac.uk
Fri Oct 8 08:40:08 BST 2010


Hello Hardip,

$slice->seq_region_length gives you the length of the seq_region on
which your slice is defined, i.e. the whole chromosome.

If you want the length of the slice, you need to use $slice->length.

Cheers,
Bert

On Fri, Oct 8, 2010 at 5:07 AM, Hardip Patel <H.Patel at victorchang.edu.au> wrote:
> Hi all
>
> I am using ensembl api to extract information for overlapping features to
> the regions of interest. here is the code that I am using.
>
> my $start = shift;
> my $end = shift;
> my $chr = shift;
> my $strand = shift;
>
> my $slice_adaptor = $registry->get_adaptor('mouse', 'Core', 'slice');
> my $coordinate_system = "chromosome";
>
> my $slice = $slice_adaptor->fetch_by_region($coordinate_system, $chr,
> $start, $end, $strand, 'NCBIM37');
>
> print $slice->seq_region_name ." is chromosome and
> ".$slice->seq_region_length ." is length\n";
>
> I have tried using the fetch_by_region method with and without one/all of
> the following:
> $coordinate_system, strand and version.
>
> I have always supplied $chr $start and $end as at the minimum three
> arguments to method call.
>
> When I check the seq_region_name it corresponds with the chromosome name I
> supply.
> However, the seq_region_length doesn’t correspond to the start and end I
> supply. instead it just returns the slice over the whole chromosome.
>
> Can somebody please let me know if I am doing something wrong or not?
>
> Regards
>
> --
> Hardip R. Patel
> Bioinformatician, Molecular Genetics Division,
> Victor Chang Cardiac Research Institute,
> Darlinghurst, NSW – 2010, Australia
> (W): +61 – 2 – 9295 8611
> (M): 0449 180 715
>
> VCCRI 12th International Symposium
> “Charting the depths of RNA: from molecules to therapies”
> 19 November 2010
> visit http://www.victorchang.edu.au for details
>
>
>
> _______________________________________________
> Dev mailing list
> Dev at ensembl.org
> http://lists.ensembl.org/mailman/listinfo/dev
>
>



-- 
Bert Overduin, Ph.D.
PANDA Coordination & Outreach

EMBL - European Bioinformatics Institute
Wellcome Trust Genome Campus
Hinxton, Cambridge CB10 1SD
United Kingdom

http://www.ebi.ac.uk/~bert




More information about the Dev mailing list