Commit 6ee06489 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Merge pull request #72 from rbharath/travis

First attempt at automatic docs-build+push
parents 577288d9 653314c2
Loading
Loading
Loading
Loading
+15 −14
Original line number Diff line number Diff line
language: python
python:
  # We don't actually use the Travis Python, but this keeps it organized.
  - "2.7"
- '2.7'

install:
  - sudo apt-get update
  - wget http://repo.continuum.io/archive/Anaconda2-2.4.1-Linux-x86_64.sh -O anaconda.sh;
@@ -9,23 +9,24 @@ install:
  - export PATH="$HOME/anaconda/bin:$PATH"
  - hash -r
  - conda config --set always_yes yes --set changeps1 no
  - conda config --add channels http://conda.binstar.org/omnia
  - conda update -q conda
  # Useful for debugging any issues with conda
  - conda info -a

  # Replace dep1 dep2 ... with your dependencies
  #- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION dep1 dep2 ...
  - conda install pandas
  - conda install -c omnia rdkit
  - conda install -c omnia openbabel
  - conda install joblib
  - pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
  - pushd .
  - cd ~/
  - git clone https://github.com/pandegroup/keras.git
  - cd keras/
  - conda install -c omnia theano
  - conda install -c omnia keras
  - python setup.py install
  - popd
  - python setup.py develop

script:
- nosetests -v deepchem

env:
  global:
  # encrypted AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to push documentation to S3
  - secure: "phb7WC1IFAY2UkANd0ydiME/Abt9g73DcqkIrjt5I9UMG3gqMXtZ5wn2X3eolZQdmHVG/1ZheEf+XX1F1+12c3FlD2kVQWkpuOBAJMzjlqe7KwrAclFopqQa5Lro4kH5gAz5GOkXuaWY9CmL/WObOCnVq3MKmbJRO3jTnLU5OxD/ecbfZUZXFQsWegp5A/DiYjG7BjBqD90BCNKNGGd8ALZDEojOu0wJQuwm/1pG4CjgT79ji4S+ygnjnA3/bJf+j1gzTo5naJyqHPITO1N71uQlb9ZZmUhzLveRu2tANSAPyxnUUI6daTpRRQUKof75QggnPbGPsj+IF/DL69YOeTXAVeTT4Stt9k6gWjTPCVQOb36fkMbYNMKaIN4L33WBsXJXqxJ5i9LXMCMoeCYB92p56q2Wp5TvhS2SgRX+rLmZCd29dN7aN31X61XsjKImr846DyABnlinZ2faUG5HNa2tOEm1xuHatW8UGMNHBkhR0rUMIlZaVYv7kQtbH8uGRwsRQH326pmMmQJwLkVe9l78cScN/C7ETvPimCBZEwjiw0shNelao52z39JlLKSvuPll172dbubb5aEls/1+uAWsQ05KnjtUlMBsARtRv99RVKDvsNUqlTAjQbWDj82JktLf+FATSAZ7s5Sj9yLWKD+QiO3Ug8JNpf6+ezm8mBo="
  - secure: "Qu0HJwAAzxcavXcDn7mIczNc3sv3xZNYs0LPoCEsJ4azjewFAC9KwI9tptqdbnEkcRJ3cyHde2n+CLg67+m3KTg9s6hoJ+lUSb+jW97zSVXusF4p3vprak+i2dqnH8JAwMD2mOktmSC+FKsQEUzm0gwwCg1BPzxJTsTngWKjYqRk5aAddSMGrVojV+D3mQoyZhqI+eCg7YRb3bl43aPwrcy11yDLhmEbP/8zEuabu02IG3Eix7qJghALbTaRi2amNSmS900y70Jm6uvIX+cUnkXJImUQathwrbIUJfQLTTQN6Rs5prR5MRd2a9Dtcp1ZtnQykNpfZ6bn847jdDtBx3emovvj4CQMEoxhTSUgePjYhU3rU7lVa5tIt2ZITL638MnZUHXVj36bZXzYJpmKZK9tUFQAp7RdjCf8twdfxaQYaVj6buZrJtD0EYDCyLtSA2KHkY48Z6+8z6idxL3vPACnuREsBpRc9I/oyJ9ygrXR9ghUdS0Pt+0YQwzkBvW3dREDdQL/ibWoI3WTXEY0y7TO/LfAAkk51MBE79xdq4EilzVrMEzGlsihPI6dGbYvF2V8+jBGN1XPayHPFIL4QBJuCo1sk7lXf55siAyMElq1uTmKTF3qn1BXs7p8DSyQQ5+S/CeWokOPNYZTpvWgM0B/BvMt2wJwcVQoOtlQM9o="

after_success:
  - source devtools/travis-ci/after_sucess.sh
+15 −18
Original line number Diff line number Diff line
@@ -720,35 +720,32 @@ class NNScoreComplexFeaturizer(ComplexFeaturizer):
    """
    Compute Binana fingerprint for complex.
    """
    ### OPEN TEMPDIR
    tempdir = tempfile.mkdtemp()

    mol_pdb_file = os.path.join(tempdir, "mol.pdb")
    with open(mol_pdb_file, "w") as mol_f:
    mol_pdb_file = tempfile.NamedTemporaryFile(suffix="pdb")
    with open(mol_pdb_file.name, "w") as mol_f:
      mol_f.writelines(mol_pdb)
    protein_pdb_file = os.path.join(tempdir, "protein.pdb")
    with open(protein_pdb_file, "w") as protein_f:
    protein_pdb_file = tempfile.NamedTemporaryFile(suffix="pdb")
    with open(protein_pdb_file.name, "w") as protein_f:
      protein_f.writelines(protein_pdb)

    mol_hyd_file = os.path.join(tempdir, "mol_hyd.pdb")
    mol_pdbqt_file = os.path.join(tempdir, "mol_hyd.pdbqt")
    mol_hyd_file = tempfile.NamedTemporaryFile(suffix="pdb")
    mol_pdbqt_file = tempfile.NamedTemporaryFile(suffix="pdbqt")
    hydrogenate_and_compute_partial_charges(
        mol_pdb_file, "pdb", tempdir, mol_hyd_file, mol_pdbqt_file)
        mol_pdb_file.name, "pdb", mol_hyd_file.name,
        mol_pdbqt_file.name)

    protein_hyd_file = os.path.join(tempdir, "protein_hyd.pdb")
    protein_pdbqt_file = os.path.join(tempdir, "protein_hyd.pdbqt")
    protein_hyd_file = tempfile.NamedTemporaryFile(suffix="pdb")
    protein_pdbqt_file = tempfile.NamedTemporaryFile(suffix="pdbqt")
    hydrogenate_and_compute_partial_charges(
        protein_pdb_file, "pdb", tempdir, protein_hyd_file, protein_pdbqt_file)
        protein_pdb_file.name, "pdb", protein_hyd_file.name,
        protein_pdbqt_file.name)

    mol_pdb_obj = PDB()
    mol_pdb_obj.load_from_files(mol_pdb_file, mol_pdbqt_file)
    mol_pdb_obj.load_from_files(mol_pdb_file.name, mol_pdbqt_file.name)

    protein_pdb_obj = PDB()
    protein_pdb_obj.load_from_files(protein_pdb_file, protein_pdbqt_file)
    protein_pdb_obj.load_from_files(
        protein_pdb_file.name, protein_pdbqt_file.name)

    features = self.binana.compute_input_vector(mol_pdb_obj, protein_pdb_obj)

    ### CLOSE TEMPDIR
    shutil.rmtree(tempdir)

    return features
+0 −10
Original line number Diff line number Diff line
@@ -48,14 +48,11 @@ def pdbqt_to_pdb(input_file, output_directory):
  """
  basename = os.path.basename(input_file).split(".")[0]
  pdb_output = os.path.join(output_directory, basename + ".pdb")
  print "About to write to"
  print pdb_output
  with open(pdb_output, "wb") as outfile:
    obabel_command = ["obabel", "-ipdbqt", input_file, "-opdb"]
    subprocess.Popen(obabel_command, stdout=outfile).wait()

def hydrogenate_and_compute_partial_charges(input_file, input_format,
                                            output_directory,
                                            hyd_output=None,
                                            pdbqt_output=None,
                                            verbose=False):
@@ -77,16 +74,9 @@ def hydrogenate_and_compute_partial_charges(input_file, input_format,
    Path to input file.
  input_format: String
    Name of input format.
  output_directory: String
    Path to desired output directory.
  """
  basename = os.path.basename(input_file).split(".")[0]

  if hyd_output is None:
    hyd_output = os.path.join(output_directory, basename + "_hyd.pdb")
  if pdbqt_output is None:
    pdbqt_output = os.path.join(output_directory, basename + "_hyd.pdbqt")

  if verbose:
    print "Create pdb with hydrogens added"
  hyd_conversion = openbabel.OBConversion()
+6 −0
Original line number Diff line number Diff line
This is a recipe for building the current development package into a conda
binary.

The installation on travis-ci is done by building the conda package,
installing it, running the tests, and then if successful pushing the
docs to AWS S3.
+2 −0
Original line number Diff line number Diff line
#!/bin/bash
pip install .
Loading