Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Commit

Permalink
Merge f739fc5 into 52000c8
Browse files Browse the repository at this point in the history
  • Loading branch information
CunliangGeng committed Sep 11, 2019
2 parents 52000c8 + f739fc5 commit 063fec5
Show file tree
Hide file tree
Showing 29 changed files with 12,767 additions and 12,696 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,8 @@ test/*.pdb
#docs/_templates

# vscode setting
.vscode
.vscode

.DS_Store
test/1AK4/atomic_features/test_1AK4_100w.dat
test/2OUL/atomic_features/test_2OUL_1.dat
27 changes: 0 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,6 @@ before_install:
- conda install -c conda-forge pytest-cov
- conda install python=3.6

# install freesasa python bindings
# - pip install freesasa==2.0.3.post4 # <- doesn't work anymore

# install freesasa
# - conda install cython
# - git clone https://github.com/freesasa/freesasa-python
# - cd freesasa-python
# - git submodule update --init
# - USE_CYTHON=1 python setup.py build
# - export PYTHONPATH=$PYTHONPATH: ???

# install freesasa
- conda install cython
- sudo apt-get install -y libxml2 libxml2-dev libjson0 libjson0-dev
- wget http://github.com/mittinatten/freesasa/releases/download/2.0.2/freesasa-2.0.2.tar.gz
- mkdir freesasa
- tar -xvf freesasa-2.0.2.tar.gz -C freesasa --strip-components=1
- cd freesasa
- ./configure --disable-xml --disable-json --enable-python-bindings --with-python=python3.6 CFLAGS="-fPIC" --prefix=$HOME
- make
- make install
- cd ../


# install pytorch
- conda install pytorch=1.0 torchvision cuda80 -c soumith

# codacy-coverage
- pip install -q --upgrade pip
- pip install -q coverage
Expand Down
10 changes: 7 additions & 3 deletions deeprank/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@
# the warning is
# /home/nico/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
# from ._conv import register_converters as _register_converters
import logging
import logging.config
import sys
import warnings

from .config import *
from .generate import *
from .tools import *

warnings.simplefilter(action='ignore', category=FutureWarning)


# deep learning
# import torch fals on Travis
#from .learn import *

warnings.simplefilter(action='ignore', category=FutureWarning)
logging.captureWarnings(True)
17 changes: 17 additions & 0 deletions deeprank/config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import logging
import logging.config

from . import logger_settings
from .chemicals import AA_codes, AA_codes_3to1, AA_codes_1to3
from .chemicals import AA_codes_pssm_ordered
from .chemicals import AA_properties

# Debug
DEBUG = False

# Default logger
logging.config.dictConfig(logger_settings.DEFAULT_LOGGING)
logger = logging.getLogger('deeprank')

# Default PSSM path
PATH_PSSM_SOURCE = None
73 changes: 73 additions & 0 deletions deeprank/config/chemicals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# 20 standard amino acids
# https://www.ncbi.nlm.nih.gov/Class/MLACourse/Modules/MolBioReview/iupac_aa_abbreviations.html
_aa_standard = [
('ALA', 'A'),
('ARG', 'R'),
('ASN', 'N'),
('ASP', 'D'),
('CYS', 'C'),
('GLN', 'Q'),
('GLU', 'E'),
('GLY', 'G'),
('HIS', 'H'),
('ILE', 'I'),
('LEU', 'L'),
('LYS', 'K'),
('MET', 'M'),
('PHE', 'F'),
('PRO', 'P'),
('SER', 'S'),
('THR', 'T'),
('TRP', 'W'),
('TYR', 'Y'),
('VAL', 'V')
]

# nonstandard amino acids used in blast
# https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=BlastDocs&DOC_TYPE=BlastHelp
_aa_nonstadnard = [
('ASX', 'B'),
('GLX', 'Z'),
('SEC', 'U')
]

# ordered amino acids according to PSSM file
# https://www.ncbi.nlm.nih.gov/Structure/cdd/cdd_help.shtml#CD_PSSM
_aa_pssm = ('A', 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I',
'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V')

# ('ALA',...)
AA_codes = tuple([i[0] for i in _aa_standard])

# {'ALA': 'A', ...}
AA_codes_3to1 = dict(_aa_standard + _aa_nonstadnard)

# {'A': 'ALA', ...}
AA_codes_1to3 = dict([i[::-1] for i in _aa_standard + _aa_nonstadnard])

# AA codes ordered as PSSM header
AA_codes_pssm_ordered = tuple([AA_codes_1to3[i] for i in _aa_pssm])

# AA properties
AA_properties = {
'ALA': 'apolar',
'GLY': 'apolar',
'ILE': 'apolar',
'LEU': 'apolar',
'MET': 'apolar',
'PHE': 'apolar',
'PRO': 'apolar',
'VAL': 'apolar',
'ARG': 'charged',
'ASP': 'charged',
'GLU': 'charged',
'LYS': 'charged',
'ASN': 'polar',
'CYS': 'polar',
'GLN': 'polar',
'HIS': 'polar',
'SER': 'polar',
'THR': 'polar',
'TRP': 'polar',
'TYR': 'polar'
}
54 changes: 54 additions & 0 deletions deeprank/config/logger_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Default logging settings for DeepRank.
DEFAULT_LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'brief': {
'format': '%(message)s',
},
'precise': {
'format': '%(levelname)s: %(message)s',
},
},
'filters': {
'require_debug': {
'()': 'deeprank.utils.logger_helper.requireDebugFilter',
},
'use_only_info_level': {
'()': 'deeprank.utils.logger_helper.useLevelsFilter',
'levels': 'INFO', # function parameter
},
'use_only_debug_level': {
'()': 'deeprank.utils.logger_helper.useLevelsFilter',
'levels': 'DEBUG',
},
},
'handlers': {
'stdout': {
'level': 'INFO',
'formatter': 'brief',
'filters': ['use_only_info_level', ],
'class': 'logging.StreamHandler',
'stream': 'ext://sys.stdout',
},
'stderr': {
'level': 'WARNING',
'formatter': 'precise',
'class': 'logging.StreamHandler',
'stream': 'ext://sys.stderr',
},
'debug': {
'level': 'DEBUG',
'formatter': 'precise',
'filters': ['require_debug', 'use_only_debug_level'],
'class': 'logging.StreamHandler',
'stream': 'ext://sys.stderr',
},
},
'loggers': {
'deeprank': {
'handlers': ['stdout', 'stderr', 'debug'],
'level': 'DEBUG',
},
}
}
Loading

0 comments on commit 063fec5

Please sign in to comment.