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

added function to get a chromosome's path

parent ae5fa3c2
No related branches found
No related tags found
No related merge requests found
......@@ -306,15 +306,24 @@ def compare_strand(list_1,list_2,list_1_unstrand,list_2_unstrand):
same_strand_count+=1
return [seg_common,same_strand_count]
def add_target_genome_path(feature_id,target_genome_path):
feature=Features[feature_id]
list_seg=feature.segments_list_source
first_seg=get_first_seg(list_seg)
last_seg=get_first_seg(reversed(list_seg))
feature_path=[]
if first_seg!='':
feature_path=get_feature_path(target_genome_path,first_seg,last_seg)
feature.segments_list_target=feature_path
def get_chr_path(feature_id,target_genome_paths):
feat_chr_number=Features[feature_id].chr[3:]
for path_name in target_genome_paths.keys():
if feat_chr_number in path_name[-3:]:
return target_genome_paths[path_name]
return False
def add_target_genome_path(feature_id,target_genome_paths):
target_genome_path=get_chr_path(feature_id,target_genome_paths)
if target_genome_paths!=False:
feature=Features[feature_id]
list_seg=feature.segments_list_source
first_seg=get_first_seg(list_seg)
last_seg=get_first_seg(reversed(list_seg))
feature_path=[]
if first_seg!='':
feature_path=get_feature_path(target_genome_path,first_seg,last_seg)
feature.segments_list_target=feature_path
def get_feature_path(target_genome_path,first_seg,last_seg):
# find the path in target genome
......
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