<commit_before>#!/usr/bin/env perl

#-----------------------------------------------------------------------
# Demo program for the Ensembl ontology database and API.
#
# This program fetches a GO term and uses it to retrive genes.  The
# genes retrived will be ones that are cross-referenced with either the
# GO term itself or with any of its descendant terms (following the
# transitive relation types 'is_a' or 'part_of').
#-----------------------------------------------------------------------

use strict;
use warnings;

use Bio::EnsEMBL::Registry;

my $registry = 'Bio::EnsEMBL::Registry';

<<<<<<< demo1.pl
$registry->load_registry_from_db(
  '-host'       => 'ens-staging',
  '-user'       => 'ensro',
  '-db_version' => 56,
  '-verbose'    => 1,
);
=======
$registry->load_registry_from_db( '-host' => 'ensembldb.ensembl.org',
                                  '-user' => 'anonymous' );
>>>>>>> 1.4

my $accession = 'GO:0050825';

# Get a GO term adaptor and a gene adaptor (for human).
my $go_adaptor =
  $registry->get_adaptor( 'Multi', 'Ontology', 'GOTerm' );

my $gene_adaptor = $registry->get_adaptor( 'Mouse', 'Core', 'Gene' );

# Fetch a GO term by its accession.
my $term = $go_adaptor->fetch_by_accession($accession);

# Use the GO term to get a bunch of genes cross-referenced to this GO
# term or to any of its descendant terms.
my @genes = @{ $gene_adaptor->fetch_all_by_GOTerm($term) };
<commit_msg>Restore this script to original shape.<commit_after>#!/usr/bin/env perl

#-----------------------------------------------------------------------
# Demo program for the Ensembl ontology database and API.
#
# This program fetches a GO term and uses it to retrive genes.  The
# genes retrived will be ones that are cross-referenced with either the
# GO term itself or with any of its descendant terms (following the
# transitive relation types 'is_a' or 'part_of').
#-----------------------------------------------------------------------

use strict;
use warnings;

use Bio::EnsEMBL::Registry;

my $registry = 'Bio::EnsEMBL::Registry';

$registry->load_registry_from_db( '-host' => 'ensembldb.ensembl.org',
                                  '-user' => 'anonymous' );

my $accession = 'GO:0050825';

# Get a GO term adaptor and a gene adaptor (for human).
my $go_adaptor =
  $registry->get_adaptor( 'Multi', 'Ontology', 'GOTerm' );

my $gene_adaptor = $registry->get_adaptor( 'Mouse', 'Core', 'Gene' );

# Fetch a GO term by its accession.
my $term = $go_adaptor->fetch_by_accession($accession);

# Use the GO term to get a bunch of genes cross-referenced to this GO
# term or to any of its descendant terms.
my @genes = @{ $gene_adaptor->fetch_all_by_GOTerm($term) };

{'fraction_non_alphanumeric': 0.22713754646840148, 'fraction_numerical': 0.007434944237918215, 'mean_word_length': 2.445582586427657, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7234174', 'n_tokens_mistral': 870, 'n_tokens_neox': 820, 'n_words': 272}