comparison gff3_rebase.py @ 23:39b717d934a8 draft

planemo upload for repository https://github.com/usegalaxy-eu/temporary-tools/tree/master/jbrowse2 commit be2268f4c11d54bdd44789dd88dd9017cad27887-dirty
author fubar
date Sat, 03 Feb 2024 10:17:27 +0000
parents bde6b1d09f7d
children b1260bca5fdc
comparison
equal deleted inserted replaced
22:2ddd41a0c2d5 23:39b717d934a8
115 end = feature.location.end 115 end = feature.location.end
116 if protein2dna: 116 if protein2dna:
117 start *= 3 117 start *= 3
118 end *= 3 118 end *= 3
119 119
120 if parent.location.strand !=None and parent.location.strand >= 0: 120 if parent.location.strand != None and parent.location.strand >= 0:
121 ns = parent.location.start + start 121 ns = parent.location.start + start
122 ne = parent.location.start + end 122 ne = parent.location.start + end
123 st = +1 123 st = +1
124 else: 124 else:
125 ns = parent.location.end - end 125 ns = parent.location.end - end
135 if ns < 0: 135 if ns < 0:
136 ns %= 3 136 ns %= 3
137 if ne < 0: 137 if ne < 0:
138 ne %= 3 138 ne %= 3
139 if ns > ne: 139 if ns > ne:
140 ne, ns = ns, ne # dunno why but sometimes happens 140 ne, ns = ns, ne # dunno why but sometimes happens
141 feature.location = FeatureLocation(ns, ne, strand=st) 141 feature.location = FeatureLocation(ns, ne, strand=st)
142 142
143 if hasattr(feature, "sub_features"): 143 if hasattr(feature, "sub_features"):
144 for subfeature in feature.sub_features: 144 for subfeature in feature.sub_features:
145 __update_feature_location(subfeature, parent, protein2dna) 145 __update_feature_location(subfeature, parent, protein2dna)