Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-qtl-db
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cc-qtl
cc-qtl-db
Commits
2204a638
Commit
2204a638
authored
3 years ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
Add p_value column for the peaks
parent
382e7b3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/api/migrations/0060_peak_p_value.py
+18
-0
18 additions, 0 deletions
server/api/migrations/0060_peak_p_value.py
server/api/models.py
+13
-5
13 additions, 5 deletions
server/api/models.py
with
31 additions
and
5 deletions
server/api/migrations/0060_peak_p_value.py
0 → 100644
+
18
−
0
View file @
2204a638
# Generated by Django 3.2.7 on 2022-03-14 12:21
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
api
'
,
'
0059_alter_galaxyworkflow_version
'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'
peak
'
,
name
=
'
p_value
'
,
field
=
models
.
FloatField
(
null
=
True
),
),
]
This diff is collapsed.
Click to expand it.
server/api/models.py
+
13
−
5
View file @
2204a638
...
...
@@ -239,7 +239,8 @@ class Experiment(models.Model):
raise
RessourceAlreadyExists
()
# Add reader role to the team the current user belongs
def
generate_experiment_file
(
self
,
name
,
phenotype_type_name
):
def
generate_experiment_file
(
self
,
name
,
phenotype_type_name
,
galaxy_workflow_id
):
galaxy_workflow_excel
=
{
"
657f009ad32a3f27
"
,
"
bd6cadfea4e7afba
"
}
phenotypes
=
(
Phenotype
.
objects
.
filter
(
experiment_cc_line__experiment
=
self
)
.
values
(
...
...
@@ -278,10 +279,16 @@ class Experiment(models.Model):
columns
=
[
"
CC_ID
"
,
"
Line_M
"
,
"
Line_F
"
,
"
Sex
"
]
+
[
phenotype_type_name
]
pivoted
.
reset_index
(
inplace
=
True
)
dirpath
=
tempfile
.
mkdtemp
(
prefix
=
"
cc-qtl-
"
,
dir
=
"
/tmp-exp-files
"
)
experiment_file_path
=
f
"
{
dirpath
}
/
{
name
}
.xls
"
pivoted
.
to_excel
(
experiment_file_path
,
index
=
False
,
columns
=
columns
,
)
if
galaxy_workflow_id
in
galaxy_workflow_excel
:
experiment_file_path
=
f
"
{
dirpath
}
/
{
name
}
.xls
"
pivoted
.
to_excel
(
experiment_file_path
,
index
=
False
,
columns
=
columns
,
)
else
:
experiment_file_path
=
f
"
{
dirpath
}
/
{
name
}
.csv
"
pivoted
.
to_csv
(
experiment_file_path
,
index
=
False
,
columns
=
columns
,
)
return
experiment_file_path
else
:
raise
NameError
(
f
"
No phenotype type defined for
{
phenotype_type_name
}
"
)
...
...
@@ -984,6 +991,7 @@ class Peak(models.Model):
lod
=
models
.
FloatField
()
ci_lo
=
models
.
FloatField
()
ci_hi
=
models
.
FloatField
()
p_value
=
models
.
FloatField
(
null
=
True
)
objects
=
PeakManager
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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