[ensembl-dev] Problem with DumpAlignedGenes.pl script

Stephen Fitzgerald stephenf at ebi.ac.uk
Thu May 31 12:02:03 BST 2012


Hi Ronald, apologies for the late reply. Please find attached a modified 
version of the script DumpAlignedGenes.pl. Can you test it and see if it 
gives you the expected output.

See below for the differences between the attached script and the cvs branch-67 version.

If there are any problems, please get back to us.

Cheers,
Stephen.

Index: DumpAlignedGenes.pl
===================================================================
RCS file: 
/nfs/ensembl/cvsroot/ensembl-compara/scripts/dumps/DumpAlignedGenes.pl,v
retrieving revision 1.4
diff -r1.4 DumpAlignedGenes.pl
197a198
> use Data::Dumper;
266c267
< my $dbname = "compara";
---
> my $dbname = "Multi";
334c335,337
< Bio::EnsEMBL::Registry->load_all($reg_conf);
---
> Bio::EnsEMBL::Registry->load_registry_from_db(
>       -host=>'ensembldb.ensembl.org', -user=>'anonymous',
>       -port=>'5306', -db_version=>'67');
360c363,364
<   my $this_binomial_id = 
$this_meta_container_adaptor->get_Species->binomial;
---
>   my $this_binomial_id = lc( 
$this_meta_container_adaptor->get_scientific_name );
>   $this_binomial_id =~ s/\s/_/;
429c433,434
< my $source_binomial_id = $meta_container_adaptor->get_Species->binomial;
---
> my $source_binomial_id = lc( 
$meta_container_adaptor->get_scientific_name );
> $source_binomial_id =~ s/\s/_/;
455,461d459
< my $mapped_genes = 
$align_slice->{slices}->{$source_genome_db->name}->get_all_Genes(
<         -MAX_REPETITION_LENGTH => 100,
<         -MAX_GAP_LENGTH => 100,
<         -MAX_INTRON_LENGTH => 100000,
<         -STRICT_ORDER_OF_EXON_PIECES => 1,
<         -STRICT_ORDER_OF_EXONS => 0
<     );
463,464c461
< ##
< 
##############################################################################################
---
> my $mapped_genes;
465a463,476
> foreach my $align_slice_slice ( @{ 
$align_slice->{slices}->{$source_genome_db->name} } ){
>       $mapped_genes = $align_slice_slice->get_all_Genes;
> #     foreach my $slice (@$slices){
> #             $slice->
> #             -MAX_REPETITION_LENGTH => 100,
> #             -MAX_GAP_LENGTH => 100,
> #             -MAX_INTRON_LENGTH => 100000,
> #             -STRICT_ORDER_OF_EXON_PIECES => 1,
> #             -STRICT_ORDER_OF_EXONS => 0
> #             );
> }
>
> #
> 
#############################################################################################
467,470c478,482
< 
##############################################################################################
< ##
< ## Print the aligned genes on the genomic sequence they are aligned to
< ##
---
>
> 
#############################################################################################
> #
> # Print the aligned genes on the genomic sequence they are aligned to
> #
476c488,489
< my $query_binomial_id = $meta_container_adaptor->get_Species->binomial;
---
> my $query_binomial_id = lc( $meta_container_adaptor->get_scientific_name 
);
> $query_binomial_id =~ s/\s/_/;
509,519c522,534
<       my $aseq = 
$align_slice->{slices}->{$query_genome_db->name}->subseq($exon->start-50, 
$exon->end+50);
<       $seq =~ s/(.{80})/$1\n/g;
<       $aseq =~ s/(.{80})/$1\n/g;
<       $seq =~ s/(.{20})/$1 /g;
<       $aseq =~ s/(.{20})/$1 /g;
<       my @seq = split("\n", $seq);
<       my @aseq = split("\n", $aseq);
<       for (my $a=0; $a<@seq; $a++) {
<         print "     ", $seq[$a], "\n";
<         print "     ", $aseq[$a], "\n";
<         print "\n";
---
>       foreach my $align_slice_slice ( @{ 
$align_slice->{slices}->{$source_genome_db->name} } ){
>        my $aseq = $align_slice_slice->subseq($exon->start-50, 
$exon->end+50);
>        $seq =~ s/(.{80})/$1\n/g;
>        $aseq =~ s/(.{80})/$1\n/g;
>        $seq =~ s/(.{20})/$1 /g;
>        $aseq =~ s/(.{20})/$1 /g;
>                my @seq = split("\n", $seq);
>                my @aseq = split("\n", $aseq);
>        for (my $a=0; $a<@seq; $a++) {
>                        print "     ", $seq[$a], "\n";
>               print "     ", $aseq[$a], "\n";
>               print "\n";
>               }
524d538
<





On Wed, 23 May 2012, Harris, Ronald Alan wrote:

> Hi,
>  
> I am trying to use the DumpAlignedGenes.pl in version 67 of the ensembl-compara API. I have made the following necessary changes to the script (attached script has
> these changes):
>  
> 1. When running the script without arguments as a test I get this error:
>  
> ------------------ DEPRECATED ---------------------
> Deprecated method call in file DumpAlignedGenes.pl line 365.
> Method Bio::EnsEMBL::DBSQL::MetaContainer::get_Species is deprecated.
> Call is deprecated. Use $self->get_common_name() / $self->get_classification() / $self->get_scientific_name() instead
> Ensembl API version = 67
> ---------------------------------------------------
> -------------------- EXCEPTION --------------------
> MSG: No matches found for name 'Homininae Homo sapiens' and assembly '--undef--'
> STACK Bio::EnsEMBL::Compara::DBSQL::GenomeDBAdaptor::fetch_by_name_assembly
> /home/rharris1/work/ensembl/api/ensembl-compara/modules/Bio/EnsEMBL/Compara/DBSQL/GenomeDBAdaptor.pm:131
> STACK toplevel DumpAlignedGenes.pl:369
> Ensembl API version = 67
>  
> I changed line 365 from
>  
> my $this_binomial_id = $this_meta_container_adaptor->get_Species->binomial;
>  
> to
>  
> my $this_binomial_id = $this_meta_container_adaptor->get_scientific_name;
> $this_binomial_id =~ s/\s/_/;
>  
> which fixes this error.
>  
> 2. I also get this similar error:
>  
> ------------------ DEPRECATED ---------------------
> Deprecated method call in file DumpAlignedGenes.pl line 436.
> Method Bio::EnsEMBL::DBSQL::MetaContainer::get_Species is deprecated.
> Call is deprecated. Use $self->get_common_name() / $self->get_classification() / $self->get_scientific_name() instead
> Ensembl API version = 67
> ---------------------------------------------------
> -------------------- EXCEPTION --------------------
> MSG: No matches found for name 'Murinae Rattus norvegicus' and assembly '--undef--'
> STACK Bio::EnsEMBL::Compara::DBSQL::GenomeDBAdaptor::fetch_by_name_assembly
> /home/rharris1/work/ensembl/api/ensembl-compara/modules/Bio/EnsEMBL/Compara/DBSQL/GenomeDBAdaptor.pm:131
> STACK toplevel DumpAlignedGenes.pl:440
> Ensembl API version = 67
> ---------------------------------------------------
>  
> I changed line 436 from
>  
> my $source_binomial_id = $meta_container_adaptor->get_scientific_name;
>  
> to
>  
> my $source_binomial_id = $meta_container_adaptor->get_scientific_name;
> $source_binomial_id =~ s/\s/_/;
>  
> which fixes this error.
>  
> ---------------------------------------------------------------------
>  
> Now I am getting this error:
>  
> Can't call method "get_all_Genes" on unblessed reference at DumpAlignedGenes.pl line 463.
>  
> Here is line 463:
>  
> my $mapped_genes = $align_slice->{'slices'}->{$source_genome_db->name}->get_all_Genes(
>  
> >>>How do I fix this error?<<<
>  
>  
> Thank you for your time.
>  
> Alan
>  
>  
> R. Alan Harris, Ph.D.
> Assistant Professor
> Bioinformatics Research Laboratory
> Epigenomics Data Analysis and Coordination Center
> Department of Molecular and Human Genetics
> Baylor College of Medicine
> Houston, TX 77030
> 713-798-7695
> 
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DumpAlignedGenes.pl
Type: application/x-perl
Size: 16816 bytes
Desc: 
URL: <http://mail.ensembl.org/pipermail/dev_ensembl.org/attachments/20120531/2efb7423/attachment.pl>


More information about the Dev mailing list