#!/usr/bin/perl

# BEGIN{ push @INC,'/home/studenti/CORSI/BioinfoDI1314/bioperl-1.2.3/', '/home/studentu/CORSI/BioinfoDI1314/ensembl/modules/', '/home/studenti/CORSI/BioinfoDI1314/ensembl-compara/modules/','/home/studenti/CORSI/BioinfoDI1314/ensembl-variation/modules/', '/home/studenti/CORSI/BioinfoDI1314/ensembl-funcgenomics/modules/';}


use lib "/home/studenti/CORSI/BioinfoDI1314/bioperl-1.2.3";
use lib "/home/studenti/CORSI/BioinfoDI1314/ensembl/modules";
use lib "/home/studenti/CORSI/BioinfoDI1314/ensembl-compara/modules";
use lib "/home/studenti/CORSI/BioinfoDI1314/ensembl-variation/modules";
use lib "/home/studenti/CORSI/BioinfoDI1314/ensembl-funcgenomics/modules";


use strict;
use Bio::EnsEMBL::Registry;
use Getopt::Long;
use Bio::SeqIO;

my $registry = 'Bio::EnsEMBL::Registry';
$registry->load_registry_from_db(
-host => 'ensembldb.ensembl.org',
-user => 'anonymous'
);

#Coordinate system adaptor:

my $coordsystem_adaptor = $registry->get_adaptor( 'Human', 'Core','CoordSystem' );
my $coordsystems = $coordsystem_adaptor->fetch_all;

while ( my $coordsystem = shift @{$coordsystems} ){
print $coordsystem->name, "\t", $coordsystem->version, "\n";
}

print "\n\n";

# Genomic slice:

my $slice_adaptor= $registry->get_adaptor( 'Human', 'Core', 'Slice' );
my $slice = $slice_adaptor->fetch_by_region( 'chromosome', '21' );
print "Coordsystem:\t", $slice->coord_system_name,"\nSeqregion:\t", $slice->seq_region_name,"\nStart:\t\t", $slice->start,"\nEnd:\t\t", $slice->end,"\nStrand:\t\t", $slice->strand,"\nSlice:\t\t", $slice->name, "\n";


