FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bug fix where three-letter-code was not assigned for altloc · biojava/biojava@818354e · GitHub

Commit 818354e

Browse files
Sebastian Bittrich
committed
bug fix where three-letter-code was not assigned for altloc
1 parent 7c03622 commit 818354e

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

‎biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/cif/CifFileConsumerImplTest.java‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,6 @@
2121
import static org.junit.Assert.*;
2222

2323
public class CifFileConsumerImplTest {
24-
/**
25-
* java.lang.NullPointerException - failed for /var/bcif/hm/2hmz.bcif
26-
*/
27-
@Test
28-
@Ignore("ignored for now as Bcif file source may change - currently using local files")
29-
public void testAltLocCleanup() throws IOException, StructureException {
30-
StructureIO.getAtomCache().setUseMmCif(true);
31-
StructureIO.getStructure("2hmz");
32-
Structure cif = loadLocalCif("2hmz");
33-
Structure bcif = loadLocalBcif("2hmz");
34-
}
35-
3624
/**
3725
* java.lang.NumberFormatException: multiple points have been thrown.
3826
*/

‎biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifFileConsumerImpl.java‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ private Group getAltLocGroup(String recordName, Character altLoc, Character oneL
316316
}
317317

318318
Group altLocGroup = createGroup(recordName, oneLetterCode, threeLetterCode, seqId);
319+
altLocGroup.setPDBName(threeLetterCode);
319320
altLocGroup.setResidueNumber(currentGroup.getResidueNumber());
320321
currentGroup.addAltLoc(altLocGroup);
321322
return altLocGroup;
@@ -677,7 +678,6 @@ public void consumePdbxAuditRevisionHistory(PdbxAuditRevisionHistory pdbxAuditRe
677678
if (pdbxAuditRevisionHistory.getOrdinal().get(rowIndex) == 1) {
678679
String release = pdbxAuditRevisionHistory.getRevisionDate().get(rowIndex);
679680
try {
680-
// TODO java.lang.NumberFormatException: multiple points - failed for /var/bcif/z4/1z4s.bcif, failed for /var/bcif/he/4hec.bcif
681681
Date releaseDate = DATE_FORMAT.parse(release);
682682
pdbHeader.setRelDate(releaseDate);
683683
} catch (ParseException e) {
@@ -689,7 +689,6 @@ public void consumePdbxAuditRevisionHistory(PdbxAuditRevisionHistory pdbxAuditRe
689689
// the last revision date will "stick"
690690
String revision = pdbxAuditRevisionHistory.getRevisionDate().get(rowIndex);
691691
try {
692-
// TODO java.lang.NumberFormatException: multiple points - failed for /var/bcif/dz/1dzw.bcif, failed for /var/bcif/y2/2y28.bcif
693692
Date revisionDate = DATE_FORMAT.parse(revision);
694693
pdbHeader.setModDate(revisionDate);
695694
} catch (ParseException e) {
@@ -713,7 +712,6 @@ public void consumePdbxDatabaseStatus(PdbxDatabaseStatus pdbxDatabaseStatus) {
713712
String deposition = recvdInitialDepositionDate.get(rowIndex);
714713

715714
try {
716-
// TODO failed for /var/bcif/z4/2z4j.bcif java.lang.NumberFormatException: For input string: ".202717E4202717E4"
717715
Date depositionDate = DATE_FORMAT.parse(deposition);
718716
pdbHeader.setDepDate(depositionDate);
719717
} catch (ParseException e) {
@@ -1112,6 +1110,15 @@ public void finish() {
11121110
SeqRes2AtomAligner.storeUnAlignedSeqRes(structure, seqResChains, params.isHeaderOnly());
11131111
}
11141112

1113+
structure.getChains()
1114+
.stream()
1115+
.map(Chain::getAtomGroups)
1116+
.flatMap(Collection::stream)
1117+
.filter(Group::hasAltLoc)
1118+
.map(Group::getAltLocs)
1119+
.flatMap(Collection::stream)
1120+
.forEach(System.out::println);
1121+
11151122
// Now make sure all altlocgroups have all the atoms in all the groups
11161123
StructureTools.cleanUpAltLocs(structure);
11171124

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL