Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Araformatics group
Araformatics project
Commits
57f4f8cd
Commit
57f4f8cd
authored
Dec 07, 2021
by
Schoorlemmer, Joran
Browse files
Replace extractcounts.py
parent
004b0591
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/extractcounts.py
View file @
57f4f8cd
...
...
@@ -32,10 +32,11 @@ def parse_gtf(in_file, read_length = 100):
# turn into into int to do calculations
trans_len
=
abs
(
int
(
line_cont
[
4
])
-
int
(
line_cont
[
3
]))
gene_info
=
line_cont
[
8
].
split
(
' '
)
if
len
(
gene_info
)
==
16
:
gene_name
=
gene_info
[
9
].
lstrip
(
'"'
).
rstrip
(
'";'
)
cov
=
float
(
gene_info
[
11
].
lstrip
(
'"'
).
rstrip
(
'";'
))
genes
[
gene_name
]
=
round
(
cov
*
trans_len
/
read_length
)
if
len
(
gene_info
)
==
12
:
gene_name
=
gene_info
[
5
].
lstrip
(
'"'
).
rstrip
(
'";'
)
cov
=
float
(
gene_info
[
7
].
lstrip
(
'"'
).
rstrip
(
'";'
))
if
cov
>
0.01
:
genes
[
gene_name
]
=
round
(
cov
*
trans_len
/
read_length
)
return
genes
...
...
Write
Preview
Supports
Markdown
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