diff --git a/modules/io/src/mol/pdb_reader.cc b/modules/io/src/mol/pdb_reader.cc index bf2e50bd87b3a1310903afa6360863639ddddee5..1ea2c56b8b23e81c676fdc5ec94fb0e894b2093f 100644 --- a/modules/io/src/mol/pdb_reader.cc +++ b/modules/io/src/mol/pdb_reader.cc @@ -151,9 +151,12 @@ void PDBReader::ParseSeqRes(const StringRef& line, int line_num) conop::CompoundPtr compound=comp_lib->FindCompound(trimmed.str(), conop::Compound::PDB); if (!compound) { - LOG_WARNING("unknown residue '" << trimmed << "' in SEQRES record. " - "Setting one-letter-code to X"); - curr_seq.Append('X'); + if (rname!=StringRef("UNK", 3)) { + + LOG_WARNING("unknown residue '" << trimmed << "' in SEQRES record. " + "Setting one-letter-code to '?'"); + } + curr_seq.Append('?'); continue; } curr_seq.Append(compound->GetOneLetterCode()); diff --git a/modules/seq/alg/pymod/__init__.py b/modules/seq/alg/pymod/__init__.py index bb1ea4e829b6a06e7d0240b227d6ae467aed9cff..1862fc812427adfb37c9758786f39007f8e4352c 100644 --- a/modules/seq/alg/pymod/__init__.py +++ b/modules/seq/alg/pymod/__init__.py @@ -17,14 +17,13 @@ def AlignToSEQRES(chain, seqres): """ from ost import seq from ost import mol - residues=chain.residues + view=chain.Select('ligand=false and peptide=true') + residues=view.residues if len(residues)==0: - return None + return seq.CreateAlignment() fragments=[residues[0].one_letter_code] for r1, r2 in zip(residues[:-2], residues[1:]): - if not r2.IsPeptideLinking() or r2.IsLigand(): - continue - if not mol.InSequence(r1, r2): + if not mol.InSequence(r1.handle, r2.handle): fragments.append('') fragments[-1]+=r2.one_letter_code ss=str(seqres) @@ -41,4 +40,4 @@ def AlignToSEQRES(chain, seqres): seq.CreateSequence('atoms', aln_seq)) - \ No newline at end of file +