def __init__(self, path, args): super(ChallengeDataTask, self).__init__(path, args) self.set_name('challengedata') # Make stage number one higher then BlastNFilter Stage blast = BlastNFilterTask(path, args) self.set_stage(blast.get_stage() + 1) self.set_status(D3RTask.UNKNOWN_STATUS) self._challenge_tarball_filename = None self._week_num = util.get_celpp_week_number_from_path(self.get_path()) self._year = util.get_celpp_year_from_path(self.get_dir())
def test_get_celpp_week_number_from_path(self): try: util.get_celpp_week_number_from_path(None) self.fail('Expected exception') except Exception: pass # try with empty string foo = util.get_celpp_week_number_from_path('') self.assertEqual(foo, '0') # try with path missing dataset.week. prefix foo = util.get_celpp_week_number_from_path('/h/b/hi') self.assertEqual(foo, '0') # try with valid path foo = util.get_celpp_week_number_from_path('/h/b/' + util.DATA_SET_WEEK_PREFIX + '7') self.assertEqual(foo, '7') foo = util.get_celpp_week_number_from_path('/h/b/' + util.DATA_SET_WEEK_PREFIX + '12') self.assertEqual(foo, '12')
def _generate_external_submission_email_body(self, etask): """Creates body of email and subject :returns subject,body: as strings """ weekno = util.get_celpp_week_number_from_path(etask.get_path()) msg = 'Dear CELPP Participant,\n\nHere are your docking ' \ 'evaluation results (RMSD, Angstroms) for CELPP week ' +\ str(weekno) + '\n\n' msg += etask.get_evaluation_summary() msg += '\n\nSincerely,\n\nCELPP Automation' guid = etask.get_guid_for_task() subject = (D3RTask.SUBJECT_LINE_PREFIX + 'Week ' + str(weekno) + ' evaluation results for ' + str(guid)) return subject, msg
def _generate_post_evaluation_email_body(self, petask): """Creates body of email and subject :returns subject,body: as strings """ weekno = util.get_celpp_week_number_from_path(petask.get_path()) year = util.get_celpp_year_from_path(petask.get_path()) msg = ('Dear CELPP Admin,\n\nHere is the post evaluation ' + 'summary reports for CELPP week ' + str(weekno) + '\n\n') msg += petask.get_postevaluation_summary() msg += '\n\nSincerely,\n\nCELPP Automation' subject = (D3RTask.SUBJECT_LINE_PREFIX + str(year) + ' ' + 'week ' + str(weekno) + ' post evaluation summary report') return subject, msg
def _generate_external_submission_email_body(self, etask): """Creates body of email and subject :returns subject,body: as strings """ weekno = util.get_celpp_week_number_from_path(etask.get_path()) msg = 'Dear CELPP Participant,\n\nHere are your docking ' \ 'evaluation results as RMSD in Angstroms for CELPP week ' +\ str(weekno) + '\n\n' msg += ('Note: The value in (parentheses) by each RMSD is the ' + 'distance, in Angstroms, between submitted ligand center ' + 'of mass and the crystal ligand center of mass. The final ' 'column is the distance between CELPP-provided pocket ' 'center and the crystal ligand center of mass.\n\n') msg += etask.get_evaluation_summary() msg += ('\n\nSincerely,\n\nCELPP Automation ' + etask.get_program_version()) guid = etask.get_guid_for_task() subject = (D3RTask.SUBJECT_LINE_PREFIX + 'Week ' + str(weekno) + ' evaluation results for ' + str(guid)) return subject, msg
def get_week_number(self): """Parses path for week number :returns: week number as string """ return util.get_celpp_week_number_from_path(os.path.dirname( self._path))