Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public void consumeAtomSite(AtomSite atomSite) {
atom.setY(cartnY.get(atomIndex));
atom.setZ(cartnZ.get(atomIndex));

atom.setOccupancy((float) occupancy.get(atomIndex));
atom.setOccupancy((float) (occupancy.isDefined()? occupancy.get(atomIndex) : 1.0));
atom.setTempFactor((float) bIsoOrEquiv.get(atomIndex));

if (altLocation == null || altLocation.isEmpty() || ".".equals(altLocation)) {
Expand Down Expand Up @@ -975,7 +975,7 @@ public void consumeStructRefSeq(StructRefSeq structRefSeq) {
dbRef.setIdCode(structRefSeq.getPdbxPDBIdCode().isDefined()? structRefSeq.getPdbxPDBIdCode().get(rowIndex):null);
dbRef.setDbAccession(structRefSeq.getPdbxDbAccession().isDefined()? structRefSeq.getPdbxDbAccession().get(rowIndex):null);
dbRef.setDbIdCode(structRefSeq.getPdbxDbAccession().isDefined()? structRefSeq.getPdbxDbAccession().get(rowIndex):null);
dbRef.setChainName(structRefSeq.getPdbxStrandId().get(rowIndex));
dbRef.setChainName(structRefSeq.getPdbxStrandId().isDefined()? structRefSeq.getPdbxStrandId().get(rowIndex):null);

OptionalInt structRefRowIndex = IntStream.range(0, structRef.getRowCount())
.filter(i -> structRef.getId().get(i).equals(refId))
Expand All @@ -990,34 +990,39 @@ public void consumeStructRefSeq(StructRefSeq structRefSeq) {

int seqBegin;
int seqEnd;
char beginInsCode = ' ';
char endInsCode = ' ';

try {
seqBegin = Integer.parseInt(structRefSeq.getPdbxAuthSeqAlignBeg().get(rowIndex));
seqEnd = Integer.parseInt(structRefSeq.getPdbxAuthSeqAlignEnd().get(rowIndex));
} catch (NumberFormatException e) {
// this happens in a few entries, annotation error? e.g. 6eoj
logger.warn("Couldn't parse pdbx_auth_seq_align_beg/end in _struct_ref_seq. Will not store dbref " +
"alignment info for accession {}. Error: {}", dbRef.getDbAccession(), e.getMessage());
return;
}
if (structRefSeq.getPdbxAuthSeqAlignBeg().isDefined() && structRefSeq.getPdbxAuthSeqAlignEnd().isDefined()) {
try {
seqBegin = Integer.parseInt(structRefSeq.getPdbxAuthSeqAlignBeg().get(rowIndex));
seqEnd = Integer.parseInt(structRefSeq.getPdbxAuthSeqAlignEnd().get(rowIndex));
} catch (NumberFormatException e) {
// this happens in a few entries, annotation error? e.g. 6eoj
logger.warn("Couldn't parse pdbx_auth_seq_align_beg/end in _struct_ref_seq. Will not store dbref " +
"alignment info for accession {}. Error: {}", dbRef.getDbAccession(), e.getMessage());
return;
}

char beginInsCode = ' ';
String pdbxSeqAlignBegInsCode = structRefSeq.getPdbxSeqAlignBegInsCode().get(rowIndex);
if (pdbxSeqAlignBegInsCode.length() > 0) {
beginInsCode = pdbxSeqAlignBegInsCode.charAt(0);
}
String pdbxSeqAlignBegInsCode = structRefSeq.getPdbxSeqAlignBegInsCode().get(rowIndex);
if (pdbxSeqAlignBegInsCode.length() > 0) {
beginInsCode = pdbxSeqAlignBegInsCode.charAt(0);
}

char endInsCode = ' ';
String pdbxSeqAlignEndInsCode = structRefSeq.getPdbxSeqAlignEndInsCode().get(rowIndex);
if (pdbxSeqAlignEndInsCode.length() > 0) {
endInsCode = pdbxSeqAlignEndInsCode.charAt(0);
}
String pdbxSeqAlignEndInsCode = structRefSeq.getPdbxSeqAlignEndInsCode().get(rowIndex);
if (pdbxSeqAlignEndInsCode.length() > 0) {
endInsCode = pdbxSeqAlignEndInsCode.charAt(0);
}

if (beginInsCode == '?') {
beginInsCode = ' ';
}
if (endInsCode == '?') {
endInsCode = ' ';
if (beginInsCode == '?') {
beginInsCode = ' ';
}
if (endInsCode == '?') {
endInsCode = ' ';
}
} else {
seqBegin = structRefSeq.getSeqAlignBeg().get(rowIndex);
seqEnd = structRefSeq.getSeqAlignEnd().get(rowIndex);
}

dbRef.setSeqBegin(seqBegin);
Expand Down Expand Up @@ -1814,6 +1819,10 @@ private void initMaps() {

String[] chainNames = entityPoly.getPdbxStrandId().get(rowIndex).split(",");
List<String> asymIds = entityId2asymId.get(entityPoly.getEntityId().get(rowIndex));
if (asymIds == null) {
logger.warn("No asym ids found for entity {} in _struct_asym. Can't provide a mapping from asym ids to author chain ids for this entity", entityPoly.getEntityId().get(rowIndex));
break;
}
if (chainNames.length != asymIds.size()) {
logger.warn("The list of asym ids (from _struct_asym) and the list of author ids (from _entity_poly) " +
"for entity {} have different lengths! Can't provide a mapping from asym ids to author chain " +
Expand Down