Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
linked reads molecule ordering
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yoann DUFRESNE
linked reads molecule ordering
Commits
31dd7951
Commit
31dd7951
authored
May 16, 2020
by
Rayan Chikhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added script that renames ecoli molecule graph for evaluate.py
parent
05916aa3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
deconvolution/main/ecoli_to_interval_renamer.py
deconvolution/main/ecoli_to_interval_renamer.py
+31
-0
No files found.
deconvolution/main/ecoli_to_interval_renamer.py
0 → 100644
View file @
31dd7951
import
sys
if
len
(
sys
.
argv
)
<
3
:
print
(
"renames nodes of a simulated molecule graph into consecutive integers (for evaluate.py)"
)
exit
(
"usage: input output"
)
out
=
open
(
sys
.
argv
[
2
],
'w'
)
for
line
in
open
(
sys
.
argv
[
1
]):
# change all occurrences of
# xxxxNC_000913.3_100644_115643_0:0:0_0:0:0_14f1/1xxxx
# to:
# xxxx100644xxxx
while
"NC_000913"
in
line
:
s
=
line
.
split
(
"NC_000913"
)
before
=
s
[
0
]
#we'll keep that
cur
=
s
[
1
]
#we'll modify that
if
len
(
s
)
>
2
:
#we'll keep that too
after
=
"NC_000913"
+
'NC_000913'
.
join
(
s
[
2
:])
else
:
after
=
""
#print("before:",before+cur+after)
# now we modify 'cur' which hopefully corresponds to [NC_00913].3_100644_115643_0:0:0_0:0:0_14f1/1....[the next NC_00913]
s
=
cur
.
split
(
'_'
)
val
=
s
[
1
]
# this is the start coordinate of the molecule, save it
cur
=
'_'
.
join
(
s
[
2
:])
# restore the rest of cur
s
=
cur
.
split
(
'/'
)
rest
=
'/'
.
join
(
s
[
1
:])
# skip until the next '/' char
rest
=
rest
[
1
:]
cur
=
val
+
rest
#print("after:",before+cur+after)
line
=
before
+
cur
+
after
out
.
write
(
line
)
out
.
close
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment