Skip to content
Snippets Groups Projects
Commit 3bac5d4d authored by nina.marthe_ird.fr's avatar nina.marthe_ird.fr
Browse files

load intersect is now much quicker. however there might be unexpected...

load intersect is now much quicker. however there might be unexpected behaviour in detect_gene_copies (or maybe elsewhere) if a segment is present several times in a feature (duplication within the feature). this case was not encountered in rice and human data, but it is technically possible.
parent 55469d98
No related branches found
No related tags found
No related merge requests found
......@@ -79,8 +79,10 @@ def add_child(feat,new_child):
# add a segment to an existing feature
def add_seg(feat_id,new_seg_oriented):
if new_seg_oriented not in Features[feat_id].segments_list_source:
Features[feat_id].segments_list_source.append(new_seg_oriented)
# if new_seg_oriented in Features[feat_id].segments_list_source:
# print("seg already in feat, duplicate segment ! feature:",feat_id,"segment:",new_seg_oriented)
# print("list for now :",Features[feat_id].segments_list_source)
Features[feat_id].segments_list_source.append(new_seg_oriented)
# add the position of the feature on its first and last segment
def add_pos(feature_id):
......@@ -110,9 +112,9 @@ def add_segment_to_discontinuous_feature(line,feature,seg_oriented,current_start
if (other_part.start==current_start) and (other_part.stop==current_stop): # look for the current part of the feature to add the segment
add_seg(other_part_id,seg_oriented)
added=True
break
if added==False : # if the right part of the feature was not found, create a new part for the feature
new_part_name=feature.id+''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(7))
feature.other_parts_list.append(new_part_name)
[chr,start,stop]=[line[4],int(line[7]),int(line[8])]
segments_list=[seg_oriented]
Features[new_part_name]=Feature(feature.id,feature.type,chr,start,stop,feature.annot,feature.childs,feature.parent,segments_list,feature.strand,True,True)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment