Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GrAnnoT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DIADE
dynadiv
GrAnnoT
Commits
2c2ab699
Commit
2c2ab699
authored
1 year ago
by
nina.marthe_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
adapted the code to use only the segments of the gfa file to handle smaller files
parent
0b000c70
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Graph_gff.py
+7
-8
7 additions, 8 deletions
Graph_gff.py
with
7 additions
and
8 deletions
Graph_gff.py
+
7
−
8
View file @
2c2ab699
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment