public void mapSeqresRecords ( Chain atomRes , Chain seqRes ) { List < Group > seqResGroups = seqRes . getAtomGroups ( ) ; List < Group > atmResGroups = atomRes . getAtomGroups ( ) ; logger . debug ( "Comparing ATOM {} ({} groups) to SEQRES {} ({} groups) " , atomRes . getId ( ) , atmResGroups . size ( ) , seqRes . getId ( ) , seqResGroups . size ( ) ) ; List < Group > matchedGroups = trySimpleMatch ( seqResGroups , atmResGroups ) ; if ( matchedGroups != null ) { // update the new SEQRES list atomRes . setSeqResGroups ( matchedGroups ) ; return ; } logger . debug ( "Could not map SEQRES to ATOM records easily, need to align..." ) ; int numAminosSeqres = seqRes . getAtomGroups ( GroupType . AMINOACID ) . size ( ) ; int numNucleotidesSeqres = seqRes . getAtomGroups ( GroupType . NUCLEOTIDE ) . size ( ) ; if ( numAminosSeqres < 1 ) { if ( numNucleotidesSeqres > 1 ) { logger . debug ( "SEQRES chain {} is a nucleotide chain ({} nucleotides), aligning nucleotides..." , seqRes . getId ( ) , numNucleotidesSeqres ) ; alignNucleotideChains ( seqRes , atomRes ) ; return ; } else { logger . debug ( "SEQRES chain {} contains {} amino acids and {} nucleotides, ignoring..." , seqRes . getId ( ) , numAminosSeqres , numNucleotidesSeqres ) ; return ; } } if ( atomRes . getAtomGroups ( GroupType . AMINOACID ) . size ( ) < 1 ) { logger . debug ( "ATOM chain {} does not contain amino acids, ignoring..." , atomRes . getId ( ) ) ; return ; } logger . debug ( "Proceeding to do protein alignment for chain {}" , atomRes . getId ( ) ) ; boolean noMatchFound = alignProteinChains ( seqResGroups , atomRes . getAtomGroups ( ) ) ; if ( ! noMatchFound ) { atomRes . setSeqResGroups ( seqResGroups ) ; } }
Map the seqRes groups to the atomRes chain . Updates the atomRes chain object with the mapped data The seqRes chain should not be needed after this and atomRes should be further used .