@@ -33,8 +33,8 @@ class irefindexParser extends Bio2RDFizer
33
33
{
34
34
function __construct ($ argv ) { //
35
35
parent ::__construct ($ argv ,"irefindex " );
36
- parent ::addParameter ('files ' ,true ,'all|10090|10116|4932|559292|562|6239|7227|9606|A ' ,'all ' ,'all or comma-separated list of files to process ' );
37
- parent ::addParameter ('version ' ,false ,'08122013|03022013|10182011 ' ,'08122013 ' ,'dated version of files to download ' );
36
+ parent ::addParameter ('files ' ,true ,'all|10090|10116|4932|559292|562|6239|7227|9606 ' ,'all ' ,'all or comma-separated list of files to process ' );
37
+ parent ::addParameter ('version ' ,false ,'07042015| 08122013|03022013|10182011 ' ,'07042015 ' ,'dated version of files to download ' );
38
38
parent ::addParameter ('download_url ' ,false ,null ,'http://irefindex.org/download/irefindex/data/current/psi_mitab/MITAB2.6/ ' );
39
39
parent ::initialize ();
40
40
}
@@ -55,9 +55,8 @@ function Run()
55
55
56
56
foreach ($ files AS $ file ) {
57
57
$ download = parent ::getParameterValue ('download ' );
58
-
59
- $ base_file = ucfirst ($ file ).".mitab. " .parent ::getParameterValue ("version " ).".txt " ;
60
- $ zip_file = $ base_file .".zip " ;
58
+ $ version = parent ::getParameterValue ("version " );
59
+ $ zip_file = ucfirst ($ file ).".mitab. " .$ version .".txt.zip " ;
61
60
$ lfile = $ ldir .$ zip_file ;
62
61
63
62
$ gz = (strstr (parent ::getParameterValue ('output_format ' ),".gz " ) === FALSE )?false :true ;
@@ -82,9 +81,14 @@ function Run()
82
81
trigger_error ("Unable to open $ lfile " );
83
82
exit ;
84
83
}
84
+ if ($ zin ->numFiles != 1 ) {
85
+ trigger_error ("Found more than one file ... using first file " );
86
+ }
87
+ $ f = $ zin ->statIndex (0 );
88
+ $ base_file = $ f ['name ' ];
85
89
if (($ fp = $ zin ->getStream ($ base_file )) === FALSE ) {
86
- trigger_error ("Unable to get $ base_file in ziparchive $ lfile " );
87
- return FALSE ;
90
+ trigger_error ("Unable to get $ base_file in ziparchive $ lfile " );
91
+ return FALSE ;
88
92
}
89
93
parent ::setReadFile ($ lfile );
90
94
parent ::getReadFile ()->setFilePointer ($ fp );
0 commit comments