Browse 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 13 years ago
parent
commit
9a0ffbe8d5
1 changed files with 5 additions and 0 deletions
  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