<commit_before># -*- coding: utf-8 -*-
"""
Created on Sat Sep 26 13:39:23 2015

@author: strokach
"""
import os.path as op
import logging
import pytest
from elaspic import (
    conf, sequence, structure_tools, local_pipeline
)
from conftest import TESTS_BASE_DIR

logger = logging.getLogger(__name__)


# %% Constants
if hasattr(pytest, "config"):
    QUICK = pytest.config.getoption('--quick')
    CONFIG_FILE = (
        pytest.config.getoption('--config-file') or
        op.join(TESTS_BASE_DIR, 'test_local_pipeline.ini')
    )
else:
    QUICK = False
    CONFIG_FILE = op.join(TESTS_BASE_DIR, 'test_local_pipeline.ini')


logger.debug('Running quick: {}'.format(QUICK))
logger.debug('Config file: {}'.format(CONFIG_FILE))


# %%
# Source of good PDB stuctures: http://www.rcsb.org/pdb/101/motm_archive.do
pdb_mutatations = {
    # test_1; only one chain
    '3M7R': {
        'A': [
             'I271A',  # core
             'Y401A',  # core
        ]
    },
    # test_2; this one has three symetric chains
    '1THJ': {
        'B': [
            # interface with A & C
            # all of these should had one core and two interface predictions
            'P36A',
            'E37A',
            'P54A',
            'M55A',
            'G77A',
            'Q118A',
            'Q136A',
            'P152A',
            'R153A',
            'G170A',
        ],
    },
    # this one has two chains and DNA in it...
    '3OS0': {
        'A': [
            'K36A',  # surface, no interface
            'V58A',  # core
            'V89A',  # core
            'P247A',  # interface with B_S175
            'Q250A',  # interface with B_S175
            'L251A',  # interface with B_S175
            'N275A',  # interface with B_I178
        ],
        'B': [
            'S175A',  # interface with A_P247, A_Q250, A_L251
            'I178A',  # interface with A_N275
        ]
    },
}


sequence_mutations = {
    ('2FOY', 'P23280'): {
        # mutation_type == 1
        'A': [
            'Q15A',
            'N24A',
        ],
        # mutation_type == 2
        'A': [
            'H34A',
            'G43A',
        ],
        # mutation_type == 3
        '1': [
            'H34A',
            'G43A',
        ],
    },
    ('2Z5Y', 'Q5NU32'): {
        # mutation_type == 2
        'A': [
            'H12A',
            'M13A',
        ],
        # mutation_type == 3
        '1': [
            'H12A',
            'M13A',
            'K30A',
            'L31A',
        ]
    },
}<commit_msg>Add test cases for PDB mutation type 1 / 2/ 3<commit_after># -*- coding: utf-8 -*-
"""
Created on Sat Sep 26 13:39:23 2015

@author: strokach
"""
import os.path as op
import logging
import pytest
from elaspic import (
    conf, sequence, structure_tools, local_pipeline
)
from conftest import TESTS_BASE_DIR

logger = logging.getLogger(__name__)


# %% Constants
if hasattr(pytest, "config"):
    QUICK = pytest.config.getoption('--quick')
    CONFIG_FILE = (
        pytest.config.getoption('--config-file') or
        op.join(TESTS_BASE_DIR, 'test_local_pipeline.ini')
    )
else:
    QUICK = False
    CONFIG_FILE = op.join(TESTS_BASE_DIR, 'test_local_pipeline.ini')


logger.debug('Running quick: {}'.format(QUICK))
logger.debug('Config file: {}'.format(CONFIG_FILE))


# %%
# Source of good PDB stuctures: http://www.rcsb.org/pdb/101/motm_archive.do
pdb_mutatations = {
    # test_1; only one chain
    '3M7R': {
        'A': [
             'I271A',  # core
             'Y401A',  # core
        ]
    },
    # test_2; this one has three symetric chains
    '1THJ': {
        # Chain B interacts with A & C
        # All of these mutations should had one core and two interface predictions
        # Mutation type 1
        'B': [
            'P36A',
            'E37A',
            'P54A',
            'M55A',
            'G77A',
            'Q118A',
            'Q136A',
            'P152A',
            'R153A',
            'G170A',
        ],
        # Mutation type 2
        'B': [
            'P37A',
            'E38A',
            'P55A',
            'M56A',
            'G78A',
            'Q119A',
            'Q137A',
            'P153A',
            'R154A',
            'G171A',
        ],
        # Mutation type 3
        '2': [
            'P37A',
            'E38A',
            'P55A',
            'M56A',
            'G78A',
            'Q119A',
            'Q137A',
            'P153A',
            'R154A',
            'G171A',
        ],
    },
    # this one has two chains and DNA in it...
    '3OS0': {
        'A': [
            'K36A',  # surface, no interface
            'V58A',  # core
            'V89A',  # core
            'P247A',  # interface with B_S175
            'Q250A',  # interface with B_S175
            'L251A',  # interface with B_S175
            'N275A',  # interface with B_I178
        ],
        'B': [
            'S175A',  # interface with A_P247, A_Q250, A_L251
            'I178A',  # interface with A_N275
        ]
    },
}


sequence_mutations = {
    ('2FOY', 'P23280'): {
        #  Mutation type 1
        'A': [
            'Q15A',
            'N24A',
        ],
        #  Mutation type 2
        'A': [
            'H34A',
            'G43A',
        ],
        #  Mutation type 3
        '1': [
            'H34A',
            'G43A',
        ],
    },
    ('2Z5Y', 'Q5NU32'): {
        # Mutation type 1 / 2
        'A': [
            'H12A',
            'M13A',
        ],
        #  Mutation type 3
        '1': [
            'H12A',
            'M13A',
            'K30A',
            'L31A',
        ]
    },
}
{'fraction_non_alphanumeric': 0.13757370019653387, 'fraction_numerical': 0.06181883151688405, 'mean_word_length': 1.3491397398237517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3924049', 'n_tokens_mistral': 2139, 'n_tokens_neox': 1926, 'n_words': 419}