diff gff3_rebase.py @ 19:bde6b1d09f7d draft

planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit 1290bf486bc55c02fecd0327de10a28655a18e81-dirty
author fubar
date Tue, 30 Jan 2024 06:05:03 +0000
parents 4c201a3d4755
children 39b717d934a8
line wrap: on
line diff
--- a/gff3_rebase.py	Mon Jan 29 02:34:43 2024 +0000
+++ b/gff3_rebase.py	Tue Jan 30 06:05:03 2024 +0000
@@ -117,7 +117,7 @@
         start *= 3
         end *= 3
 
-    if parent.location.strand >= 0:
+    if parent.location.strand !=None and parent.location.strand >= 0:
         ns = parent.location.start + start
         ne = parent.location.start + end
         st = +1
@@ -136,7 +136,8 @@
         ns %= 3
     if ne < 0:
         ne %= 3
-
+    if ns > ne:
+        ne, ns = ns, ne # dunno why but sometimes happens
     feature.location = FeatureLocation(ns, ne, strand=st)
 
     if hasattr(feature, "sub_features"):