Hi All, I am a Novice in perl and again in Biomart! I am trying to access COSMIC through Biomart. I am using a this code
use strict;
use BioMart::Initializer;
use BioMart::Query;
use BioMart::QueryRunner;
my $confFile ="C:/Users/Manjula/workspace/biomart-perl/conf/martDBLocation.xml";
print $confFile;
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("COSMIC52B");
$query->addFilter("hist_primary", ["adenoma"]);
$query->addFilter("samp_gene_mutated", ["y"]);
$query->addFilter("site_primary", ["small_intestine"]);
$query->addAttribute("id_sample");
$query->addAttribute("sample_name");
$query->addAttribute("sample_source");
$query->addAttribute("tumour_source");
$query->addAttribute("gene_name");
$query->addAttribute("accession_number");
$query->addAttribute("id_mutation");
$query->addAttribute("cds_mut_syntax");
$query->addAttribute("aa_mut_syntax");
$query->addAttribute("zygosity");
$query->addAttribute("site_primary");
$query->addAttribute("hist_primary");
$query->addAttribute("pubmed_pmid");
$query->formatter("TSV");
my $query_runner = BioMart::QueryRunner->new();
############################## GET COUNT ############################
$query->count(1);
$query_runner->execute($query);
print $query_runner->getCount();
#####################################################################
############################## GET RESULTS ##########################
$query_runner->uniqueRowsOnly(1);
$query_runner->execute($query);
$query_runner->printHeader();
$query_runner->printResults();
$query_runner->printFooter();
#####################################################################
This is my Registry File!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE MartRegistry>
<MartRegistry>
<MartDBLocation
name = "msd_mart_4"
displayName = "My BioMart Database"
databaseType = "mysql"
host = "martdb.ebi.ac.uk"
port = "3306"
database = "msd_mart_4"
schema = "msd_mart_4"
user = "anonymous"
password = ""
visible = "1"
default = ""
includeDatasets = ""
martUser = ""
/>
</MartRegistry>
I know there is something wrong with the registry file, But I get a different error which I should attend first!
The syntax of the command is incorrect. 'cp' is not recognized as an internal or external command, operable program or batch file. Couldn't open C:/Users/Manjula/workspace/biomart-perl/conf/registryDOMXML: No such file or directory at C:/Perl64/lib/BioMart/Initializer.pm line 661
When I look it seems this line in Initializer.pm is causing this
system("cp $registryFile $copyRegistryFile");
I know that 'cp' is a Linux command. But I am running windows 7 with Eclipse Version: Helios Service Release 1 and EPIC 0.6.40
Any help is appreciated as I am stuck here for weeks.
Thanking in advance! Manjula
Shouldn't the path of my $confFile contain backslashes instead of slashes?
Seems your problem is obvious. Linux commands aren't going to work under Windows. Either obtain Windows-specific versions of the package or use Linux.
..or use it from Cygwin. Did you download the .zip or the .tgz? (former should be for Windows)