<commit_before>#!/usr/local/ensembl/bin/perl -w

use strict;
use Getopt::Long;
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Compara::DBSQL::DBAdaptor;

my $reg_conf = shift;
die("must specify registry conf file on commandline\n") unless($reg_conf);
Bio::EnsEMBL::Registry->load_all($reg_conf);

# get compara DBAdaptor
my $comparaDBA = Bio::EnsEMBL::Registry->get_DBAdaptor('compara', 'compara');

# get GenomeDB for human
my $humanGDB = $comparaDBA->get_GenomeDBAdaptor->fetch_by_registry_name("human");

# get dnafrag for human chr 18
my $dnafrag = $comparaDBA->get_DnaFragAdaptor->
     fetch_by_GenomeDB_and_name($humanGDB, '18');

# get its core Slice and subslice it
my $slice = $dnafrag->slice;
$slice = $slice->sub_Slice(75000000,76000000,1);

# the the genes on the subslice and print
my $genes = $slice->get_all_Genes;
foreach my $gene (@{$genes}) {
  printf("%s\n", $gene->stable_id);
}

exit(0);

<commit_msg>switched from fetch_by_GenomeDB_and_name to fetch_all_by_GenomeDB_region since that appear to be the more up-to-date method<commit_after>#!/usr/local/ensembl/bin/perl -w

use strict;
use Getopt::Long;
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Compara::DBSQL::DBAdaptor;

my $reg_conf = shift;
die("must specify registry conf file on commandline\n") unless($reg_conf);
Bio::EnsEMBL::Registry->load_all($reg_conf);

# get compara DBAdaptor
my $comparaDBA = Bio::EnsEMBL::Registry->get_DBAdaptor('compara', 'compara');

# get GenomeDB for human
my $humanGDB = $comparaDBA->get_GenomeDBAdaptor->fetch_by_registry_name("human");

# get dnafrag for human chr 18
my $dnafrag_list = $comparaDBA->get_DnaFragAdaptor->
     fetch_all_by_GenomeDB_region($humanGDB, 'chromosome', "18");
my $dnafrag = shift @{$dnafrag_list};

# get its core Slice and subslice it
my $slice = $dnafrag->slice;
$slice = $slice->sub_Slice(75000000,76000000,1);

# the the genes on the subslice and print
my $genes = $slice->get_all_Genes;
foreach my $gene (@{$genes}) {
  printf("%s\n", $gene->stable_id);
}

exit(0);


{'fraction_non_alphanumeric': 0.14803775459513163, 'fraction_numerical': 0.02185792349726776, 'mean_word_length': 6.404411764705882, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4312178', 'n_tokens_mistral': 827, 'n_tokens_neox': 779, 'n_words': 172}