iffirst_seg!='':# if the feature is not completly absent # add the else, output absent features
iffirst_seg!='':# if the feature is not completly absent # add the else, output absent features
[variation,feature_path_source_genome,feature_path_target_genome]=create_var(feature_id,first_seg,last_seg,walk,copy_id,feature_target_path,segments_on_target_genome)# removes the strands in the segment lists
eliffeature_path_source_genome[i]notinfeature_path_target_genome:# source_genome segment not in target genome, but target genome segment in source_genome : deletion or continue substitution
eliffeature_path_source_genome[i]notinfeature_path_target_genome:# source_genome segment not in target genome, but target genome segment in source_genome : deletion or continue substitution
ifvariation.type=='insertion':# print the current variation before treating the deletion
iffeat_var.type=='insertion':# print the current variation before treating the deletion
ifi<=len(feature_path_source_genome)-1:# if we didn't reach the length of the segment list for the first genome, the end is missing for the second genome
ifi<=len(feature_path_source_genome)-1:# if we didn't reach the length of the segment list for the first genome, the end is missing for the second genome
start_var=get_seg_occ(start_var_seg,walk,feat,copy_id,segments_on_target_genome)[1]-len(variation.alt)# start_var_seg is the segment AFTER the insertion
end_var=get_seg_occ(start_var_seg,self.walk,feat,self.copy_id,segments_on_target_genome)[2]+len(self.alt)# start_var_seg is the segment AFTER the insertion
start_var=get_seg_occ(start_var_seg,self.walk,feat,self.copy_id,segments_on_target_genome)[1]-len(self.alt)# start_var_seg is the segment AFTER the insertion