Commit 8ce5f0c7 authored by Bharath Ramsundar's avatar Bharath Ramsundar
Browse files

Merge branch 'master' of https://github.com/deepchem/deepchem into deprem

parents 0d49f0f4 c099b76b
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -19,9 +19,15 @@ install:
- pip install coveralls
- python setup.py install
script:
- nosetests --with-flaky -a '!slow' --with-timer --with-coverage --cover-package=deepchem -v deepchem --nologcapture
- nosetests --with-flaky -a '!slow' --with-timer --with-coverage --cover-package=deepchem
  -v deepchem --nologcapture
- find ./deepchem | grep .py$ |xargs python -m doctest -v
- bash devtools/travis-ci/test_format_code.sh
after_success:
- echo $TRAVIS_SECURE_ENV_VARS
- coveralls
deploy:
  provider: pypi
  user: "lilleswing"
  password:
    secure: EcOuKUABsp7yUYjCseh9iPltC+sOn/AXh774moIT1InQN8ts04t6E1H1+A4BDlIGptWIaarZKfoa80Hqwtuxu8T6UcoPKLfHwGsmXFMTe5lXZQHopP1zNCgFYNC4ShcXmYqPw5zHSVPoJL1Ub1VbEBK+B+Rph8/YIaogPmZ8B6KpbtgD74dubR29XNMrZKJfbNwnqGX9Mv/X5MXgq26fFm77OV/tJf/O1qeq3id6NbCQ3/cjVnG2/TqNTGThmBWW7n+eA4XImlfSrS4NgiMSOHnU+zXmnr0Trs8CxspaR9pXF50JVAR0Q230ZireJi85maZzE4onC3kGC1knLI2ERVgp4tySfe5XRa/iXz94mmqrZjbLXxDpkQngU1HLhC9ojrAJWq6K3mBzz7xDL5hlB+IzIg8LBz08wEm+U+DLt/ygR6QGASit5NWC0QCbyARxFDfk60VubXR0VSsd+rs3dgrDsvphijZmys6Kt3WeuBYS5uzu9JIjukyVIX/PN2tThV6AQKnTuhcnmqUjfTwm2ueMe5PYIPAHFINk7nugfxpc2EeFO0FbSIJn6+RRdGklZY3ldda1aInyrb3kyoEl2Eyqo8AdmNCSpriI2wSa2r2OL+IH2U9N+e1qof6bKJFel2PetHp7p2l0ihZqQQgxTDU8dro3lTrppL4+H2TOB6M=

MANIFEST.in

0 → 100644
+2 −0
Original line number Diff line number Diff line
prune datasets
prune examples
+4 −1
Original line number Diff line number Diff line
# DeepChem
[![Build Status](https://travis-ci.org/deepchem/deepchem.svg?branch=master)](https://travis-ci.org/deepchem/deepchem)
[![Coverage Status](https://coveralls.io/repos/github/deepchem/deepchem/badge.svg?branch=master)](https://coveralls.io/github/deepchem/deepchem?branch=master)
[![Anaconda-Server Badge](https://anaconda.org/deepchem/deepchem/badges/version.svg)](https://anaconda.org/deepchem/deepchem)
[![PyPI version](https://badge.fury.io/py/deepchem.svg)](https://badge.fury.io/py/deepchem)


DeepChem aims to provide a high quality open-source toolchain that
democratizes the use of deep-learning in drug discovery, materials science, quantum chemistry, and biology.
@@ -166,7 +169,7 @@ import deepchem as dc
1. Question: I'm seeing some failures in my test suite having to do with MKL
   ```Intel MKL FATAL ERROR: Cannot load libmkl_avx.so or libmkl_def.so.```

   Answer: This is a general issue with the newest version of `scikit-learn` enabling MKL by default. This doesn't play well with many linux systems. See BVLC/caffe#3884 for discussions. The following seems to fix the issue
   Answer: This is a general issue with the newest version of `scikit-learn` enabling MKL by default. This doesn't play well with many linux systems. See [BVLC/caffe#3884](https://github.com/BVLC/caffe/issues/3884) for discussions. The following seems to fix the issue
   ```bash
   conda install nomkl numpy scipy scikit-learn numexpr
   conda remove mkl mkl-service
+1 −0
Original line number Diff line number Diff line
@@ -18,4 +18,5 @@ from deepchem.data.data_loader import DataLoader
from deepchem.data.data_loader import CSVLoader
from deepchem.data.data_loader import UserCSVLoader
from deepchem.data.data_loader import SDFLoader
from deepchem.data.data_loader import FASTALoader
import deepchem.data.tests
+47 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import sys
from deepchem.utils.save import log
from deepchem.utils.save import load_csv_files
from deepchem.utils.save import load_sdf_files
from deepchem.utils.save import encode_fasta_sequence
from deepchem.feat import UserDefinedFeaturizer
from deepchem.data import DiskDataset

@@ -186,7 +187,20 @@ class DataLoader(object):
    self.log_every_n = log_every_n

  def featurize(self, input_files, data_dir=None, shard_size=8192):
    """Featurize provided files and write to specified location."""
    """Featurize provided files and write to specified location.
    
    For large datasets, automatically shards into smaller chunks
    for convenience.

    Parameters
    ----------
    input_files: list
      List of input filenames.
    data_dir: str
      (Optional) Directory to store featurized dataset.
    shard_size: int
      (Optional) Number of examples stored in each shard.
    """
    log("Loading raw samples now.", self.verbose)
    log("shard_size: %d" % shard_size, self.verbose)

@@ -280,3 +294,35 @@ class SDFLoader(DataLoader):
    log("Currently featurizing feature_type: %s" %
        self.featurizer.__class__.__name__, self.verbose)
    return featurize_mol_df(shard, self.featurizer, field=self.mol_field)


class FASTALoader(DataLoader):
  """
  Handles loading of FASTA files.
  """

  def __init__(self, verbose=True):
    """Initialize loader."""
    self.verbose = verbose

  def featurize(self, input_files, data_dir=None):
    """Featurizes fasta files.

    Parameters
    ----------
    input_files: list
      List of fasta files.
    data_dir: str
      (Optional) Name of directory where featurized data is stored.
    """
    if not isinstance(input_files, list):
      input_files = [input_files]

    def shard_generator():
      for input_file in input_files:
        X = encode_fasta_sequence(input_file)
        ids = np.ones(len(X))
        # (X, y, w, ids)
        yield X, None, None, ids

    return DiskDataset.create_dataset(shard_generator(), data_dir)
Loading