Commit 2e839c2a authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Added some more tests

parent 89e49abe
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,9 @@ from deepchem.molnet.load_function.toxcast_datasets import load_toxcast

from deepchem.molnet.dnasim import simulate_motif_density_localization
from deepchem.molnet.dnasim import simulate_motif_counting
from deepchem.molnet.dnasim import simple_motif_embedding
from deepchem.molnet.dnasim import motif_density
from deepchem.molnet.dnasim import simulate_single_motif_detection

from deepchem.molnet.run_benchmark import run_benchmark
from deepchem.molnet.run_benchmark_low_data import run_benchmark_low_data
+41 −5
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ class TestDNASim(unittest.TestCase):

  def test_motif_density_localization_simulation(self):
    "Test motif density localization simulation." ""
    motif_density_localization_simulation_parameters = {
    params = {
        "motif_name": "TAL1_known4",
        "seq_length": 1000,
        "center_size": 150,
@@ -18,13 +18,13 @@ class TestDNASim(unittest.TestCase):
        "GC_fraction": 0.4
    }
    sequences, y, embed = dc.molnet.simulate_motif_density_localization(
        **motif_density_localization_simulation_parameters)
        **params)
    assert sequences.shape == (60,)
    assert y.shape == (60, 1)

  def test_motif_counting_simulation(self):
    "Test motif counting"
    motif_count_simulation_parameters = {
    params = {
        "motif_name": "TAL1_known4",
        "seq_length": 1000,
        "pos_counts": [5, 10],
@@ -33,7 +33,43 @@ class TestDNASim(unittest.TestCase):
        "num_neg": 30,
        "GC_fraction": 0.4
    }
    sequences, y, embed = dc.molnet.simulate_motif_counting(
        **motif_count_simulation_parameters)
    sequences, y, embed = dc.molnet.simulate_motif_counting(**params)
    assert sequences.shape == (60,)
    assert y.shape == (60, 1)

  def test_simple_motif_embedding(self):
    "Test simple motif embedding"
    params = {
        "motif_name": "TAL1_known4",
        "seq_length": 1000,
        "num_seqs": 30,
        "GC_fraction": 0.4
    }
    sequences, embed = dc.molnet.simple_motif_embedding(**params)
    assert sequences.shape == (30,)

  def test_motif_density(self):
    "Test motif density"
    params = {
        "motif_name": "TAL1_known4",
        "seq_length": 1000,
        "num_seqs": 30,
        "min_counts": 2,
        "max_counts": 4,
        "GC_fraction": 0.4
    }
    sequences, embed = dc.molnet.motif_density(**params)
    assert sequences.shape == (30,)

  def test_single_motif_detection(self):
    "Test single motif detection"
    params = {
        "motif_name": "TAL1_known4",
        "seq_length": 1000,
        "num_pos": 30,
        "num_neg": 30,
        "GC_fraction": 0.4
    }
    sequences, y, embed = dc.molnet.simulate_single_motif_detection(**params)
    assert sequences.shape == (60,)
    assert y.shape == (60, 1)
+1 −8
Original line number Diff line number Diff line
from setuptools import setup

config = {
    'install_requires': ['simdna==0.3'],
    'dependency_links':
    ["https://github.com/kundajelab/simdna/tarball/0.3#egg=simdna-0.3"],
    'setup_requires': ['pbr'],
    'pbr':
    True
}
config = {'setup_requires': ['pbr'], 'pbr': True}
setup(**config)