File tree Expand file tree Collapse file tree
biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/chem Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ))
You can’t perform that action at this time.
0 commit comments