Skip to content

Commit 95a409b

Browse files
committed
Fixed handling of entities with no chains
1 parent 8789bb5 commit 95a409b

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -159,22 +159,25 @@ private void storeEntityInformation(List<Chain> allChains, List<EntityInfo> enti
159159
if (entityChains.isEmpty()){
160160
// Error mapping chain to entity
161161
System.err.println("ERROR MAPPING CHAIN TO ENTITY: "+description);
162+
mmtfDecoderInterface.setEntityInfo(new int[0], "", description, type);
162163
continue;
163164
}
164-
int[] chainIndices = new int[entityChains.size()];
165-
for (int i=0; i<entityChains.size(); i++) {
166-
chainIndices[i] = allChains.indexOf(entityChains.get(i));
167-
}
168-
Chain chain = entityChains.get(0);
169-
ChainImpl chainImpl;
170-
if (chain instanceof ChainImpl){
171-
chainImpl = (ChainImpl) entityChains.get(0);
172-
}
173165
else{
174-
throw new RuntimeException();
166+
int[] chainIndices = new int[entityChains.size()];
167+
for (int i=0; i<entityChains.size(); i++) {
168+
chainIndices[i] = allChains.indexOf(entityChains.get(i));
169+
}
170+
Chain chain = entityChains.get(0);
171+
ChainImpl chainImpl;
172+
if (chain instanceof ChainImpl){
173+
chainImpl = (ChainImpl) entityChains.get(0);
174+
}
175+
else{
176+
throw new RuntimeException();
177+
}
178+
String sequence = chainImpl.getSeqResOneLetterSeq();
179+
mmtfDecoderInterface.setEntityInfo(chainIndices, sequence, description, type);
175180
}
176-
String sequence = chainImpl.getSeqResOneLetterSeq();
177-
mmtfDecoderInterface.setEntityInfo(chainIndices, sequence, description, type);
178181
}
179182
}
180183

0 commit comments

Comments
 (0)