From d4d3e390a68433c1bac4d133b9de831e116da247 Mon Sep 17 00:00:00 2001 From: Tjaart de Beer <tjaart@kb-pratchet.pz.unibas.ch> Date: Tue, 3 Mar 2015 15:25:46 +0100 Subject: [PATCH] Updated more documentation. Signed-off-by: Stefan Bienert <stefan.bienert@unibas.ch> --- examples/demos/load_and_display.py | 6 +- modules/doc/users.rst | 9 ++- modules/gfx/doc/entity.rst | 22 +++---- modules/gfx/doc/scene.rst | 38 ++++++------ modules/io/doc/image_formats.rst | 86 ++++++++++++++-------------- modules/io/doc/io.rst | 72 ++++++++++++----------- modules/io/doc/mmcif.rst | 29 +++++----- modules/io/doc/profile.rst | 22 +++---- modules/io/doc/sequence_formats.rst | 6 +- modules/io/doc/structure_formats.rst | 15 +++-- modules/io/pymod/__init__.py | 3 +- 11 files changed, 156 insertions(+), 152 deletions(-) diff --git a/examples/demos/load_and_display.py b/examples/demos/load_and_display.py index be2783a00..6ce59673c 100644 --- a/examples/demos/load_and_display.py +++ b/examples/demos/load_and_display.py @@ -1,14 +1,14 @@ # remove all objects from scene, just in case scene.RemoveAll() # Load chain A of SDH -ent=io.LoadPDB('data/sdh.pdb', restrict_chains='A') +ent = io.LoadPDB('data/sdh.pdb', restrict_chains='A') # create graphics object -go=gfx.Entity('SDH', ent) +go = gfx.Entity('SDH', ent) # set rendermode of full graphical object to interpolated spline go.SetRenderMode(gfx.SLINE) # select sidechains (including bond to C-alpha and N in case of proline) -sidechains=ent.Select('aname!=CA,C,N,O', mol.EXCLUSIVE_BONDS) +sidechains = ent.Select('aname!=CA,C,N,O', mol.EXCLUSIVE_BONDS) # set rendering of sidechains to simple go.SetRenderMode(gfx.SIMPLE, sidechains) diff --git a/modules/doc/users.rst b/modules/doc/users.rst index a24b4aad0..88ef40935 100644 --- a/modules/doc/users.rst +++ b/modules/doc/users.rst @@ -4,17 +4,16 @@ Reporting a Problem When you run into a problem in OST or have question regarding it's usage, there are a few things you can do to make the life of people helping you easier. If -you follow these simple steps, you will make sure, people understand what you are -after and will get a response more quickly. +you follow these simple steps, you will make sure that people understand what you are after and will get a response more quickly. * Provide a short explanation of what you tried to accomplish, the result you were expecting and what you got instead. A good example would be: **I tried to read the attached PDB file. The file looks clean to me, but OST fails with the following error: "invalid coordinate on line 4."** * If possible, attach a small script that reproduces the problem. - * Include the relevant error message in your report - * Include the version of OpenStructure you are using - * Specify your operating system + * Include the relevant error message in your report. + * Include the version of OpenStructure you are using. + * Specify your operating system. * If you compiled OpenStructure manually, also include the version for Qt, Eigen, Python and Boost. diff --git a/modules/gfx/doc/entity.rst b/modules/gfx/doc/entity.rst index f10985bad..c22f33009 100644 --- a/modules/gfx/doc/entity.rst +++ b/modules/gfx/doc/entity.rst @@ -31,7 +31,7 @@ Render Modes at the Connectivity Level .. image:: cpk.png - Renders atoms as spheres with radii proportional to their van-der-Waals + Renders atoms as spheres with radii proportional to their van der Waals radius. .. data:: CUSTOM @@ -63,13 +63,13 @@ Render Modes at the Trace Level .. image:: line_trace.png - Renders the Calpha connected bys lines. + Renders the Calpha connected by lines. .. data:: HSC .. image:: hsc.png - Renders a Helix/Strand/Coil Cartoon. + Renders a helix/strand/coil cartoon. .. _render-options: @@ -123,9 +123,9 @@ Entity API Reference .. class:: Entity(name, entity) Entity(name, render_mode, entity) - Graphical representation of entitites. + Graphical representation of entities. - :param name: Name of the entity + :param name: Name of the entity. :type name: str :param render_mode: One of the :ref:`render-mode`. Defaults to :obj:`SIMPLE`. @@ -147,8 +147,8 @@ Entity API Reference .. code-block:: python - go.selection=query - go.selection=go.view.Select(query) + go.selection = query + go.selection = go.view.Select(query) :type: :class:`~ost.mol.EntityView` @@ -166,13 +166,13 @@ Entity API Reference the render mode of all atoms and bonds, whereas the second only changes the display of atoms/bonds that are part of the view. If `keep` is set to false, the atoms and bonds that are part of the view will only be displayed in the - new render mode, if keep is set to true, the atoms and bonds will be + new render mode. If keep is set to true, the atoms and bonds will be rendered with the new render mode in addition to whatever render mode they were rendered previously. :param render_mode: One of the :ref:`render-mode`. Defaults to :obj:`SIMPLE`. - :param view: A valid entity view + :param view: A valid entity view. :type view: :class:`~ost.mol.EntityView` .. method:: SetColor(color, selection='') @@ -204,7 +204,7 @@ Entity API Reference :doc:`query language <../mol/base/query>`. In case a generic property is undefined for a certain element, the property - the value of min is used for that element. + value of min is used for that element. :param prop: The name of the numeric property :type prop: str @@ -222,7 +222,7 @@ Entity API Reference .. method:: UpdatePositions() - Tells the graphical entity to update its vertex arrays. Use this functions + Tells the graphical entity to update its vertex arrays. Use this function when you modified coordinates of the underlying :class:`~ost.mol.EntityHandle` and would like to see the changes on the screen. diff --git a/modules/gfx/doc/scene.rst b/modules/gfx/doc/scene.rst index d1eb368c3..242cc1bfa 100644 --- a/modules/gfx/doc/scene.rst +++ b/modules/gfx/doc/scene.rst @@ -4,17 +4,17 @@ The Scene .. currentmodule:: ost.gfx The scene is the central registry for graphical objects and manages rendering -parameters. Among other parameters, it is used to setup the lighting, fog, +parameters. Among other parameters, it is used to set up the lighting, fog, background color and the position and viewing direction of the user. The scene is a singleton, meaning that there is only one scene available. The instance can be accessed via :func:`gfx.Scene`. Because the scene is so important and commonly used, the scene is also available as the `scene` variable in the -interactive python shell as well as from scripts. +interactive Python shell as well as from scripts. Manipulating the Camera -------------------------------------------------------------------------------- -The users position and orientation in the scene is specified by the camera. The camera is represented by a center, a rotation and an offset from the center. These 3 attributes can be set independently. Manipulation of the camera is done by assigning a new :class:`~ost.mol.Transform` to the :attr:`Scene.transform` attribute. +The users' position and orientation in the scene is specified by the camera. The camera is represented by a center, a rotation and an offset from the center. These 3 attributes can be set independently. Manipulation of the camera is done by assigning a new :class:`~ost.mol.Transform` to the :attr:`Scene.transform` attribute. .. _camera-orbit: @@ -29,20 +29,20 @@ The following code example will let the camera orbit around the center of the ca # - axis of rotation # - angular step size. Making it bigger speeds up the rotation # - number of frames - axis=geom.Vec3(0, 1, 0) - step_size=0.01 - num_frames=100 + axis = geom.Vec3(0, 1, 0) + step_size = 0.01 + num_frames = 100 - angle=0.0 + angle = 0.0 for i in range(num_frames): - angle+=step_size - if angle>math.pi*2: - angle-=math.pi*2 - camera=scene.transform - rot=geom.AxisRotation(axis, angle) + angle += step_size + if angle > math.pi*2: + angle -= math.pi*2 + camera = scene.transform + rot = geom.AxisRotation(axis, angle) camera.SetRot(rot) camera.SetTrans(geom.Vec3(25.0, 0.0, -50)) - scene.transform=camera + scene.transform = camera scene.Export('frame-%03d.png' % i, 500, 500) It is interesting to note that the offset from center (`trans`) is given in rotated coordinates. Transforming along z shifts the camera along the viewing direction. Setting x and y to non-zero causes the center of the camera not to be projected onto the center of the screen any longer. For example, setting the value `trans` to `geom.Vec3(50, 0, 0)` gives a viewing direction perpendicular to the vector from the camera position to the center. @@ -157,7 +157,7 @@ It is interesting to note that the offset from center (`trans`) is given in rota :param filename: The output filename :type filename: str :param width: The width of the image. Defaults to the width of the - OpenGL window + OpenGL window. :type width: int :param height: The height of the image. Defaults to the height of the OpenGL window. @@ -217,7 +217,7 @@ It is interesting to note that the offset from center (`trans`) is given in rota .. method:: RemoveAll() - Remove all objects from the scene + Remove all objects from the scene. .. method:: RenderGL() @@ -241,9 +241,6 @@ It is interesting to note that the offset from center (`trans`) is given in rota .. method:: SetBackground(color) See :attr:`background` - - :param color: - :type color: :class:`Color` .. method:: SetBlur(arg2) @@ -254,9 +251,6 @@ It is interesting to note that the offset from center (`trans`) is given in rota See :attr:`fov`. - :param angle: - :type angle: float - .. method:: SetFog(arg2) :param arg2: @@ -347,4 +341,4 @@ It is interesting to note that the offset from center (`trans`) is given in rota :param mode: :type mode: int - \ No newline at end of file + diff --git a/modules/io/doc/image_formats.rst b/modules/io/doc/image_formats.rst index 0764bb573..ce7cea06f 100644 --- a/modules/io/doc/image_formats.rst +++ b/modules/io/doc/image_formats.rst @@ -4,16 +4,16 @@ Supported Image File Formats CCP4 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Format used by the ccp4 software package +Format used by the ccp4 software package. -* Recognized file extensions: *ccp4, map* +* Recognized file extensions: *.ccp4, .map* * Recognized based on content: *yes* * File import: *yes* * File export: *yes* .. class:: ost.io.CCP4(normalize_on_save=false, endianess_on_save=OST_LOCAL_ENDIAN) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: bool :param endianess_on_save: Byte order for saving. :type endianess_on_save: ost.io.Endianess @@ -22,20 +22,20 @@ Format used by the ccp4 software package DAT ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Simple binary format for square images +Simple binary format for square images. -* Recognized file extensions: *dat, img* +* Recognized file extensions: *.dat, .img* * Recognized based on content: *no* * File import: *yes* * File export: *yes* .. class:: ost.io.DAT(normalize_on_save=false, format=OST_DEFAULT_FORMAT, signed=false, endianess=OST_LOCAL_ENDIAN) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: bool :param format: Data format for loading and saving. :type format: ost.io.Format - :param signed: Determines wether data is interpreted as signed or unsigned values during loading and saving. + :param signed: Determines whether data is interpreted as signed or unsigned values during loading and saving. :type signed: bool :param endianess: Byte order for loading and saving. :type endianess: ost.io.Endianess @@ -43,25 +43,25 @@ Simple binary format for square images DF3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -PovRay Density file format +PovRay Density file format. -* Recognized file extensions: *df3* +* Recognized file extensions: *.df3* * Recognized based on content: *no* * File import: *no* * File export: *yes* .. class:: ost.io.DF3(normalize_on_save=false) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: bool DM3 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Format used by Gatan Inc.'s Digital Micrograph software +Format used by Gatan Inc.'s Digital Micrograph software. -* Recognized file extensions: *dm3* +* Recognized file extensions: *.dm3* * Recognized based on content: *yes* * File import: *yes* * File export: *no* @@ -71,32 +71,32 @@ Format used by Gatan Inc.'s Digital Micrograph software DX ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Format used by the OpenDX software package +Format used by the OpenDX software package. -* Recognized file extensions: *dx* +* Recognized file extensions: *.dx* * Recognized based on content: *no* * File import: *yes* * File export: *yes* .. class:: ost.io.DX(normalize_on_save=false) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: bool IPL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Ditabis Micron Image Plate Scanner Format +Ditabis Micron Image Plate Scanner Format. -* Recognized file extensions: *ipl* +* Recognized file extensions: *.ipl* * Recognized based on content: *yes* * File import: *yes* * File export: *yes* .. class:: ost.io.IPL(normalize_on_save=false, format=OST_DEFAULT_FORMAT) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: bool :param format: Data format for loading and saving. :type format: ost.io.Format @@ -104,9 +104,9 @@ Ditabis Micron Image Plate Scanner Format JPK ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Format used by JPK Instruments AG's software (Customized Tiff format) +Format used by JPK Instruments AG's software (Customized Tiff format). -* Recognized file extensions: *jpk* +* Recognized file extensions: *.jpk* * Recognized based on content: *no (jpk files without file extension are recognized as tif)* * File import: *yes* * File export: *yes* @@ -115,13 +115,13 @@ Format used by JPK Instruments AG's software (Customized Tiff format) .. class:: ost.io.JPK(normalize_on_save=indeterminate, format=OST_DEFAULT_FORMAT, signed=false, phasecolor=false, subimage=-1) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: tribool :param format: Data format for loading and saving. :type format: ost.io.Format - :param signed: Determines wether data is interpreted as signed or unsigned values during loading and saving. + :param signed: Determines whether data is interpreted as signed or unsigned values during loading and saving. :type signed: bool - :param phasecolor: Determines wether the phases of complex values are encoded as color information. + :param phasecolor: Determines whether the phases of complex values are encoded as color information. :type phasecolor: bool :param subimage: Determines which subimage is read from a multi-image jpk (-1 = default image). :type subimage: int @@ -129,18 +129,18 @@ Format used by JPK Instruments AG's software (Customized Tiff format) MRC ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Format used by the MRC software package +Format used by the MRC software package. -* Recognized file extensions: *mrc* +* Recognized file extensions: *.mrc* * Recognized based on content: *yes* * File import: *yes* * File export: *yes* .. class:: ost.io.MRC(normalize_on_save=false, subformat=MRC_NEW_FORMAT, endianess_on_save=OST_LOCAL_ENDIAN) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: bool - :param subformat: Determines wether old style or new style mrc files should be saved. + :param subformat: Determines whether old style or new style mrc files should be saved. :type subformat: ost.io.Subformat :param endianess_on_save: Byte order for saving. :type endianess_on_save: ost.io.Endianess @@ -154,9 +154,9 @@ Format used by the MRC software package Nanoscope ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Format used by software from Veeco +Format used by software from Veeco. -* Recognized file extensions: *mod* +* Recognized file extensions: *.mod* * Recognized based on content: *no* * File import: *yes* * File export: *yes* @@ -170,46 +170,46 @@ Format used by software from Veeco PNG ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Portable Network Graphic image format +Portable Network Graphic image format. -* Recognized file extensions: *png* +* Recognized file extensions: *.png* * Recognized based on content: *yes* * File import: *yes* * File export: *yes* .. class:: ost.io.PNG(normalize_on_save=false) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: bool Situs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Format used by the Situs software package +Format used by the Situs software package. -* Recognized file extensions: *situs, sit* +* Recognized file extensions: *.situs, .sit* * Recognized based on content: *no* * File import: *yes* * File export: *yes* .. class:: ost.io.Situs(normalize_on_save=false) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: bool Spider ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Format used by the Spider software package +Format used by the Spider software package. -* Recognized file extensions: *spi* +* Recognized file extensions: *.spi* * Recognized based on content: *no* * File import: *yes* * File export: *yes* .. class:: ost.io.Spider(normalize_on_save=false, endianess_on_save=OST_LOCAL_ENDIAN) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: bool :param endianess_on_save: Byte order for saving. :type endianess_on_save: ost.io.Endianess @@ -217,22 +217,22 @@ Format used by the Spider software package TIF ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Tagged Image File Format +Tagged Image File Format. -* Recognized file extensions: *tif, tiff* +* Recognized file extensions: *.tif, .tiff* * Recognized based on content: *yes* * File import: *yes* * File export: *yes* .. class:: ost.io.TIF(normalize_on_save=indeterminate, format=OST_DEFAULT_FORMAT, signed=false, phasecolor=false, subimage=-1) - :param normalize_on_save: Determines wether to renormalize image upon saving. + :param normalize_on_save: Determines whether to renormalize image upon saving. :type normalize_on_save: tribool :param format: Data format for loading and saving. :type format: ost.io.Format - :param signed: Determines wether data is interpreted as signed or unsigned values during loading and saving. + :param signed: Determines whether data is interpreted as signed or unsigned values during loading and saving. :type signed: bool - :param phasecolor: Determines wether the phases of complex values are encoded as color information. + :param phasecolor: Determines whether the phases of complex values are encoded as color information. :type phasecolor: bool :param subimage: Determines which subimage is read from a multi-image tif (-1 = default image). :type subimage: int diff --git a/modules/io/doc/io.rst b/modules/io/doc/io.rst index 1f97001cf..8d6cee550 100644 --- a/modules/io/doc/io.rst +++ b/modules/io/doc/io.rst @@ -13,7 +13,7 @@ .. module:: ost.io :synopsis: Input and output of sequences, alignments, structures, images and density maps. -The io module deals with input and output of :class:`entities +The io module deals with the input and output of :class:`entities <ost.mol.EntityHandle>`, :class:`alignments <ost.seq.AlignmentHandle>`, :class:`sequences <ost.seq.SequenceHandle>`, :class:`images <ost.img.ImageHandle>`. Importers for common file formats containing molecules @@ -29,7 +29,7 @@ Molecular Structures Loading Molecular Structures ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The :mod:`~ost.io` modules offers several ways to load molecular structures +The :mod:`~ost.io` modules offer several ways to load molecular structures depending on your requirements. The most general way is offered by :func:`~ost.io.LoadEntity`, which will automatically detect the file format based on the file extension. @@ -37,33 +37,32 @@ on the file extension. .. function:: LoadEntity(filename, format='auto') Load entity from disk. If format is set to 'auto', the function guesses the - filetype based on the extension of the file. Files ending in '.pdb', '.ent', - '.ent.gz', '.pdb.gz' will automatically be loaded as PDB files, for example. - For files without or exotic extensions, the format can be set explicitly as - the second parameter. + filetype based on the extension of the file e.g. files ending in '.pdb', '.ent', + '.ent.gz' and '.pdb.gz' will automatically be loaded as PDB files. For files + without or exotic extensions, the format can be set explicitly as the second + parameter. .. code-block:: python - # recognizes SDF file by file extension - ent=io.LoadEntity('file.sdf') + # Recognizes SDF file by file extension + ent = io.LoadEntity('file.sdf') # In this case, there is no file extensions, so you have to say it's a # SDF file explicitly - ent=io.LoadEntity('file', 'sdf') + ent = io.LoadEntity('file', 'sdf') For a list of file formats supported by :func:`LoadEntity`, see :doc:`structure_formats`. :raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied is not recognized or the file format can not be detected based on the - file extension + file extension. :exc:`~ost.io.IOException` if the import fails due to an erroneous or - inexistent file + inexistent file. Some of the formats have a dedicated function that allows you to tweak many parameters that affect the import. PDB files can be loaded with -:func:`~ost.io.LoadPDB`. It offers a tighter control over the exact loading -behaviour. +:func:`~ost.io.LoadPDB`. It offers tighter control over the exact loading behaviour. :doc:`profile` @@ -80,7 +79,7 @@ Saving a complete entity or a view is a matter of calling .. code-block:: python - ent=io.LoadEntity('protein.pdb') + ent = io.LoadEntity('protein.pdb') # save full entity io.SaveEntity(ent, 'full.pdb') # only save C-alpha atoms @@ -92,7 +91,7 @@ file: .. code-block:: python - ent=io.LoadEntity('protein.pdb') + ent = io.LoadEntity('protein.pdb') # Save complete entity io.SavePDB(ent, 'full.pdb') # Save chain A and chain B separately @@ -114,7 +113,7 @@ file: :raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied is not recognized or the file format can not be detected based on the - file extension + file extension. .. autofunction:: ost.io.SavePDB @@ -140,21 +139,21 @@ Loading sequence or alignment files .. code-block:: python # recognizes FASTA file by file extension - myseq=io.LoadSequence('seq.fasta') + myseq = io.LoadSequence('seq.fasta') # for obtaining a SequenceList - seqlist=io.LoadSequenceList('seqs.fasta') + seqlist = io.LoadSequenceList('seqs.fasta') # or for multiple aligned fasta files use - aln=io.LoadAlignment('algnm.aln',format="clustal") + aln = io.LoadAlignment('algnm.aln',format="clustal") For a list of file formats supported by :func:`LoadSequence` see :doc:`sequence_formats`. :raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied is not recognized or the file format can not be detected based on the - file extension + file extension. :exc:`~ost.io.IOException` if the import fails due to an erroneous or - inexistent file + inexistent file. .. function:: LoadSequenceList(filename, format='auto') @@ -191,10 +190,10 @@ Saving Sequence Data :raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied is not recognized or the file format can not be detected based on the - file extension + file extension. :exc:`~ost.io.IOException` if the import fails due to an erroneous or - inexistent file + inexistent file. .. function:: SaveSequenceList(seq_list, filename, format='auto') @@ -220,6 +219,12 @@ Loading Density Maps ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. function:: LoadImage(filename) + + Load density map from disk with the extension being guessed by the function. + + :param filename: The filename + :type filename: string + .. function:: LoadImage(filename, format) Load density map from disk. If no format is given, the function guesses the @@ -232,19 +237,19 @@ Loading Density Maps :raises: :exc:`~ost.io.IOUnknownFormatException` if the format supplied is not recognized or the file format can not be detected based on the - file extension and content + file extension and content. :exc:`~ost.io.IOException` if the import fails due to an erroneous or - inexistent file + inexistent file. .. code-block:: python # recognizes mrc file by file extension - ent=io.LoadImage('file.mrc') + ent = io.LoadImage('file.mrc') - # It is always possible to explicitely set the image format + # it is always possible to explicitely set the image format # DAT file explicitly - ent=io.LoadImage('file', Dat()) + ent = io.LoadImage('file', Dat()) For a list of file formats supported by :func:`LoadImage`, see :doc:`image_formats`. @@ -255,8 +260,11 @@ Saving Density Maps ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. function:: SaveImage(image,filename) -.. function:: SaveImage(image,filename, format) + Save density map to disk with the function guessing the + filetype based on the file extension. + +.. function:: SaveImage(image,filename, format) Save density map to disk. If no format is set, the function guesses the filetype based on the file extension. @@ -275,7 +283,7 @@ Saving Density Maps .. code-block:: python # load density map - image=io.LoadImage('density_map.ccp4') + image = io.LoadImage('density_map.ccp4') # save density map io.SaveImage(image, 'new_map.map', CCP4()) @@ -290,9 +298,9 @@ Saving Density Maps :hide: from ost import io,seq - ent=io.LoadPDB('./examples/entity/fragment.pdb') + ent = io.LoadPDB('./examples/entity/fragment.pdb') print ent.atom_count - myseq=seq.SequenceFromChain('t',ent.chains[0]) + myseq = seq.SequenceFromChain('t',ent.chains[0]) print myseq.GetLength() .. testoutput:: io diff --git a/modules/io/doc/mmcif.rst b/modules/io/doc/mmcif.rst index 09404badf..b8b91c3c8 100644 --- a/modules/io/doc/mmcif.rst +++ b/modules/io/doc/mmcif.rst @@ -37,7 +37,7 @@ The following categories of a mmCIF file are considered by the reader: * ``struct_sheet_range``: Stores secondary structure information for sheets in the :class:`entity <ost.mol.EntityHandle>` * ``pdbx_database_PDB_obs_spr``: Verbose information on obsoleted/ superseded - entries, stored in :class:`MMCifInfoObsolete`. + entries, stored in :class:`MMCifInfoObsolete` * ``struct_ref`` stored in :class:`MMCifInfoStructRef` * ``struct_ref_seq`` stored in :class:`MMCifInfoStructRefSeq` * ``struct_ref_seq_dif`` stored in :class:`MMCifInfoStructRefDif` @@ -46,7 +46,7 @@ The following categories of a mmCIF file are considered by the reader: Info Classes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Information from mmCIF files which goes beyond structural data, is kept in a +Information from mmCIF files that goes beyond structural data, is kept in a special container, the :class:`MMCifInfo` class. Here is a detailed description of the annotation available. @@ -115,11 +115,12 @@ of the annotation available. :param citation: Citation to be added. :type citation: :class:`MMCifInfoCitation` + .. method:: AddAuthorsToCitation(id, authors) Adds a list of authors to a specific citation. - :param id: identifier of the citation + :param id: Identifier of the citation. :type id: :class:`str` :param authors: List of authors. :type authors: :class:`~ost.StringList` @@ -195,7 +196,7 @@ of the annotation available. :type cif_chain_id: :class:`str` :returns: atom_site.auth_asym_id as :class:`str` - .. method:: AddPDBCMMCifhainTr(pdb_chain_id, cif_chain_id) + .. method:: AddPDBCMMCifChainTr(pdb_chain_id, cif_chain_id) Set up a translation for a certain PDB chain name to the mmCIF chain name. @@ -247,7 +248,7 @@ of the annotation available. .. attribute:: cas - Stores a Chemical Abstract Service identifier, if available. If not + Stores a Chemical Abstract Service identifier if available. If not provided, resembles an empty string. Also available as :meth:`GetCAS`. May also be modified by :meth:`SetCas`. @@ -297,7 +298,7 @@ of the annotation available. .. attribute:: doi Stores the Document Object Identifier as used by doi.org for a cited - document. If not provided, resembles a empty strings. + document. If not provided, resembles an empty string. Also available as :meth:`GetDOI`. May also be modified by :meth:`SetDOI`. @@ -515,7 +516,7 @@ of the annotation available. Also available as :meth:`GetChainList`. May also be modified by :meth:`AddChain` or :meth:`SetChainList`. - .. attribute:: chainintervalls + .. attribute:: chainintervals List of intervals on the chain list. Needed if there a several sets of chains and transformations to create the bio unit. Comes as a list of @@ -613,10 +614,10 @@ of the annotation available. - Each polymer gets its own chain, named A-Z 0-9 a-z. - The description of non-polymer chains will be put into a generic string property called description on the residue level. - - ligands which resemble a polymer but have less than min_polymer_size + - Ligands that resemble a polymer but have less than *min_polymer_size* residues are assigned the same numeric residue number. The residues are distinguished by insertion code. - - sometimes bio units exceed the coordinate system storable in a PDB file. + - Sometimes bio units exceed the coordinate system storable in a PDB file. In that case, the box around the entity will be aligned to the lower left corner of the coordinate system. @@ -660,7 +661,7 @@ of the annotation available. .. attribute:: casp_flag - Tells whether this structure was target in some competition. + Tells whether this structure was a target in some competition. Also available as :meth:`GetCASPFlag`. May also be modified by :meth:`SetCASPFlag`. @@ -696,7 +697,7 @@ of the annotation available. .. attribute:: model_type_details - Details about how the type of the structure. + Details about how the type of the structure was determined. Also available as :meth:`GetModelTypeDetails`. May also be modified by :meth:`SetModelTypeDetails`. @@ -834,7 +835,7 @@ of the annotation available. Holds the information of the struct_ref category. The category describes the link of polymers in the mmCIF file to sequences stored in external databases - such as uniprot. The related categories ``struct_ref_seq`` and + such as UniProt. The related categories ``struct_ref_seq`` and ``struct_ref_seq_dif`` also list differences between the sequences of the deposited structure and the sequences in the database. Two prominent examples of such differences are point mutations and/or expression tags. @@ -842,7 +843,7 @@ of the annotation available. .. attribute:: db_name - Name of the external database, for example UNP for uniprot. + Name of the external database, for example UNP for UniProt. :type: :class:`str` @@ -939,7 +940,7 @@ of the annotation available. .. attribute:: first_release Index + 1 of the revision releasing this entry. If the value is 0, was not - set, yet. + set yet. :type: :class:`int` diff --git a/modules/io/doc/profile.rst b/modules/io/doc/profile.rst index 82edfa484..873050330 100644 --- a/modules/io/doc/profile.rst +++ b/modules/io/doc/profile.rst @@ -18,15 +18,15 @@ parameter can either be the name of a profile or an instance of .. code-block:: python - ent=io.LoadPDB('weird.pdb', profile=io.profiles['SLOPPY']) - ent=io.LoadPDB('weird.pdb', profile='SLOPPY') + ent = io.LoadPDB('weird.pdb', profile=io.profiles['SLOPPY']) + ent = io.LoadPDB('weird.pdb', profile='SLOPPY') Profiles is a dictionary-like object containing all the profiles known to OpenStructure. You can add new ones by inserting them into the dictionary. If you are loading a lot of structures, you may want to set the default profile to avoid having to pass the profile every time you load a structure. This is done by assigning a different profile to ``DEFAULT``: .. code-block:: python io.profiles['DEFAULT']='SLOPPY' - ent=io.LoadPDB('weird.pdb') + ent = io.LoadPDB('weird.pdb') Again, you can either assign the name of the profile, or the profile itself. If none of the profiles available by default suits your needs, feel free to create one to your liking. @@ -82,9 +82,9 @@ The IOProfile Class Read/write property. When quack_mode is enabled, the chemical class for unknown residues is guessed based on its atoms and connectivity. Turn this - on, if you are working with non-standard conforming PDB files and are + on if you are working with non-standard conforming PDB files and are experiencing problems with the rendering of the backbone trace and/or see - peptidic residues with unknown chemical class. + peptidic residues with unknown chemical classes. .. attribute:: dialect @@ -100,9 +100,9 @@ The IOProfile Class :type: bool - Whether hydrogen names should be strictly checked. It is very common for + Whether hydrogen names should be strictly checked. It is very common for PDB files to not follow the correct naming conventions for hydrogen atoms. - That's why by default, the names of the hydrogens are not required to be + That's why by default the names of the hydrogens are not required to be correct. Rather, the connectivity is inferred with distance-based checks. By turning this flag on, the names of the hydrogen atoms are checked against the names in the database like all other atom types. @@ -117,7 +117,7 @@ The IOProfile Class If true, the import will succeed, even if the PDB contains faulty records. The faulty records will be ignored and import continues as if the records - haven't been present. + are not present. .. attribute:: join_spread_atom_records @@ -126,9 +126,9 @@ The IOProfile Class .. attribute:: calpha_only - When set to true, forces the importers to only load atoms named CA. This is - most useful in combination with protein-only PDB files to speed up subsequent - processing and importing. + When set to true, forces the importer to only load atoms named CA. This is + most useful in combination with protein-only PDB files to speed up + subsequent processing and importing. .. attribute:: bond_feasibility_check diff --git a/modules/io/doc/sequence_formats.rst b/modules/io/doc/sequence_formats.rst index 63f01ffc9..f9f77649a 100644 --- a/modules/io/doc/sequence_formats.rst +++ b/modules/io/doc/sequence_formats.rst @@ -5,7 +5,7 @@ FASTA ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ *Recognized File Extensions* - fasta, fna, fas, fa, fsa + .fasta, .fna, .fas, .fa, .fsa *Format Name* fasta @@ -14,7 +14,7 @@ ClustalW ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ *Recognized File Extensions* - aln + .aln *Format Name* clustal @@ -23,7 +23,7 @@ Promod ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ *Recognized File Extensions* - ali + .ali *Format Name* promod diff --git a/modules/io/doc/structure_formats.rst b/modules/io/doc/structure_formats.rst index 46ceadba3..ce9c8aedd 100644 --- a/modules/io/doc/structure_formats.rst +++ b/modules/io/doc/structure_formats.rst @@ -1,7 +1,7 @@ Supported Structure File Formats ================================================================================ -The following file formats are supported by :func:`~ost.io.LoadEntity`. +The following file formats are supported by :func:`~ost.io.LoadEntity`: @@ -10,7 +10,7 @@ CRD - CARD format file used by CHARMM This trajectory file format is used by the CHARMM program suite (Molecular Modelling). *Recognized File Extensions* - crd + .crd PDB - Brookhaven PDB File ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ Fine grained control over PDB file import is available via the files, which are auto-detected by the .gz file extension. *Recognized File Extensions* - ent, pdb, ent.gz, pdb.gz + .ent, .pdb, .ent.gz, .pdb.gz *Format Name* pdb @@ -32,23 +32,26 @@ Fine grained control over mmCIFile import is available via the which are auto-detected by the .gz file extension. *Recognized File Extensions* - cif, cif.gz + .cif, .cif.gz *Format Name* mmcif PQR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +A variant of the PDB format that contains data related to atom charges and +radii. *Recognized File Extensions* - pqr + .pqr *Format Name* pqr SDF - Structured Data File ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Chemical-data file format. *Recognized File Extensions* - sdf + .sdf diff --git a/modules/io/pymod/__init__.py b/modules/io/pymod/__init__.py index 85751e697..267ed2ac7 100644 --- a/modules/io/pymod/__init__.py +++ b/modules/io/pymod/__init__.py @@ -282,8 +282,7 @@ def LoadMMCIF(filename, restrict_chains="", fault_tolerant=None, calpha_only=Non :param info: Whether to return an info container with the other output. Returns a :class:`MMCifInfo` object as last item. - :raises: :exc:`~ost.io.IOException` if the import fails due to an erroneous - or inexistent file + :raises: :exc:`~ost.io.IOException` if the import fails due to an erroneous or non-existent file. """ def _override(val1, val2): if val2!=None: -- GitLab