[ensembl-dev] Chromosome list

Andy Yates ayates at ebi.ac.uk
Thu Jan 10 16:59:27 GMT 2013


Hi Toni,

Please note if you are using the core API that this information is available from the Slices. You can get the rank using the following:

my ($rank_attrib) = @{$slice->get_all_Attributes('karyotype_rank')};
printf("Slice %s has a rank of %d\n", $slice->seq_region_name(), $rank_attrib->value());

You can combine this with a filter for those with a rank & order by ascending position using the following bit of Perl:

my @ordered = 
	map { $_->[0] }
	sort { $a->[1] <=> $b->[1] } 
	map { my ($rank) = @{$_->get_all_Attributes('karyotype_rank')}; [$_, $rank->value()]; }
	grep { $_->has_karyotype() }
	@{$slices};

Best regards,

Andy

Andrew Yates                   Ensembl Core Software Project Leader
EMBL-EBI                       Tel: +44-(0)1223-492538
Wellcome Trust Genome Campus   Fax: +44-(0)1223-494468
Cambridge CB10 1SD, UK         http://www.ensembl.org/

On 10 Jan 2013, at 16:47, Toni Hermoso Pulido <toni.hermoso at crg.cat> wrote:

> Yes, this works for me.
> 
> I'll adapt my scripts.
> 
> Thanks for replying so fast!
> 
> Al 01/10/13 17:20, En/na Anne Parker ha escrit:
>> Hi Toni
>> 
>> We recently switched over to storing the chromosome list in the core database, which we currently retrieve with this SQL:
>> 
>> select s.name
>>       from seq_region s, seq_region_attrib sa, attrib_type a
>>       where sa.seq_region_id = s.seq_region_id
>>         and sa.attrib_type_id = a.attrib_type_id
>>         and a.code = "karyotype_rank"
>>       order by abs(sa.value);
>> 
>> for web purposes.
>> 
>> Is this the kind of thing you're looking for?
>> 
>> Cheers
>> 
>> Anne
>> 
>> 
>> 
>> On 10 Jan 2013, at 16:13, Toni Hermoso Pulido <toni.hermoso at crg.cat> wrote:
>> 
>>> Hello,
>>> 
>>> I asked about chromosomes list some months ago:
>>> http://lists.ensembl.org/pipermail/dev/2012-June/007652.html
>>> and, in the end, I've been using ini files for having a list of chromosomes:
>>> http://cvs.sanger.ac.uk/cgi-bin/viewvc.cgi/public-plugins/ensembl/conf/ini-files/?root=ensembl
>>> 
>>> However, I noticed that in version 69, ENSEMBL_CHROMOSOMES paramater got commented -> 'preceding ;'
>>> Example here: http://cvs.sanger.ac.uk/cgi-bin/viewvc.cgi/public-plugins/ensembl/conf/ini-files/Bos_taurus.ini?revision=1.92&root=ensembl&view=markup
>>> 
>>> Does it mean that this listing will not be 'reliable' anymore?
>>> If so, which should be the preferable way to follow to get that information from now on?
>>> 
> 
> -- 
> Toni Hermoso Pulido
> Bioinformatician
> 
> Bioinformatics Core Facility
> http://biocore.crg.cat
> CRG - Centre de Regulació Genòmica (Room 439)
> Parc de Recerca Biomèdica de Barcelona (PRBB)
> Doctor Aiguader, 88
> 08003 Barcelona
> 
> toni.hermoso at crg.cat
> Phone: +34 93 316 02 02
> 
> 
> _______________________________________________
> 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/





More information about the Dev mailing list