Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cnvCallerGPU
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gad-public
cnvCallerGPU
Commits
9468f249
Commit
9468f249
authored
Nov 07, 2024
by
Theo Serralta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrong variable in compute_mean_std
parent
09497ec1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
cnv_sv_caller_gpu.py
cnv_sv_caller_gpu.py
+11
-16
No files found.
cnv_sv_caller_gpu.py
View file @
9468f249
...
@@ -445,7 +445,7 @@ def dico_mappabilite(mappability_file):
...
@@ -445,7 +445,7 @@ def dico_mappabilite(mappability_file):
end_time_3
=
time
.
time
()
end_time_3
=
time
.
time
()
elapsed_time_3
=
end_time_3
-
start_time_3
elapsed_time_3
=
end_time_3
-
start_time_3
logging
.
info
(
f
"In dico_mappability : Ending merge intervals with the same score (Time taken: {elapsed_time_
2
:.4f} seconds)"
)
logging
.
info
(
f
"In dico_mappability : Ending merge intervals with the same score (Time taken: {elapsed_time_
3
:.4f} seconds)"
)
end_time
=
time
.
time
()
end_time
=
time
.
time
()
elapsed_time
=
end_time
-
start_time
elapsed_time
=
end_time
-
start_time
...
@@ -680,8 +680,7 @@ def calcul_med_same_gc(gc_results, depth_correction_results, chr):
...
@@ -680,8 +680,7 @@ def calcul_med_same_gc(gc_results, depth_correction_results, chr):
"""
"""
Calculate the median depth correction for each unique GC content value.
Calculate the median depth correction for each unique GC content value.
This function computes the median depth correction values for each unique GC content value in `gc_results`,
This function computes the median depth correction values for each unique GC content value, filtering out zero values.
filtering out zero values from `depth_correction_results`.
Parameters
Parameters
----------
----------
...
@@ -689,8 +688,6 @@ def calcul_med_same_gc(gc_results, depth_correction_results, chr):
...
@@ -689,8 +688,6 @@ def calcul_med_same_gc(gc_results, depth_correction_results, chr):
A list or array of GC content values.
A list or array of GC content values.
depth_correction_results : list or numpy.ndarray
depth_correction_results : list or numpy.ndarray
A list or array of depth correction values.
A list or array of depth correction values.
chr : str
The chromosome identifier for which the medians are calculated.
Returns
Returns
-------
-------
...
@@ -735,15 +732,12 @@ def calcul_moy_totale(normalize_depth_results, chr):
...
@@ -735,15 +732,12 @@ def calcul_moy_totale(normalize_depth_results, chr):
"""
"""
Calculate the mean of non-zero normalized depth results.
Calculate the mean of non-zero normalized depth results.
This function filters out zero values from the normalized depth results and computes the mean
This function filters out zero values from the normalized depth results and computes the mean of the remaining values.
of the remaining non-zero values.
Parameters
Parameters
----------
----------
normalize_depth_results : list or numpy.ndarray
normalize_depth_results : list or numpy.ndarray
A list or array of normalized depth values.
A list or array of normalized depth values.
chr : str
The chromosome identifier for which the mean is calculated.
Returns
Returns
-------
-------
...
@@ -757,15 +751,15 @@ def calcul_moy_totale(normalize_depth_results, chr):
...
@@ -757,15 +751,15 @@ def calcul_moy_totale(normalize_depth_results, chr):
# Filter results to remove zero values
# Filter results to remove zero values
non_zero_results
=
normalize_depth_results
[
normalize_depth_results
!=
0
]
non_zero_results
=
normalize_depth_results
[
normalize_depth_results
!=
0
]
# Calculate the mean of non-zero results
# Calculate the mean of non-zero results
mean_chr
=
np
.
mean
(
non_zero_results
)
if
non_zero_results
.
size
>
0
else
0
mean_chr
_norm
=
np
.
mean
(
non_zero_results
)
if
non_zero_results
.
size
>
0
else
0
sys
.
stderr
.
write
(
"Chromosome :
%
s, mean_chr :
%
s
\n
"
%
(
chr
,
mean_chr
)
)
logging
.
info
(
f
"Mean chr_norm_no_zero = {mean_chr_norm}"
)
end_time
=
time
.
time
()
end_time
=
time
.
time
()
elapsed_time
=
end_time
-
start_time
elapsed_time
=
end_time
-
start_time
logging
.
info
(
f
"Leaving calcul_moy_totale for {chr} (Time taken: {elapsed_time:.4f} seconds)"
)
logging
.
info
(
f
"Leaving calcul_moy_totale for {chr} (Time taken: {elapsed_time:.4f} seconds)"
)
return
mean_chr
return
mean_chr
_norm
def
calcul_std
(
normalize_depth_results
,
chr
):
def
calcul_std
(
normalize_depth_results
,
chr
):
"""
"""
...
@@ -805,7 +799,7 @@ def calcul_std(normalize_depth_results, chr):
...
@@ -805,7 +799,7 @@ def calcul_std(normalize_depth_results, chr):
return
std_chr
return
std_chr
def
compute_mean_std_med
(
ratio_par_window_
results
,
chr
):
def
compute_mean_std_med
(
ratio_par_window_
norm_results
,
chr
,
normalize_depth_results
):
"""
"""
Compute the mean, standard deviation, and median of non-zero ratio results per window.
Compute the mean, standard deviation, and median of non-zero ratio results per window.
...
@@ -814,7 +808,7 @@ def compute_mean_std_med(ratio_par_window_results, chr):
...
@@ -814,7 +808,7 @@ def compute_mean_std_med(ratio_par_window_results, chr):
Parameters
Parameters
----------
----------
ratio_par_window_results : list or numpy.ndarray
ratio_par_window_
norm_
results : list or numpy.ndarray
A list or array of ratio values per window.
A list or array of ratio values per window.
chr : str
chr : str
The chromosome identifier for which the statistics are calculated.
The chromosome identifier for which the statistics are calculated.
...
@@ -829,8 +823,9 @@ def compute_mean_std_med(ratio_par_window_results, chr):
...
@@ -829,8 +823,9 @@ def compute_mean_std_med(ratio_par_window_results, chr):
start_time
=
time
.
time
()
start_time
=
time
.
time
()
# Filter results to remove zero and -1 values
# Filter results to remove zero and -1 values
ratio_par_window_results
=
np
.
array
(
ratio_par_window_results
)
ratio_par_window_norm_results
=
np
.
array
(
ratio_par_window_norm_results
)
non_zero_results
=
ratio_par_window_results
[
ratio_par_window_results
!=
0
]
non_zero_results
=
ratio_par_window_norm_results
[
ratio_par_window_norm_results
!=
0
]
non_zero_results
=
non_zero_results
[
np
.
isfinite
(
non_zero_results
)]
# Initialize list for stats computation
# Initialize list for stats computation
table
=
[]
table
=
[]
...
...
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