Dear all, I am trying to install BioMart Perl API (in order to automatize orthologs retrieval in other species for some gene), and I have followed the instructions here. And I'm almost done! Yet, I have the following error when I try to run my example script:
perl apiExample17112015.pl
junk after document element at line 18, column 0, byte 465 at /home/tlorin/perl5/perlbrew/perls/perl-5.20.2/lib/site_perl/5.20.2/x86_64-linux-thread-multi/XML/Parser.pm line 187.
Here is my example script:
# An example script demonstrating the use of BioMart API.
# This perl API representation is only available for configuration versions >= 0.5
use strict;
use lib '/home/tlorin/biomart-perl/lib/';
use BioMart::Initializer;
use BioMart::Query;
use BioMart::QueryRunner;
my $confFile = "../conf/martURLLocation.xml";
#
# NB: change action to 'clean' if you wish to start a fresh configuration
# and to 'cached' if you want to skip configuration step on subsequent runs from the same registry
#
my $action='clean';
my $initializer = BioMart::Initializer->new('registryFile'=>$confFile, 'action'=>$action);
my $registry = $initializer->getRegistry;
my $query = BioMart::Query->new('registry'=>$registry,'virtualSchemaName'=>'default');
$query->setDataset("drerio_gene_ensembl");
$query->addFilter("ensembl_gene_id", ["ENSDARG00000003732"]);
$query->addAttribute("ensembl_gene_id");
$query->addAttribute("ensembl_transcript_id");
$query->addAttribute("pformosa_homolog_ensembl_gene");
$query->addAttribute("gmorhua_homolog_ensembl_gene");
$query->addAttribute("amexicanus_homolog_ensembl_gene");
$query->addAttribute("cintestinalis_homolog_ensembl_gene");
$query->addAttribute("lchalumnae_homolog_ensembl_gene");
$query->addAttribute("trubripes_homolog_ensembl_gene");
$query->formatter("TSV");
my $query_runner = BioMart::QueryRunner->new();
############################## GET COUNT ############################
# $query->count(1);
# $query_runner->execute($query);
# print $query_runner->getCount();
#####################################################################
############################## GET RESULTS ##########################
# to obtain unique rows only
# $query_runner->uniqueRowsOnly(1);
$query_runner->execute($query);
$query_runner->printHeader();
$query_runner->printResults();
$query_runner->printFooter();
I must precise that I am not familiar with Perl and I have no idea of what could happen here. Any idea? Has someone already experienced that?
Thanks a lot for your time!
See my answer below, it was indeed a problem with this file but not due to initial blank line. Thanks :D