Browse Source

Added check for Gap in the GFF

Stephen Ficklin 4 years ago
parent
commit
8b0cfedbe4
1 changed files with 9 additions and 0 deletions
  1. 9 0
      tripal_chado/includes/TripalImporter/GFF3Importer.inc

+ 9 - 0
tripal_chado/includes/TripalImporter/GFF3Importer.inc

@@ -1154,6 +1154,15 @@ class GFF3Importer extends TripalImporter {
       $ret['target'] = [];
     }
 
+    // Make sure we only have one Gap if it exists
+    if (array_key_exists('Gap', $attr_others) and count($attr_others['Gap']) > 1) {
+      throw new Exception(t('Each feature can only have one "Gap" attribute. The feature %uniquename has more than one.',
+          [
+            '%uniquename' => $ret['uniquename'],
+          ]));
+    }
+
+
     // Add the properties and parent.
     $ret['properties'] = $attr_others;
     $ret['parent'] = $attr_parent;