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
786d72f2
"docs/git@forge.ird.fr:phim/rnaja-pipeline.git" did not exist on "ba84a572b4fda64ea735a95274306be465b76f88"
Commit
786d72f2
authored
1 year ago
by
nina.marthe_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
adapted the code to the changes made to handle several chromosomes
parent
7eb24644
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Graph_gff.py
+2
-10
2 additions, 10 deletions
Graph_gff.py
with
2 additions
and
10 deletions
Graph_gff.py
+
2
−
10
View file @
786d72f2
...
...
@@ -206,12 +206,12 @@ def graph_gff(graph_gff_file):
graph_gff_file
.
close
()
def
graph_gaf
(
graph_gaf_file
,
gfa
_file
):
def
graph_gaf
(
graph_gaf_file
,
segments
_file
):
print
(
"
generation of the graph
'
s gaf
"
)
graph_gaf_file
=
open
(
graph_gaf_file
,
'
w
'
)
output_graph_gaf
[
2
]
=
graph_gaf_file
seg_len
=
get_segments_length
(
gfa
_file
)
seg_len
=
get_segments_length
(
segments
_file
)
for
feature_id
in
Features
:
feature
=
Features
[
feature_id
]
feature_segments
=
feature
.
segments_list_source
...
...
@@ -231,22 +231,14 @@ def graph_gaf(graph_gaf_file,gfa_file):
graph_gaf_file
.
close
()
def
get_segments_length
(
gfa
):
file_gfa
=
open
(
gfa
,
'
r
'
)
lines_gfa
=
file_gfa
.
readlines
()
file_gfa
.
close
()
seg_len
=
{}
segment_encountered
=
False
for
line
in
lines_gfa
:
line
=
line
.
split
()
if
(
line
[
0
]
==
"
S
"
):
# get the length of the segment
segment_encountered
=
True
seg_id
=
'
s
'
+
line
[
1
]
seg_len
[
seg_id
]
=
len
(
line
[
2
])
elif
segment_encountered
==
True
:
# so we don't have to go through all the L lines. once we found one S, if we find something else than S it stops
return
seg_len
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