Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Transcript sampler
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
zavolan_group
tools
Transcript sampler
Commits
f590a529
Commit
f590a529
authored
2 years ago
by
Laura Urbanska
Browse files
Options
Downloads
Patches
Plain Diff
Updated find_representative_transcripts.py by including GTF writer
parent
d099fc1f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/find_representative_transcripts.py
+23
-0
23 additions, 0 deletions
scripts/find_representative_transcripts.py
with
23 additions
and
0 deletions
scripts/find_representative_transcripts.py
+
23
−
0
View file @
f590a529
...
@@ -176,6 +176,29 @@ def get_rep_trans(file_name = "test"):
...
@@ -176,6 +176,29 @@ def get_rep_trans(file_name = "test"):
rep_transcripts
=
_re_format
(
rep_trans
)
rep_transcripts
=
_re_format
(
rep_trans
)
return
(
rep_transcripts
)
return
(
rep_transcripts
)
def
gtf_file_writer
(
original_file
,
output_file
):
"""
this function writes the output GTF file
"""
output
=
[]
rep_transcript_dict
=
get_rep_trans
(
original_file
)
with
open
(
original_file
,
'
r
'
)
as
f
:
for
entry
in
f
:
if
entry
[
0
]
!=
'
#
'
:
attributes
=
attributs_converter
(
entry
)
type_
=
attributes
[
2
]
if
type_
==
'
gene
'
:
gene_id
=
find_in_attributs
(
attributes
,
'
gene_id
'
)
output
.
append
(
entry
)
if
type_
!=
'
gene
'
:
transcript_id
=
find_in_attributs
(
attributes
,
'
transcript_id
'
)
if
rep_transcript_dict
[
gene_id
]
==
transcript_id
:
output
.
append
(
entry
)
with
open
(
output_file
,
'
w
'
)
as
last_file
:
last_file
.
write
(
output
)
def
_test
():
def
_test
():
"""
"""
This funtion is ment to be run for test
This funtion is ment to be run for test
...
...
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