Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
panacota
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Amandine PERRIN
panacota
Commits
24e6d5d5
Commit
24e6d5d5
authored
4 years ago
by
Amandine PERRIN
Browse files
Options
Downloads
Patches
Plain Diff
get_contigs returned in the wrong way
parent
5b1c37b0
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
PanACoTA/utils.py
+8
-4
8 additions, 4 deletions
PanACoTA/utils.py
with
8 additions
and
4 deletions
PanACoTA/utils.py
+
8
−
4
View file @
24e6d5d5
...
@@ -1133,8 +1133,10 @@ def get_genome_contigs_and_rename(gembase_name, gpath, outfile):
...
@@ -1133,8 +1133,10 @@ def get_genome_contigs_and_rename(gembase_name, gpath, outfile):
# - write header ("<contig name> <size>") to replicon file
# - write header ("<contig name> <size>") to replicon file
if
prev_cont
:
if
prev_cont
:
cont
=
"
\t
"
.
join
([
prev_cont
,
str
(
cont_size
)])
+
"
\n
"
cont
=
"
\t
"
.
join
([
prev_cont
,
str
(
cont_size
)])
+
"
\n
"
sizes
[
prev_cont
]
=
cont_size
prevcont_nohead
=
""
.
join
(
prev_cont
.
split
(
"
>
"
)[
1
:])
contigs
[
prev_cont
]
=
prev_orig_name
prev_orig_name_nohead
=
""
.
join
(
prev_orig_name
.
split
(
"
>
"
)[
1
:])
sizes
[
prevcont_nohead
]
=
cont_size
contigs
[
prev_orig_name_nohead
]
=
prevcont_nohead
grf
.
write
(
cont
)
grf
.
write
(
cont
)
grf
.
write
(
seq
)
grf
.
write
(
seq
)
prev_cont
=
"
>
"
+
gembase_name
+
"
.
"
+
str
(
contig_num
).
zfill
(
4
)
prev_cont
=
"
>
"
+
gembase_name
+
"
.
"
+
str
(
contig_num
).
zfill
(
4
)
...
@@ -1148,8 +1150,10 @@ def get_genome_contigs_and_rename(gembase_name, gpath, outfile):
...
@@ -1148,8 +1150,10 @@ def get_genome_contigs_and_rename(gembase_name, gpath, outfile):
cont_size
+=
len
(
line
.
strip
())
cont_size
+=
len
(
line
.
strip
())
# Write last contig
# Write last contig
cont
=
"
\t
"
.
join
([
prev_cont
,
str
(
cont_size
)])
+
"
\n
"
cont
=
"
\t
"
.
join
([
prev_cont
,
str
(
cont_size
)])
+
"
\n
"
sizes
[
prev_cont
]
=
cont_size
prevcont_nohead
=
""
.
join
(
prev_cont
.
split
(
"
>
"
)[
1
:])
contigs
[
prev_cont
]
=
prev_orig_name
prev_orig_name_nohead
=
""
.
join
(
prev_orig_name
.
split
(
"
>
"
)[
1
:])
contigs
[
prev_orig_name_nohead
]
=
prevcont_nohead
sizes
[
prevcont_nohead
]
=
cont_size
grf
.
write
(
cont
)
grf
.
write
(
cont
)
grf
.
write
(
seq
)
grf
.
write
(
seq
)
return
contigs
,
sizes
return
contigs
,
sizes
...
...
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