Monday, May 30, 2016

Dolphins, crows and apes - as clever as it gets

Dolphins, just like crows & apes are very smart. In some way they represent the pinnacle of the independent evolution of intelligence in species that dwell in the oceans, fly in the sky and walk on land respectively. What can the brains of these distinct yet similar taxa tell us about intelligence? Will they be able to provide crucial insight needed to understand intelligence, thought and the brain? How can they guide artificial intelligence research?

All these may seem far fetched questions for another day. However, we are not too far away. A study published in the year 2013, "Large-scale network organization in the avian forebrain: a connectivity matrix and theoretical analysis" was able to generate a preliminary map of a avian forebrain. Work in this field is progressing at an incredible pace. It might be worth noting that one of the co-authors Murray Shanahan is actually a Professor of Cognitive Robotics and has written the book "The Technological Singularity". So the fields are not so far apart after all. 

Few months ago, while writing up my PhD thesis "Speciation genomics: A perspective from vertebrate systems" i began to realize how intricately linked the world is. One needs to understand the evolutionary genetics of phenotypic traits to be able understand speciation and adaptation. This understanding of genetics will play an important role someday in the future to look at traits like "intelligence". We may infact be able to unravel the great mysteries of the brain and its evolution. 

Understanding the brain, its evolution and genetics definitely have their own merits. The next step into the world of artificial intelligence and culture actually seems exciting at this point. What kind of morality would different machine cultures create? Would speciation "co-evolve" with culture in artificial systems as much as it seems to in the natural world?

Sunday, May 1, 2016

Ensembl Perl API to get all intron lengths in Human genom

The below script will get all stable id's from Ensembl and prints out the intron lengths for each transcript of every gene. Along with intron length, the flanking exon id's are also printed. One can get the upstream and downstream intron length for each exon using the output.

The output would look like this:
Gene Id                     Transcript Id            Previous Exon          Next Exon               Intron length
ENSG00000084674 ENST00000233242 ENSE00000932268 ENSE00000932269 717 ENSG00000084674 ENST00000233242 ENSE00000932269 ENSE00000932270 2338 ENSG00000084674 ENST00000233242 ENSE00000932270 ENSE00000932271 112 ENSG00000084674 ENST00000233242 ENSE00000932271 ENSE00000719046 1100 ENSG00000084674 ENST00000233242 ENSE00000719046 ENSE00000718984 261 ENSG00000084674 ENST00000233242 ENSE00000718984 ENSE00000932272 863 ENSG00000084674 ENST00000233242 ENSE00000932272 ENSE00000932273 1663 ENSG00000084674 ENST00000233242 ENSE00000932273 ENSE00000718481 1240 ENSG00000084674 ENST00000233242 ENSE00000718481 ENSE00000542194 482

 use strict;  
 use warnings;  
 use Bio::EnsEMBL::Registry;  
 use Bio::SeqIO;  
 use Getopt::Long;  
 my $registry = 'Bio::EnsEMBL::Registry';  
 ## Load the databases into the registry  
  -host => '',  
  -user => 'anonymous'  
 ## Get the gene adaptor for human  
     my $gene_adaptor = $registry->get_adaptor( 'Human', 'Core', 'Gene' );  
     # Fetch my gene of interest usning ensemble ID  
     my @gene_ids = @{$gene_adaptor->list_stable_ids()};  
 foreach my $geneid(@gene_ids){  
 #print "$geneid\n";  
 my $gene = $gene_adaptor->fetch_by_stable_id($geneid);  
  foreach my $transcript (@{ $gene->get_all_Transcripts }) {  
   foreach my $intron (@{ $transcript->get_all_Introns }) {  
   print $gene->stable_id,"\t",$transcript->stable_id,"\t",$intron->prev_Exon->stable_id,"\t",$intron->next_Exon->stable_id,"\t",$intron->length,"\n";