Skip to content

Commit 9383206

Browse files
committed
Fixing #671
1 parent dc5639c commit 9383206

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.biojava.nbio.structure.io.FileParsingParameters;
5151
import org.biojava.nbio.structure.io.mmcif.ChemCompGroupFactory;
5252
import org.biojava.nbio.structure.io.mmcif.DownloadChemCompProvider;
53+
import org.biojava.nbio.structure.io.mmcif.chem.PolymerType;
5354
import org.biojava.nbio.structure.io.mmcif.model.ChemComp;
5455
import org.biojava.nbio.structure.quaternary.BioAssemblyInfo;
5556
import org.biojava.nbio.structure.quaternary.BiologicalAssemblyTransformation;
@@ -513,7 +514,7 @@ public static void addSeqRes(Chain modelChain, String sequence) {
513514
continue;
514515
}
515516

516-
group = getSeqResGroup(modelChain, singleLetterCode, chainType);
517+
group = getSeqResGroup(singleLetterCode, chainType);
517518
addGroupAtId(seqResGroups, group, i);
518519
seqResGroups.set(i, group);
519520
}
@@ -537,21 +538,28 @@ private static <T> void addGroupAtId(List<T> seqResGroups, T group, int sequence
537538
}
538539
}
539540

540-
private static Group getSeqResGroup(Chain modelChain, char singleLetterCode, GroupType type) {
541+
private static Group getSeqResGroup(char singleLetterCode, GroupType type) {
541542
if(type==GroupType.AMINOACID){
542543
AminoAcidImpl a = new AminoAcidImpl();
543544
a.setRecordType(AminoAcid.SEQRESRECORD);
544545
a.setAminoType(singleLetterCode);
545546
ChemComp chemComp = new ChemComp();
546547
chemComp.setOne_letter_code(""+singleLetterCode);
547548
a.setChemComp(chemComp);
549+
chemComp.setPolymerType(PolymerType.peptide);
548550
return a;
549551

550552
} else if (type==GroupType.NUCLEOTIDE) {
551553
NucleotideImpl n = new NucleotideImpl();
552554
ChemComp chemComp = new ChemComp();
553555
chemComp.setOne_letter_code(""+singleLetterCode);
554556
n.setChemComp(chemComp);
557+
// TODO this could be either dna or rna, how to distinguish properly?
558+
if (singleLetterCode == 'U') {
559+
chemComp.setPolymerType(PolymerType.rna);
560+
} else {
561+
chemComp.setPolymerType(PolymerType.dna);
562+
}
555563
return n;
556564
}
557565
else{

biojava-structure/src/test/java/org/biojava/nbio/structure/io/mmtf/TestMmtfRoundTrip.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public void testRoundTrip() throws IOException, StructureException {
9494
* Broad test of atom similarity
9595
* @param structOne the first input structure
9696
* @param structTwo the second input structure
97-
* @param mmtfParams
9897
* @return
9998
*/
10099
private boolean checkIfAtomsSame(Structure structOne, Structure structTwo) {

biojava-structure/src/test/java/org/biojava/nbio/structure/io/mmtf/TestMmtfStructureReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void testRead() throws IOException {
4444
/**
4545
* Compare structures loaded from MMCIF and MMTF files.
4646
*/
47-
@Test @Ignore
47+
@Test
4848
public void compareMmcif() throws IOException, StructureException {
4949

5050
// Get the MMTF and MMCIF files from the resources folder

0 commit comments

Comments
 (0)