This is a test version of Biostars. For the public version, visit https://www.biostars.org.
ensembl perlapi cannot get adaptor

While trying to get adaptor using perlapi, i get undefined object, so im writting this to ask for help. my goal is to get frequency of genotypes and alleles for rs2242480, so im connecting to variation database. when i execute "$variation_adaptor->db->use_vcf(1);" i get: "Can't call method "db" on an undefined value"

use lib "/usr/local/src/ensembl/modules";
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 $variation_adaptor = $registry->get_adaptor('homo_sapiens', 'variation', 'variation');
$variation_adaptor->db->use_vcf(1);
perl-api snp ensembl

1 answer

Have you installed the external dependancy "Tabix"? The use of the VCFCollection module does requires tabix. Please check our help on "Alleles and genotypes " and installation page for more details. Will's post is worthwhile a look too!

i have tried to install it but i had problems.

root@splitbit:/usr/local/src/tabix-master/perl# perl Makefile.PL PREFIX=/usr/local/src/
Only one of PREFIX or INSTALL_BASE can be given.  Not both.
root@splitbit:/usr/local/src/tabix-master/perl# make
root@splitbit:/usr/local/src/tabix-master/perl# make install
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Appending installation info to /root/src//lib/x86_64-linux-gnu/perl/5.20.2/perllocal.pod 
root@splitbit:/usr/local/src/tabix-master/perl# ls
blib  Makefile  Makefile.PL  MANIFEST  MYMETA.json  MYMETA.yml  pm_to_blib  t  Tabix.bs  Tabix.c  TabixIterator.pm  Tabix.o  Tabix.pm  Tabix.xs  typemap
root@splitbit:/usr/local/src/tabix-master/perl# chmod 755 Tabix.o 
root@splitbit:/usr/local/src/tabix-master/perl# ./Tabix.o 
bash: ./Tabix.o: cannot execute binary file: Exec format error
root@splitbit:/usr/local/src/tabix-master/perl# file ./Tabix.o 
./Tabix.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

It seems you're trying to run an object file (tabix.o). These are usually intermediates in the compilation process and are not directly executable.

Log in to answer this question.