5050import org .biojava .nbio .structure .io .FileParsingParameters ;
5151import org .biojava .nbio .structure .io .mmcif .ChemCompGroupFactory ;
5252import org .biojava .nbio .structure .io .mmcif .DownloadChemCompProvider ;
53+ import org .biojava .nbio .structure .io .mmcif .chem .PolymerType ;
5354import org .biojava .nbio .structure .io .mmcif .model .ChemComp ;
5455import org .biojava .nbio .structure .quaternary .BioAssemblyInfo ;
5556import 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 {
0 commit comments