Skip to content

Commit

Permalink
Cleanup imports and integrate unversioned ensembl transcript IDs for …
Browse files Browse the repository at this point in the history
…cosmis/rate4site lookups #40 #41
  • Loading branch information
ChrisMoth committed Aug 31, 2022
1 parent dd87971 commit 86e0331
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/PDBMapComplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

import logging

from pdbmap.lib.PDBMapAlignment import sifts_best_unps
from lib.PDBMapAlignment import sifts_best_unps

LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -762,16 +762,17 @@ def _load_one_cosmis_file(cosmis_filename: str) -> Tuple[pd.DataFrame, float, fl
float_regex = '([-+]?[0-9]*\.?[0-9]*)'
spaces = ' *'
int_regex = '([0-9]*)'
cosmis_data_re = re.compile(

cosmis_data_regular_expression = (
'^' + spaces + int_regex + # POS
spaces + '([A-Z])' + # SEQ
spaces + float_regex + # SCORE
spaces + '[' + spaces + float_regex + # QQ-INTERVAL_low
',' + spaces + float_regex + ']' + # QQ-INTERVAL_high
spaces + '\[' + spaces + float_regex + # QQ-INTERVAL_low
',' + spaces + float_regex + '\]' + # QQ-INTERVAL_high
spaces + float_regex + # STD
spaces + int_regex + # MSA
'/100[ \n]*$'
)
'/100[ \n]*$')
cosmis_data_re = re.compile(cosmis_data_regular_expression)

alpha_parameter = None
average = None
Expand Down Expand Up @@ -835,7 +836,7 @@ def load_cosmis_scores(self):
# We kiad Bian Li's normalized cosmis scores (average-0, stddev=1)
if ensembl_transcript.id not in self.ensembl_transcript_to_cosmis:
cosmis_norm_rates_filename = os.path.join(PDBMapGlobals.config['cosmis_dir'],
"%s_norm_rates.txt" % ensembl_transcript.id)
"%s_norm_rates.txt" % ensembl_transcript.id.split('.')[0])
df_cosmis_scores, cosmis_alpha_parameter, cosmis_average, cosmis_stddev = \
self._load_one_cosmis_file(cosmis_norm_rates_filename)
self.ensembl_transcript_to_cosmis[ensembl_transcript.id] = df_cosmis_scores
Expand Down

0 comments on commit 86e0331

Please sign in to comment.