File tree Expand file tree Collapse file tree 1 file changed +0
-54
lines changed
chebai/preprocessing/datasets Expand file tree Collapse file tree 1 file changed +0
-54
lines changed Original file line number Diff line number Diff line change @@ -138,60 +138,6 @@ class Tox21Graph(Tox21Base):
138138 READER = dr .GraphReader
139139
140140
141- class Tox21Bloat (Tox21Base ):
142- @property
143- def _name (self ):
144- return "tox21bloat"
145-
146- def _load_dict (self , input_file_path ):
147- with open (input_file_path , "r" ) as input_file :
148- reader = csv .DictReader (input_file )
149- for row in reader :
150- smiles = row ["smiles" ]
151- labels = [
152- bool (int (l )) if l else None for l in (row [k ] for k in self .HEADERS )
153- ]
154- yield dict (
155- features = smiles ,
156- labels = labels ,
157- group = row ["mol_id" ],
158- additional_kwargs = dict (original = True ),
159- )
160- try :
161- mol = pysmiles .read_smiles (smiles )
162- except :
163- pass
164- else :
165-
166- def keyfunc (idx ):
167- """
168- pysmiles uses this method to determine possible starting points
169- """
170- return (
171- mol .degree (idx ),
172- # True > False
173- mol .nodes [idx ].get ("element" , "*" ) == "C" ,
174- idx ,
175- )
176-
177- possible_starts = list (sorted (mol .nodes , key = keyfunc ))[1 :11 ]
178- for n in possible_starts :
179- try :
180- alt_smiles = pysmiles .write_smiles (mol , start = n )
181- except :
182- pass
183- else :
184- yield dict (
185- features = alt_smiles ,
186- labels = labels ,
187- group = row ["mol_id" ],
188- additional_kwargs = dict (original = False ),
189- )
190-
191-
192- class Tox21BloatChem (Tox21Bloat ):
193- READER = dr .ChemDataReader
194-
195141
196142class Tox21ExtendedChem (MergedDataset ):
197143 MERGED = [Tox21Chem , Hazardous , JCIExtendedTokenData ]
You can’t perform that action at this time.
0 commit comments