Spaces:
				
			
			
	
			
			
					
		Running
		
	
	
	
			
			
	
	
	
	
		
		
					
		Running
		
	
		Sonja Topf
		
	commited on
		
		
					Commit 
							
							·
						
						e4f4cf0
	
1
								Parent(s):
							
							a78b381
								
changed column names
Browse files- predict.py +2 -13
    	
        predict.py
    CHANGED
    
    | @@ -19,18 +19,7 @@ def predict(smiles_list): | |
| 19 | 
             
                set_seed(0)
         | 
| 20 | 
             
                # tox21 targets
         | 
| 21 | 
             
                TARGET_NAMES = [
         | 
| 22 | 
            -
                        "NR-AR",
         | 
| 23 | 
            -
                        "NR-AR-LBD",
         | 
| 24 | 
            -
                        "NR-AhR",
         | 
| 25 | 
            -
                        "NR-Aromatase",
         | 
| 26 | 
            -
                        "NR-ER",
         | 
| 27 | 
            -
                        "NR-ER-LBD",
         | 
| 28 | 
            -
                        "NR-PPAR-gamma",
         | 
| 29 | 
            -
                        "SR-ARE",
         | 
| 30 | 
            -
                        "SR-ATAD5",
         | 
| 31 | 
            -
                        "SR-HSE",
         | 
| 32 | 
            -
                        "SR-MMP",
         | 
| 33 | 
            -
                        "SR-p53",
         | 
| 34 | 
             
                    ]
         | 
| 35 | 
             
                DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
         | 
| 36 | 
             
                print(f"Received {len(smiles_list)} SMILES strings")
         | 
| @@ -62,7 +51,7 @@ def predict(smiles_list): | |
| 62 |  | 
| 63 | 
             
                    except Exception as e:
         | 
| 64 | 
             
                        # If SMILES fails, return zeros
         | 
| 65 | 
            -
                        pred_dict = {t: 0. | 
| 66 | 
             
                        predictions[smiles] = pred_dict
         | 
| 67 |  | 
| 68 | 
             
                return predictions
         | 
|  | |
| 19 | 
             
                set_seed(0)
         | 
| 20 | 
             
                # tox21 targets
         | 
| 21 | 
             
                TARGET_NAMES = [
         | 
| 22 | 
            +
                        "NR-AhR","NR-AR","NR-AR-LBD","NR-Aromatase","NR-ER","NR-ER-LBD","NR-PPAR-gamma","SR-ARE","SR-ATAD5","SR-HSE","SR-MMP","SR-p53"
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 23 | 
             
                    ]
         | 
| 24 | 
             
                DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
         | 
| 25 | 
             
                print(f"Received {len(smiles_list)} SMILES strings")
         | 
|  | |
| 51 |  | 
| 52 | 
             
                    except Exception as e:
         | 
| 53 | 
             
                        # If SMILES fails, return zeros
         | 
| 54 | 
            +
                        pred_dict = {t: 0.5 for t in TARGET_NAMES}
         | 
| 55 | 
             
                        predictions[smiles] = pred_dict
         | 
| 56 |  | 
| 57 | 
             
                return predictions
         |