File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,7 @@ function getSNPs($clinical_flag = false)
151
151
$ clinical = array ("pathogenic " ,"probable-pathogenic " ,"drug-response " ,"other " );
152
152
if ($ clinical_flag == true ) {
153
153
$ term = implode ("[Clinical Significance] or " ,$ all );
154
- $ term = '" ' .substr ($ term ,0 )."\" [Clinical Significance] " ;
154
+ $ term = '" ' .substr ($ term ,0 )."[Clinical Significance] " ;
155
155
} else {
156
156
$ term = "snp " ;
157
157
}
@@ -160,16 +160,15 @@ function getSNPs($clinical_flag = false)
160
160
echo "Downloading snp list " ;
161
161
$ xmlfile = $ this ->getParameterValue ('indir ' ).'snp.list.xml ' ;
162
162
$ retmax = 10000000 ;
163
- // $retmax = 10;
164
163
$ start = 0 ;
165
164
$ mylist = array ();
166
165
do {
167
166
echo count ($ mylist ).PHP_EOL ;
168
167
$ url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=snp&retmax= $ retmax&term= " .urlencode ($ term )."&retstart= $ start " ;
169
-
170
168
$ c = file_get_contents ($ url );
171
169
preg_match_all ("/<Id>([^\<]+)<\/Id>/ " ,$ c ,$ m );
172
- if (!isset ($ m [1 ])) break ;
170
+ if (!isset ($ m [1 ]) or count ($ m [1 ]) == 0 ) break ;
171
+
173
172
$ mylist = array_merge ($ mylist ,$ m [1 ]);
174
173
$ start += $ retmax ;
175
174
} while (true );
You can’t perform that action at this time.
0 commit comments