Skip to content

Commit df8634a

Browse files
committed
minor change
1 parent 0789aa1 commit df8634a

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

genbank/genbank.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ function process(){
164164
parent::QQuadO_URL($gb_res, $this->getVoc().'fasta-seq', 'https://www.ncbi.nlm.nih.gov/sviewer/viewer.cgi?sendto=on&db=nucest&dopt=fasta&val='.$parsed_version_arr['gi'])
165165
);
166166

167-
168-
169167
foreach($parsed_accession_arr[0] as $acc ){
170168
parent::AddRDF(
171169
parent::triplifyString($gb_res, $this->getVoc()."accession", $acc)
@@ -235,13 +233,29 @@ function process(){
235233
*/
236234
function parseFeatures($feature_arr){
237235
$rm = array();
236+
//get a copy of the features array
237+
$features = $this->getFeatures();
238+
$feat_keys = array_keys($features);
238239
foreach($feature_arr as $feat){
239240
$feature_raw = utf8_encode(trim($feat['value']));
241+
echo "\n\n".$feature_raw."\n\n";
242+
243+
$arr = explode("\n", $feature_raw);
244+
print_r($arr);exit;
240245
if(strlen($feature_raw)){
241246
//remove multiple spaces and newlines
242247
$feature_raw = preg_replace('/\s\s*/', ' ', $feature_raw);
243-
print_r($feature_raw);
244-
echo "\n***\n";
248+
//now construct a regex for every section
249+
$regex_string = "(.*)";
250+
$regex_groups = array();
251+
foreach($feat_keys as $aKey){
252+
if(strpos($feature_raw, $aKey)){
253+
$regex_string .= "\s+".$aKey."\s+(.*)";
254+
$regex_groups[] = $aKey;
255+
}
256+
}//foreach
257+
$regex = "/".$regex_string."/";
258+
echo "\n".$feature_raw."\n".$regex."\n";exit;
245259
}
246260
}
247261
return $rm;

0 commit comments

Comments
 (0)