summaryrefslogtreecommitdiff
path: root/test/use_cases.rb
blob: 15e65a3477a9ad12279b956277e318ac38109660 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require_relative "setup.rb"

class UseCasesTest < MiniTest::Test

  def test_PA
    skip
    kazius = Dataset.from_sdf_file "#{DATA_DIR}/cas_4337.sdf"
    hansen = Dataset.from_csv_file "#{DATA_DIR}/hansen.csv"
    efsa = Dataset.from_csv_file "#{DATA_DIR}/efsa.csv"
    datasets = [kazius,hansen,efsa]
    map = {"true" => "carcinogen", "false" => "non-carcinogen"}
    training_dataset = Dataset.merge datasets: datasets, features: datasets.collect{|d| d.bioactivity_features.first}, value_maps: [nil,map,map], keep_original_features: false, remove_duplicates: true
    model = Model::Validation.create training_dataset: training_dataset, species: "Salmonella typhimurium", endpoint: "Mutagenicity"
    pa = Dataset.from_sdf_file "#{DATA_DIR}/PA.sdf"
    prediction_dataset = model.predict pa
    puts prediction_dataset.to_csv
    assert_equal 8281, d.compounds.size
  end

  def test_public_models
    skip
=begin
    #classification
    aids = [
      1205, #Rodents (multiple species/sites)
      1208, # rat carc
      1199 # mouse
      # Mutagenicity


      1195 #MRDD
      1188 #FHM
      1208, # rat carc td50
      1199 # mouse td50
    
    # daphnia
    # Blood Brain Barrier Penetration
    # Lowest observed adverse effect level (LOAEL)

      # 1204  estrogen receptor
      # 1259408, # GENE-TOX
      # 1159563 HepG2 cytotoxicity assay
      # 588209 hepatotoxicity
      # 1259333 cytotoxicity
      # 1159569 HepG2 cytotoxicity counterscreen Measured in Cell-Based System Using Plate Reader - 2153-03_Inhibitor_Dose_DryPowder_Activity
      # 2122 HTS Counterscreen for Detection of Compound Cytotoxicity in MIN6 Cells
      # 116724 Acute toxicity determined after intravenal administration in mice
      # 1148549 Toxicity in po dosed mouse assessed as mortality after 7 days
=end

  end
end