comparison 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
comparison
equal deleted inserted replaced
18:2e6c48910819 19:bde6b1d09f7d
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 >= 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
134 # frame that it should be in. 134 # frame that it should be in.
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 139 if ns > ne:
140 ne, ns = ns, ne # dunno why but sometimes happens
140 feature.location = FeatureLocation(ns, ne, strand=st) 141 feature.location = FeatureLocation(ns, ne, strand=st)
141 142
142 if hasattr(feature, "sub_features"): 143 if hasattr(feature, "sub_features"):
143 for subfeature in feature.sub_features: 144 for subfeature in feature.sub_features:
144 __update_feature_location(subfeature, parent, protein2dna) 145 __update_feature_location(subfeature, parent, protein2dna)