[ensembl-dev] genomic_align id on Compara API 67

Matthieu Muffato muffato at ebi.ac.uk
Fri Jul 3 13:12:22 BST 2015


Dear Sophie,

Sorry for the delayed reply. I think $genomic_align->dbID() and 
$genomic_align_block->dbID() are what you need.

$genomic_align->genomic_align_block_id() returns the dbID of the 
$genomic_align_block it is drawn from

Matthieu

On 01/07/15 16:54, Sophie Marion de Procé wrote:
> Dear all,
>
> I'm trying to obtain genomic_align objects using EPO mammals alignments
> from Compara, with the API 67.
> My aim is to look at the genomic_align_blocks and see if they are
> contiguous for a specific set of species. To group the genomic_align
> objects within a genomic_align_block, I've tried to use the
> $genomic_align_block->dbID() and
> $genomic_align_block->reference_genomic_align_id() functions, as well as
> the $genomic_align->genomic_align_block_id function.
> These seem to give the sort of id I need, however, regardless of the
> method I use, I do no get an id for the first and last genomic_align of
> each genomic_align_block!
> The error message is always something like "Use of uninitialized value
> $dbID in concatenation (.) or string"
>
> Could you please tell me what I'm doing wrong? Or suggest another way to
> achieve this?
>
> Below is a snippet of my code.
>
> Many thanks,
> Sophie.
>
>
> my $genomic_align_blocks =
> $genomic_align_block_adaptor->fetch_all_by_MethodLinkSpeciesSet_Slice($method_link_species_set,
> $query_slice,undef,undef,1);
> my @species = ("human","dog","mouse");
> foreach my $givenSp (@species) {
> foreach my $genomic_align_block (@$genomic_align_blocks) {
> my $dbID = $genomic_align_block->dbID();
> my $refID = $genomic_align_block->reference_genomic_align_id();
> my $genomic_aligns = $genomic_align_block->get_all_GenomicAligns();
> BLOCK: foreach my $genomic_align (@$genomic_aligns) {
> my $dnafrag = $genomic_align->dnafrag;
> my $genomic_align_dbID = $genomic_align->dbID;
> my $genome_db = $genomic_align->genome_db;
> my $gabID = $genomic_align->genomic_align_block_id;
> my $species = $genome_db->name;
> next BLOCK if ($species ne $givenSp);
> $countSpBlocks{$species} = $nbBlocks;
> my $chr = $dnafrag->name;
> my $start = $genomic_align->dnafrag_start;
> my $end = $genomic_align->dnafrag_end;
> my $strand = $genomic_align->dnafrag_strand;
> my $name = $dnafrag->name();
> my $sizeBlock = $end - $start + 1;
> print ("$species\t$start\t$end\t$strand\t$name\t$sizeBlock\t$gabID\t");
> }
> }
> }
>
>
>
> _______________________________________________
> Dev mailing list    Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info: http://lists.ensembl.org/mailman/listinfo/dev
> Ensembl Blog: http://www.ensembl.info/
>

-- 
Matthieu Muffato, Ph.D.
Ensembl Compara and TreeFam Project Leader
European Bioinformatics Institute (EMBL-EBI)
European Molecular Biology Laboratory
Wellcome Trust Genome Campus, Hinxton
Cambridge, CB10 1SD, United Kingdom
Room  A3-145
Phone + 44 (0) 1223 49 4631
Fax   + 44 (0) 1223 49 4468




More information about the Dev mailing list