Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RAISS
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Statistical-Genetics
RAISS
Commits
86c31e4f
Commit
86c31e4f
authored
1 year ago
by
Hubble
Browse files
Options
Downloads
Patches
Plain Diff
save log in csv
parent
03e7ada2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Dev
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
raiss/sanity_log.py
+14
-1
14 additions, 1 deletion
raiss/sanity_log.py
with
14 additions
and
1 deletion
raiss/sanity_log.py
+
14
−
1
View file @
86c31e4f
...
@@ -77,9 +77,22 @@ def report_snps(res_dict, trait, filename="raiss_report"):
...
@@ -77,9 +77,22 @@ def report_snps(res_dict, trait, filename="raiss_report"):
f
.
write
(
res_dict
[
'
R2_quality
'
].
to_string
())
f
.
write
(
res_dict
[
'
R2_quality
'
].
to_string
())
f
.
close
()
f
.
close
()
def
report_snps_csv
(
res_dict
,
trait
,
filename
=
"
raiss_report
"
):
# I save the log in three .csv files.
df
=
pd
.
DataFrame
({
'
Number of SNPs in harmonized file
'
:
[
res_dict
[
"
total_harmonized
"
]],
'
Number of SNPs in imputed file
'
:
[
res_dict
[
"
total_imputed
"
]],
'
Proportion imputed
'
:
[
res_dict
[
'
proportion
'
]]})
df
.
to_csv
(
"
{}_{}_Number_of_SNPs.csv
"
.
format
(
filename
,
trait
),
index
=
False
)
# Number of SNPs by level of significance
res_dict
[
'
signif_count
'
].
to_csv
(
"
{}_{}_Number_of_SNPs_by_level_of_significance.csv
"
.
format
(
filename
,
trait
))
# Number of imputed SNPs by level of imputation quality
res_dict
[
'
R2_quality
'
].
to_csv
=
"
{}_{}_Number_of_SNPs_by_level_of_imputation_quality.csv
"
.
format
(
filename
,
trait
)
def
raiss_report
(
trait
,
harmonized_folder
,
imputed_folder
,
filename
=
"
raiss_report
"
,
chr_list
=
range
(
1
,
23
)):
def
raiss_report
(
trait
,
harmonized_folder
,
imputed_folder
,
filename
=
"
raiss_report
"
,
chr_list
=
range
(
1
,
23
)):
"""
"""
Function to compute a report for one trait
Function to compute a report for one trait
"""
"""
res_dict
=
count_snps
(
trait
,
harmonized_folder
,
imputed_folder
,
chr_list
)
res_dict
=
count_snps
(
trait
,
harmonized_folder
,
imputed_folder
,
chr_list
)
report_snps
(
res_dict
,
trait
,
filename
)
report_snps
_csv
(
res_dict
,
trait
,
filename
)
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