Skip to content

Commit 219d39b

Browse files
committed
and another shortcut for lpeptidelinking
1 parent 309f17a commit 219d39b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/chem

biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/chem/ResidueType.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,25 @@ public enum ResidueType implements Serializable {
115115
public static ResidueType getResidueTypeFromString(String chem_comp_type)
116116
{
117117

118+
// Almost all calls to this method are for L-peptide linking. Use this knowledge for a shortcut.
119+
120+
if ( chem_comp_type.equalsIgnoreCase(lPeptideLinking.chem_comp_type) )
121+
return lPeptideLinking;
122+
118123
ResidueType rtype = lookupTable.get(chem_comp_type);
119124
if ( rtype != null)
120125
return rtype;
121126

122127
/** Unfortunately it can be guaranteed that chem_comp_type case sensitivity is preserved.
123128
* E.g. mmtf has it all upper-case. As such we need to do a second check
124-
*
125129
*/
126130
rtype = lookupTable.get(chem_comp_type.toLowerCase());
127131
if ( rtype != null)
128132
return rtype;
129133

130134

131135

136+
// preserving previous behaviour. Not sure if this is really necessary?
132137
for(ResidueType rt : ResidueType.values())
133138
{
134139
if(rt.chem_comp_type.equalsIgnoreCase(chem_comp_type))

0 commit comments

Comments
 (0)