Skip to content

Conversation

@brownbp1
Copy link
Member

Minor PR:
The goal of this branch was to modify the AddMedChem mutate in the following ways:
(1) To allow users to specify element types for pseudo-reaction linking. Previously only unknown element types (X) were allowed. This created problems in the BCL-Rosetta integration. This is the easiest way to resolve, plus it adds a layer of convenience.
(2) Added some usage info in the help options.

…pseudo-reactions. Also added some usage info.
@brownbp1 brownbp1 self-assigned this Jun 17, 2022
@brownbp1 brownbp1 requested a review from jeffmendenhall June 17, 2022 23:53
Copy link
Contributor

@jeffmendenhall jeffmendenhall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments; think some type changes would be helpful for clarity and performance

// this will cause issues so it's banned
if
(
( m_TargetMoleculeLinkElementType.empty() && m_EnableDummyAtom ) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just have m_EnableDummyAtom=!m_TargetMoleculeLinkElementType.empty(); in the rest of the logic. If I give a list of linked element types, it seems I must want them, no?

std::string m_MedChemFilename;

//! alternate element types to Undefined to control directionality
std::string m_MedChemFragmentLinkElementType;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't these chemistry::ElementType ? or lists of them if that's more appropriate?
Not that performance is an issue here, but it does lots of needless lookups later where it would seem better to just have an element type instance unless I'm missing something

(
!m_TargetMoleculeLinkElementType.empty() &&
m_EnableDummyAtom &&
m_MutableElements.Find( GetElementTypes().ElementTypeLookup( m_TargetMoleculeLinkElementType)) >= m_MutableElements.GetSize()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once you make those variables element types or lists thereof, can remove the elementtypelookup here

Comment on lines +288 to +296
const ElementType medchem_fragment_link_element
(
m_MedChemFragmentLinkElementType.empty() ? GetElementTypes().e_Undefined : GetElementTypes().ElementTypeLookup( m_MedChemFragmentLinkElementType)
);
const ElementType target_molecule_link_element
(
m_TargetMoleculeLinkElementType.empty() ? GetElementTypes().e_Undefined : GetElementTypes().ElementTypeLookup( m_TargetMoleculeLinkElementType)
);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic would also be unnecessary if they are just element types or lists thereof, whichever is appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants