diff --git a/setup.py b/setup.py index 4f926fb3b5f0c719002d45451864536e892640f5..0a6b02261910e3cbadcbadf4d5c38ff1f5ee3e4e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as f: setup( name="BioHelpers_FABER", - version="0.1.13", + version="0.1.14", description="Small collection of useful scripts for the computational work with RNA Data.", url="https://gitlab.jsc.fz-juelich.de/faber1/biohelpers", package_dir={"": "src"}, diff --git a/src/BioHelpers_FABER.egg-info/PKG-INFO b/src/BioHelpers_FABER.egg-info/PKG-INFO index a69182614ce1902e10e9cb0b08bffb7208253857..e0314b7192abae8d10d8b67dab1679c0095349f6 100644 --- a/src/BioHelpers_FABER.egg-info/PKG-INFO +++ b/src/BioHelpers_FABER.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: BioHelpers-FABER -Version: 0.1.12 +Version: 0.1.13 Summary: Small collection of useful scripts for the computational work with RNA Data. Home-page: https://gitlab.jsc.fz-juelich.de/faber1/biohelpers Author: Christian Faber diff --git a/src/BioHelpers_FABER/bio_mod.py b/src/BioHelpers_FABER/bio_mod.py index f57e88e8592ceae48ff18458c82abe23f06fa189..9651f73ebd66a3cfffa52f8d24ee09ec041a6216 100644 --- a/src/BioHelpers_FABER/bio_mod.py +++ b/src/BioHelpers_FABER/bio_mod.py @@ -491,6 +491,32 @@ def numberOfResidues(file: str) -> int: return int(len(res)) +def get_sequence_position(filename: str) -> tuple: + """Show all the non-het Residues in a given pdb file and the associated position in the native molecule. + + :param filename: Filename of PDB + :type filename: str + :return: Tuple of list with positions and sequence as string + :rtype: tuple + """ + chain = pdb.PDBParser().get_structure("id", filename)[0].get_chains() + chain = next(chain) + residues = chain.get_residues() + r1 = next(residues) + r2 = next(residues) + numb = [r1.id[1], r2.id[1]] + sequ = [r1.get_resname(), r2.get_resname()] + for r in residues: + if r.id[0] == " ": + sequ.append(r.get_resname()) + if abs(numb[-1] - r.id[1]) > 1: + numb.append(r.id[1]) + numb.append(r.id[1]) + else: + numb[-1] = r.id[1] + return (numb, "".join(sequ)) + + if __name__ == "__main__": print("------------------") print(" gmap 1.0 - sub module ")