From c6e91edf1f6d1fdd8b631fc3934852c99e9ce05f Mon Sep 17 00:00:00 2001
From: Paulo Lins <plins@ebi.ac.uk>
Date: Thu, 25 Apr 2024 10:24:43 +0100
Subject: [PATCH] modify reg. feature payload

---
 lib/EnsEMBL/REST/Model/Overlap.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/EnsEMBL/REST/Model/Overlap.pm b/lib/EnsEMBL/REST/Model/Overlap.pm
index 0dc58839..77200ef4 100644
--- a/lib/EnsEMBL/REST/Model/Overlap.pm
+++ b/lib/EnsEMBL/REST/Model/Overlap.pm
@@ -160,7 +160,15 @@ sub to_hash {
   my ($self, $features, $feature_type) = @_;
   my @hashed;
   foreach my $feature (@{$features}) {
-    my $hash = $feature->summary_as_hash();
+
+    my $hash;
+    
+    if (lc($feature_type)  eq 'regulatory') {
+      $hash = $feature->summary_as_hash_2(); 
+    } else {
+      $hash = $feature->summary_as_hash();
+    }
+  
     foreach my $key (@KNOWN_NUMERICS) {
       my $v = $hash->{$key};
       $hash->{$key} = ($v*1) if defined $v;
-- 
GitLab