Skip to content

Commit 776165c

Browse files
update to drugbank file location and name
1 parent aa42d34 commit 776165c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drugbank/drugbank.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DrugBankParser extends Bio2RDFizer
3636
function __construct($argv) {
3737
parent::__construct($argv,"drugbank");
3838
parent::addParameter('files', true, 'all|drugbank','all','Files to convert');
39-
parent::addParameter('download_url',false,null,'http://www.drugbank.ca/system/downloads/current/');
39+
parent::addParameter('download_url',false,null,'https://www.drugbank.ca/releases/5-0-5/downloads/all-full-database');
4040
parent::initialize();
4141
}
4242

@@ -70,8 +70,9 @@ function Run()
7070
$dataset_description = '';
7171
foreach($files AS $f) {
7272
if($f == 'drugbank') {
73-
$file = 'drugbank.xml.zip';
73+
$file = 'drugbank_all_full_database.xml.zip';
7474
$lname = 'drugbank';
75+
$insidezip_file = "full database.xml";
7576
}
7677
$fnx = 'parse_'.$f;
7778

@@ -91,7 +92,7 @@ function Run()
9192
if(file_exists($indir.$file)) {
9293
// call the parser
9394
echo "processing $file ...".PHP_EOL;
94-
$this->$fnx($indir,$file);
95+
$this->$fnx($indir,$file, $insidezip_file);
9596
echo "done".PHP_EOL;
9697
parent::clear();
9798
}
@@ -146,9 +147,9 @@ function Run()
146147
}
147148

148149

149-
function parse_drugbank($ldir,$infile)
150+
function parse_drugbank($ldir,$infile, $insidezip_file)
150151
{
151-
$xml = new CXML($ldir.$infile);
152+
$xml = new CXML($ldir.$infile, $insidezip_file);
152153
while($xml->parse("drug") == TRUE) {
153154
if(isset($this->id_list) and count($this->id_list) == 0) break;
154155
$this->parseDrugEntry($xml);

0 commit comments

Comments
 (0)