Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scRNA-seq-simulation
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
pipelines
scRNA-seq-simulation
Merge requests
!16
Issue_4
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Issue_4
Issue_4
into
main
Overview
19
Commits
25
Pipelines
23
Changes
2
Closed
Melvin Alappat
requested to merge
Issue_4
into
main
3 years ago
Overview
15
Commits
25
Pipelines
23
Changes
2
Expand
Adding the code for Issue_4 as well as the nextflow workflow
0
0
Merge request reports
Compare
main
version 22
0329e263
3 years ago
version 21
ec7f686c
3 years ago
version 20
abb1e512
3 years ago
version 19
4c591824
3 years ago
version 18
81e851d5
3 years ago
version 17
6171438b
3 years ago
version 16
d149f7d9
3 years ago
version 15
18926491
3 years ago
version 14
2e371c17
3 years ago
version 13
0c46921b
3 years ago
version 12
e3650eab
3 years ago
version 11
ab36e23a
3 years ago
version 10
6907a807
3 years ago
version 9
b4cd2abb
3 years ago
version 8
abf6458e
3 years ago
version 7
7ae6757a
3 years ago
version 6
131062fe
3 years ago
version 5
8c2b856e
3 years ago
version 4
56a52990
3 years ago
version 3
75735c39
3 years ago
version 2
c154c55a
3 years ago
version 1
9ca598fb
3 years ago
main (base)
and
version 1
latest version
d5ac4ae7
25 commits,
3 years ago
version 22
0329e263
24 commits,
3 years ago
version 21
ec7f686c
22 commits,
3 years ago
version 20
abb1e512
21 commits,
3 years ago
version 19
4c591824
20 commits,
3 years ago
version 18
81e851d5
19 commits,
3 years ago
version 17
6171438b
18 commits,
3 years ago
version 16
d149f7d9
17 commits,
3 years ago
version 15
18926491
16 commits,
3 years ago
version 14
2e371c17
15 commits,
3 years ago
version 13
0c46921b
14 commits,
3 years ago
version 12
e3650eab
13 commits,
3 years ago
version 11
ab36e23a
12 commits,
3 years ago
version 10
6907a807
11 commits,
3 years ago
version 9
b4cd2abb
10 commits,
3 years ago
version 8
abf6458e
9 commits,
3 years ago
version 7
7ae6757a
8 commits,
3 years ago
version 6
131062fe
7 commits,
3 years ago
version 5
8c2b856e
6 commits,
3 years ago
version 4
56a52990
5 commits,
3 years ago
version 3
75735c39
4 commits,
3 years ago
version 2
c154c55a
3 commits,
3 years ago
version 1
9ca598fb
2 commits,
3 years ago
2 files
+
126
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
src/PrimingProb.py
0 → 100644
+
101
−
0
Options
"""
Imports.
"""
import
numpy
as
np
import
scipy.constants
class
Probability
:
"""
Calculates the probability of priming and write the gff file.
"""
def
InterPara
():
"""
Open the RIblast output file and read only the parameter lines.
Args:
None
Returns:
my_list (list): Contains all the paramter lines from RIblast
"""
myfile
=
open
(
"
./Docker-Files/Energies.txt
"
,
"
r
"
)
# ouput of RIblast
mylist
=
[]
# all lines of Energies starting with an ID-number
for
myline
in
myfile
:
# Read lines containing needed data
if
myline
[
0
].
isdigit
():
mylist
.
append
(
myline
)
else
:
continue
myfile
.
close
()
return
(
mylist
)
data
=
InterPara
()
def
InterProb
(
data_list
):
"""
Calculate the prob. and make the gff file.
Args:
data_list (list): Contains all parameters of RIblast
Returns:
gff (file): Gff file contains all the output information
"""
para_list
=
[]
for
i
in
range
(
0
,
len
(
data_list
)):
x
=
data_list
[
i
].
split
(
"
,
"
)
para_list
.
append
(
x
)
# splitting each list item by the "," this results in a 2-D list
for
j
in
range
(
0
,
len
(
para_list
)):
del
para_list
[
j
][
1
:
-
2
]
# only keeps the ID-numer, the interaction
# energy, and interaction site of both sequences. (still a 2D-list)
for
d
in
range
(
0
,
len
(
para_list
)):
# Optimize location output
a
=
para_list
[
d
][
2
].
split
(
"
:
"
)
a
[
1
]
=
a
[
1
].
replace
(
"
)
"
,
""
)
a
[
1
]
=
a
[
1
].
replace
(
"
\n
"
,
""
)
a
[
1
]
=
a
[
1
].
replace
(
"
-
"
,
"
"
)
a
[
1
]
=
a
[
1
].
split
(
"
"
)
para_list
[
d
][
2
]
=
a
[
1
]
for
k
in
range
(
0
,
len
(
para_list
)):
# type-conversion of ID and E
for
l
in
range
(
0
,
2
):
para_list
[
k
][
l
]
=
float
(
para_list
[
k
][
l
])
for
z
in
range
(
0
,
len
(
para_list
)):
# from kcal/mol to Joule/mol
para_list
[
z
][
1
]
=
para_list
[
z
][
1
]
*
4184
kT
=
scipy
.
constants
.
R
*
300.15
# calculating gas constant R * T
for
u
in
range
(
0
,
len
(
para_list
)):
# calculating -E / RT
para_list
[
u
][
1
]
=
(
-
(
para_list
[
u
][
1
])
/
kT
)
prob_list
=
[]
# List containing all the prob.
for
h
in
range
(
0
,
len
(
para_list
)):
# calculating the e^(-E/kT)
probab
=
np
.
exp
(
para_list
[
h
][
1
])
prob_list
.
append
(
probab
)
para_list
[
h
][
1
]
=
probab
prob_list_sum
=
sum
(
prob_list
)
# Sum of all probabilities
real_prob
=
[]
for
v
in
range
(
0
,
len
(
para_list
)):
# Normalized probabilities
prob_linear
=
(
para_list
[
v
][
1
])
/
prob_list_sum
real_prob
.
append
(
prob_linear
)
para_list
[
v
][
1
]
=
prob_linear
gff
=
open
(
"
./output/Potential_Priming_sites.txt
"
,
"
w+
"
)
# gff file
for
i
in
range
(
0
,
len
(
para_list
)):
gff
.
write
(
"
Interactions:
"
+
str
(
para_list
[
i
][
0
])
+
"
\t
RIblast
\t
transcript
\t
"
+
str
(
para_list
[
i
][
2
][
1
])
+
"
\t
"
+
str
(
para_list
[
i
][
2
][
0
])
+
"
\t
"
+
str
(
para_list
[
i
][
1
])
+
"
\t
.
\t
.
\t
.
\n
"
)
gff
.
close
return
gff
InterProb
(
data
)
Loading