jkkkkyuedtrt/CELLSEQ-MCV main
Python json.load callSerializes to a stream with json.dump()
SHA-256c555bdb2c87782f387e49ed23932b7d76a3d293bf20ac3e090b0e4f2cc7af70b
MaleculeH₂(Db₂F)
Evidence
⋯6 lines
7@dataclass
8class CelltypeAssignConfig:
9 """Configuration class for CelltypeAssign
10 """
11 # output files
12 spatial_info_json_file: str
13 cell_info_json_fi …
40:9… """Load configuration from JSON file"""
41 with open(config_file, 'r') as f:
42 config_dict = json.load(f)
43 return cls(**config_dict)
44
⋯4 lines
53:7… """Save configuration to JSON file"""
54 os.makedirs(os.path.dirname(config_file), exist_ok=True)
55 with open(config_file, 'w') as f:
56 json.dump(self.__dict__, f, indent=4)
57
58 return
⋯5 lines
67:31…
68 if self.cell_composition_mode == 'top' and self.top_m_count <= 0:
69 raise ValueError('top_m_count must be positive when using to …