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
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
ift
public
causal_age_viral_load_model
Commits
98fd20df
Commit
98fd20df
authored
Apr 20, 2022
by
Matteo Guardiani
Browse files
fix warning.
parent
be3f8150
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
98fd20df
...
...
@@ -3,7 +3,7 @@
Test of SARS-CoV-2 viral-load age-causal-dependence via a non-parametric, hierarchical, Bayesian, and causal model. The
following is a Python implementation of the model described in
*
Guardiani
M.
et al., Non-parametric Bayesian Causal Modeling of the SARS-CoV-2 Viral Load Distribution vs. Patient's
*
Guardiani et al., Non-parametric Bayesian Causal Modeling of the SARS-CoV-2 Viral Load Distribution vs. Patient's
Age,
[
preprint
](
https://arxiv.org/abs/2105.13483
)
[
1
]
.
Please cite [1] when making use of this code.
...
...
@@ -28,9 +28,8 @@ running the script `data.py` which outputs (for the two datasets respectively)
<img
src=
"./plots/data_Cobas_Dataset.png"
width=
"425"
/>
<img
src=
"./plots/data_LC_480_Dataset.png"
width=
"425"
/>
These datasets have been extracted from Drosten et
al.
[
preprint
](
https://virologie-ccm.charite.de/fileadmin/user_upload/microsites/m_cc05/virologie-ccm/dateien_upload/Weitere_Dateien/Charite_SARS-CoV-2_viral_load_2020-06-02.pdf
)
(
Fig.
6).
These datasets have been extracted from Jones et
al.
[
preprint
](
https://virologie-ccm.charite.de/fileadmin/user_upload/microsites/m_cc05/virologie-ccm/dateien_upload/Weitere_Dateien/Charite_SARS-CoV-2_viral_load_2020-06-02.pdf
)
(
Fig.
6).
## Run the code
...
...
src/utilities.py
View file @
98fd20df
...
...
@@ -21,6 +21,7 @@ import string
import
nifty8
as
ift
import
numpy
as
np
class
GeomMaskOperator
(
ift
.
LinearOperator
):
"""
Copyright @ Jakob Roth
...
...
@@ -56,6 +57,7 @@ class GeomMaskOperator(ift.LinearOperator):
res
[
self
.
_slices
]
=
x
return
ift
.
Field
(
self
.
domain
,
res
)
class
DomainBreak2D
(
ift
.
LinearOperator
):
def
__init__
(
self
,
domain
):
self
.
_domain
=
ift
.
DomainTuple
.
make
(
domain
)
...
...
@@ -131,7 +133,7 @@ class y_averager(ift.LinearOperator):
self
.
_check_input
(
x
,
mode
)
val
=
x
.
val
if
self
.
_alpha
is
not
0
:
if
self
.
_alpha
!=
0
:
weights
=
np
.
power
(
10
,
self
.
_rv
.
val
*
self
.
_alpha
)
*
self
.
_dV
res
=
np
.
sum
((
val
*
weights
),
axis
=
1
)
res
=
np
.
power
(
res
,
1.
/
self
.
_alpha
)
...
...
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