gsMap 1.73.3__py3-none-any.whl → 1.73.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gsMap/__init__.py +2 -2
- gsMap/config.py +2 -9
- gsMap/diagnosis.py +4 -3
- gsMap/generate_ldscore.py +110 -454
- gsMap/utils/generate_r2_matrix.py +453 -352
- gsMap/utils/regression_read.py +131 -157
- {gsmap-1.73.3.dist-info → gsmap-1.73.5.dist-info}/METADATA +2 -2
- {gsmap-1.73.3.dist-info → gsmap-1.73.5.dist-info}/RECORD +11 -11
- {gsmap-1.73.3.dist-info → gsmap-1.73.5.dist-info}/WHEEL +0 -0
- {gsmap-1.73.3.dist-info → gsmap-1.73.5.dist-info}/entry_points.txt +0 -0
- {gsmap-1.73.3.dist-info → gsmap-1.73.5.dist-info}/licenses/LICENSE +0 -0
gsMap/__init__.py
CHANGED
gsMap/config.py
CHANGED
@@ -972,10 +972,7 @@ class GenerateLDScoreConfig(ConfigWithAutoPaths):
|
|
972
972
|
ld_wind: int = 1
|
973
973
|
ld_unit: str = "CM"
|
974
974
|
|
975
|
-
|
976
|
-
ldscore_save_format: Literal["feather", "zarr", "quick_mode"] = "feather"
|
977
|
-
|
978
|
-
zarr_chunk_size: tuple[int, int] = None
|
975
|
+
ldscore_save_format: Literal["feather", "quick_mode"] = "feather"
|
979
976
|
|
980
977
|
# for pre calculating the SNP Gene ldscore Weight
|
981
978
|
save_pre_calculate_snp_gene_weight_matrix: bool = False
|
@@ -1059,10 +1056,6 @@ class GenerateLDScoreConfig(ConfigWithAutoPaths):
|
|
1059
1056
|
f"baseline.{self.chrom}.annot.gz is not found in {self.additional_baseline_annotation}."
|
1060
1057
|
)
|
1061
1058
|
|
1062
|
-
# set the default zarr chunk size
|
1063
|
-
if self.ldscore_save_format == "zarr" and self.zarr_chunk_size is None:
|
1064
|
-
self.zarr_chunk_size = (10_000, self.spots_per_chunk)
|
1065
|
-
|
1066
1059
|
|
1067
1060
|
@dataclass
|
1068
1061
|
class SpatialLDSCConfig(ConfigWithAutoPaths):
|
@@ -1079,7 +1072,7 @@ class SpatialLDSCConfig(ConfigWithAutoPaths):
|
|
1079
1072
|
all_chunk: int | None = None
|
1080
1073
|
chunk_range: tuple[int, int] | None = None
|
1081
1074
|
|
1082
|
-
ldscore_save_format: Literal["feather", "
|
1075
|
+
ldscore_save_format: Literal["feather", "quick_mode"] = "feather"
|
1083
1076
|
|
1084
1077
|
spots_per_chunk_quick_mode: int = 1_000
|
1085
1078
|
snp_gene_weight_adata_path: str | None = None
|
gsMap/diagnosis.py
CHANGED
@@ -9,6 +9,7 @@ from scipy.stats import norm
|
|
9
9
|
|
10
10
|
from gsMap.config import DiagnosisConfig
|
11
11
|
from gsMap.utils.manhattan_plot import ManhattanPlot
|
12
|
+
from gsMap.utils.regression_read import _read_chr_files
|
12
13
|
from gsMap.visualize import draw_scatter, estimate_point_size_for_plot, load_ldsc, load_st_coord
|
13
14
|
|
14
15
|
warnings.filterwarnings("ignore", category=FutureWarning)
|
@@ -100,10 +101,11 @@ def load_gwas_data(config: DiagnosisConfig):
|
|
100
101
|
def load_snp_gene_pairs(config: DiagnosisConfig):
|
101
102
|
"""Load SNP-gene pairs from multiple chromosomes."""
|
102
103
|
ldscore_save_dir = Path(config.ldscore_save_dir)
|
104
|
+
snp_gene_pair_file_prefix = ldscore_save_dir / "SNP_gene_pair/SNP_gene_pair_chr"
|
103
105
|
return pd.concat(
|
104
106
|
[
|
105
|
-
pd.read_feather(
|
106
|
-
for
|
107
|
+
pd.read_feather(file)
|
108
|
+
for file in _read_chr_files(snp_gene_pair_file_prefix.as_posix(), suffix=".feather")
|
107
109
|
]
|
108
110
|
)
|
109
111
|
|
@@ -168,7 +170,6 @@ def generate_manhattan_plot(config: DiagnosisConfig):
|
|
168
170
|
|
169
171
|
# Log some diagnostic information
|
170
172
|
logger.info(f"Creating Manhattan plot with {len(gwas_data_to_plot)} SNPs")
|
171
|
-
logger.info(f"Columns available: {list(gwas_data_to_plot.columns)}")
|
172
173
|
logger.info(f"Chromosome column values: {gwas_data_to_plot['CHR'].unique()}")
|
173
174
|
|
174
175
|
fig = ManhattanPlot(
|