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

adapted the code to use only the segments of the gfa file to handle smaller files

parent 0b000c70
No related branches found
No related tags found
No related merge requests found
......@@ -231,14 +231,13 @@ def graph_gaf(graph_gaf_file,segments_file):
graph_gaf_file.close()
def get_segments_length(gfa):
file_gfa=open(gfa,'r')
lines_gfa=file_gfa.readlines()
file_gfa.close()
def get_segments_length(segments):
file_segments=open(segments,'r')
lines_segments=file_segments.readlines()
file_segments.close()
seg_len={}
for line in lines_gfa:
for line in lines_segments:
line=line.split()
if (line[0]=="S"): # get the length of the segment
seg_id='s'+line[1]
seg_len[seg_id]=len(line[2])
seg_id='s'+line[1]
seg_len[seg_id]=len(line[2])
return seg_len
\ No newline at end of file
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