Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HTRfit
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
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
LBMC
yvertlab
evolution_plasticity
plasticity_mutation
HTRfit
Commits
aab1671b
Commit
aab1671b
authored
3 years ago
by
Arnaud Duvermy
Browse files
Options
Downloads
Patches
Plain Diff
modif tuto htrsim
parent
14423d5c
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
src/tutorial_htrsim.R
+7
-5
7 additions, 5 deletions
src/tutorial_htrsim.R
with
7 additions
and
5 deletions
src/tutorial_htrsim.R
+
7
−
5
View file @
aab1671b
################################### Getting started ########################################################
################################### Getting started ########################################################
### Required
library
(
tidyverse
)
library
(
data.table
)
###############################################################################
###############################################################################
...
@@ -24,14 +26,14 @@ set_gene_name = paste0('gene', 1:N_genes)
...
@@ -24,14 +26,14 @@ set_gene_name = paste0('gene', 1:N_genes)
set_gene_name
set_gene_name
### Fill INPUT Dataframe
### Fill INPUT Dataframe
genes_NB_params
<-
samples
$
name
%>%
#
samples$name %>%
map
(
~
(
list
(
name
=
.
,
#sample_name
genes_NB_params
<-
map2
(
.x
=
samples
$
name
,
.y
=
samples
$
n_rep
,
~
(
list
(
name
=
.
x
,
#sample_name
n_replicates
=
sample
(
1
:
max_N_replicates
,
1
),
#random int between 1 & max_N_replicates
n_replicates
=
.y
,
#
sample(1:max_N_replicates, 1), #random int between 1 & max_N_replicates
name_gene
=
set_gene_name
,
# gene_name
name_gene
=
set_gene_name
,
# gene_name
mu
=
runif
(
100
,
1000
,
n
=
N_genes
),
#mu(ij)
mu
=
runif
(
100
,
1000
,
n
=
N_genes
),
#mu(ij)
alpha
=
set_alpha_per_gene
)))
%>%
# alpha(i)
alpha
=
set_alpha_per_gene
)))
%>%
# alpha(i)
rbindlist
(
.
)
%>%
data.frame
()
## convert to dtf
rbindlist
(
.
)
%>%
data.frame
()
## convert to dtf
genes_NB_params
## Use filter to understand our dtf
## Use filter to understand our dtf
## Notice that alpha is equal for equivalent gene between sample
## Notice that alpha is equal for equivalent gene between sample
genes_NB_params
%>%
filter
(
name_gene
==
"gene2"
)
genes_NB_params
%>%
filter
(
name_gene
==
"gene2"
)
...
...
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