Parcourir la source

Added a line to remove special characters from the OBO file. The Cell Ontology had a special character that caused the loader to fail

spficklin il y a 13 ans
Parent
commit
9a0ffbe8d5
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 5 0
      tripal_cv/obo_loader.php

+ 5 - 0
tripal_cv/obo_loader.php

@@ -529,8 +529,13 @@ function tripal_cv_obo_parse($obo_file,&$obo,&$header){
 
       // remove newlines
       $line = rtrim($line);  
+
+      // remove any special characters that may be hiding
+      $line = preg_replace('/[^(\x20-\x7F)]*/','', $line);
+
       // skip empty lines
       if(strcmp($line,'')==0) { continue; }
+
       //remove comments from end of lines
       $line = preg_replace('/^(.*?)\!.*$/','\1',$line);  // TODO: if the explamation is escaped