Skip to content

Commit d20fcd9

Browse files
authored
Merge pull request #878 from valasatava/master
Case insensitive chem.comp type lookup
2 parents 0cea7d2 + e75eae5 commit d20fcd9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ public static ResidueType getResidueTypeFromString(String chem_comp_type)
140140
{
141141
return rt;
142142
}
143-
if ( rt.chem_comp_type.startsWith(chem_comp_type))
143+
if ( rt.chem_comp_type.toLowerCase().startsWith(chem_comp_type.toLowerCase()))
144144
return rt;
145-
if ( chem_comp_type.startsWith(rt.chem_comp_type))
145+
if ( chem_comp_type.toLowerCase().startsWith(rt.chem_comp_type.toLowerCase()))
146146
return rt;
147147
}
148148
return null;

biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmtf/MmtfStructureReader.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ public void setGroupInfo(String groupName, int groupNumber,
214214
char singleLetterCode, int sequenceIndexId, int secStructType) {
215215
// Get the polymer type
216216
ResidueType residueType = ResidueType.getResidueTypeFromString(chemCompType);
217+
if (residueType == null)
218+
throw new IllegalStateException("Couldn't resolve residue type for "+ chemCompType);
219+
217220
int polymerType = getGroupTypIndicator(residueType.polymerType);
218221
switch (polymerType) {
219222
case 1:

0 commit comments

Comments
 (0)