Skip to content
Snippets Groups Projects
Commit 8196a26e authored by Andreas Schenk's avatar Andreas Schenk
Browse files

added documention for LoadImage/SaveImage and image file formats

parent 3a554be4
No related branches found
No related tags found
No related merge requests found
...@@ -57,6 +57,7 @@ Density Maps and Images ...@@ -57,6 +57,7 @@ Density Maps and Images
**Overview**: :doc:`images intro <intro-02>` | :doc:`img module <img/base/img>` | :doc:`img.alg module <img/alg/alg>` **Overview**: :doc:`images intro <intro-02>` | :doc:`img module <img/base/img>` | :doc:`img.alg module <img/alg/alg>`
**Input/Output**: :ref:`loading and saving density maps <img-io>`
...@@ -93,7 +94,9 @@ Varia ...@@ -93,7 +94,9 @@ Varia
**Datasets:** :doc:`tabular data <table>` **Datasets:** :doc:`tabular data <table>`
**File Formats:** :doc:`supported file formats <io/formats>` **File Formats:** :doc:`supported structure file formats <io/structure_formats>`
**File Formats:** :doc:`supported sequence file formats <io/sequence_formats>`
**File Formats:** :doc:`supported image file formats <io/image_formats>`
Extending OpenStructure Extending OpenStructure
......
Supported File Formats Supported Image File Formats
================================================================================ ================================================================================
Structure File Formats CCP4
--------------------------------------------------------------------------------
The following file formats are supported by :func:`~ost.io.LoadEntity`.
CRD - CARD format file used by CHARMM
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This trajectory file format is used by the CHARMM program suite (Molecular Modelling).
*Recognized File Extensions*
crd
PDB - Brookhaven PDB File
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fine grained control over PDB file import is available via the
:func:`~ost.io.LoadPDB` function. The PDB importer supports loading gzipped PDB
files, which are auto-detected by the .gz file extension.
*Recognized File Extensions*
ent, pdb, ent.gz, pdb.gz
*Format Name*
pdb
PQR
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Format used by the ccp4 software package
pqr
*Format Name* * Recognized file extensions: *ccp4, map*
pqr * Recognized based on content: *yes*
* File import: *yes*
SDF - Structured Data File * File export: *yes*
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions*
sdf
Sequence File Formats
--------------------------------------------------------------------------------
FASTA
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions*
fasta, fna, fas, fa, fsa
*Format Name*
fasta
ClustalW
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions*
aln
*Format Name*
clustal
Promod
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions*
ali
*Format Name*
promod
Image File Formats
--------------------------------------------------------------------------------
DAT DAT
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Simple binary format for square images
dat, img
* Recognized file extensions: *dat, img*
* Recognized based on content: *no*
* File import: *yes*
* File export: *yes*
*Format Name*
Simple binary format for square images
DF3 DF3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* PovRay Density file format
df3
*Format Name* * Recognized file extensions: *df3*
PovRay Density file format * Recognized based on content: *no*
* File import: *no*
* File export: *yes*
DM3 DM3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Format used by Gatan Inc.'s Digital Micrograph software
dm3
*Format Name* * Recognized file extensions: *dm3*
Format used by Gatan Inc.'s Digital Micrograph software * Recognized based on content: *yes*
* File import: *yes*
* File export: *no*
DX DX
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Format used by the OpenDX software package
dx
*Format Name* * Recognized file extensions: *dx*
Format used by the OpenDX software package * Recognized based on content: *no*
* File import: *yes*
* File export: *yes*
IPL IPL
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Ditabis Micron Image Plate Scanner Format
ipl
*Format Name* * Recognized file extensions: *ipl*
Ditabis Micron Image Plate Scanner Format * Recognized based on content: *yes*
* File import: *yes*
* File export: *yes*
JPK JPK
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Format used by JPK Instruments AG's software (Customized Tiff format)
jpk
*Format Name* * Recognized file extensions: *jpk*
Format used by JPK Instruments AG's software (Customized Tiff format) * Recognized based on content: *no (jpk files without file extension are recognized as tif)*
* File import: *yes*
* File export: *yes*
MRC MRC
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Format used by the MRC software package
map, ccp4, mrc
*Format Name* * Recognized file extensions: *mrc*
Format used by the MRC software package * Recognized based on content: *yes*
* File import: *yes*
* File export: *yes*
NanoScope NanoScope
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Format used by software from Veeco
mod
*Format Name* * Recognized file extensions: *mod*
Format used by software from Veeco * Recognized based on content: *no*
* File import: *yes*
* File export: *yes*
PNG PNG
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Portable Network Graphic image format
png
*Format Name* * Recognized file extensions: *png*
Portable Network Graphic image format * Recognized based on content: *yes*
* File import: *yes*
* File export: *yes*
Situs Situs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Format used by the Situs software package
situs, sit
*Format Name* * Recognized file extensions: *situs, sit*
Format used by the Situs software package * Recognized based on content: *no*
* File import: *yes*
* File export: *yes*
SPI Spider
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Format used by the Spider software package
spi
*Format Name* * Recognized file extensions: *spi*
Format used by the Spider software package * Recognized based on content: *no*
* File import: *yes*
* File export: *yes*
TIFF TIFF
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions* Tagged Image File Format
tif, tiff
*Format Name* * Recognized file extensions: *tif, tiff*
Tagged Image File Format * Recognized based on content: *yes*
* File import: *yes*
* File export: *yes*
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
.. toctree:: .. toctree::
:hidden: :hidden:
formats structure_formats
sequence_formats
image_formats
mmcif mmcif
profile profile
...@@ -49,7 +51,7 @@ on the file extension. ...@@ -49,7 +51,7 @@ on the file extension.
# SDF file explicitly # 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:`formats`. For a list of file formats supported by :func:`LoadEntity`, see :doc:`structure_formats`.
:raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied :raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied
is not recognized or the file format can not be detected based on the is not recognized or the file format can not be detected based on the
...@@ -145,7 +147,7 @@ Loading sequence or alignment files ...@@ -145,7 +147,7 @@ Loading sequence or alignment files
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 For a list of file formats supported by :func:`LoadSequence` see
:doc:`formats`. :doc:`sequence_formats`.
:raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied :raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied
is not recognized or the file format can not be detected based on the is not recognized or the file format can not be detected based on the
...@@ -158,13 +160,13 @@ Loading sequence or alignment files ...@@ -158,13 +160,13 @@ Loading sequence or alignment files
For a desription of how to use :func:`LoadSequenceList` please refer to For a desription of how to use :func:`LoadSequenceList` please refer to
:func:`LoadSequence`. For a list of file formats supported by :func:`LoadSequence`. For a list of file formats supported by
:func:`LoadSequenceList` see :doc:`formats`. :func:`LoadSequenceList` see :doc:`sequence_formats`.
.. function:: LoadAlignment(filename, format='auto') .. function:: LoadAlignment(filename, format='auto')
For a desription of how to use :func:`LoadAlignment` please refer to For a desription of how to use :func:`LoadAlignment` please refer to
:func:`LoadSequence`. For a list of file formats supported by :func:`LoadSequence`. For a list of file formats supported by
:func:`LoadAlignment` see :doc:`formats`. :func:`LoadAlignment` see :doc:`sequence_formats`.
Saving Sequence Data Saving Sequence Data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...@@ -185,7 +187,7 @@ Saving Sequence Data ...@@ -185,7 +187,7 @@ Saving Sequence Data
io.SaveAlignment(aln,'algnm.aln',format="clustal") io.SaveAlignment(aln,'algnm.aln',format="clustal")
For a list of file formats supported by :func:`SaveSequence` see For a list of file formats supported by :func:`SaveSequence` see
:doc:`formats`. :doc:`sequence_formats`.
:raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied :raises: :exc:`~ost.io.IOUnknownFormatException` if the format string supplied
is not recognized or the file format can not be detected based on the is not recognized or the file format can not be detected based on the
...@@ -198,7 +200,7 @@ Saving Sequence Data ...@@ -198,7 +200,7 @@ Saving Sequence Data
For a desription of how to use :func:`SaveSequenceList` please refer to For a desription of how to use :func:`SaveSequenceList` please refer to
:func:`SaveSequence`. For a list of file formats supported by :func:`SaveSequence`. For a list of file formats supported by
:func:`SaveSequenceList` see :doc:`formats`. :func:`SaveSequenceList` see :doc:`sequence_formats`.
.. function:: SaveAlignment(aln, filename, format='auto') .. function:: SaveAlignment(aln, filename, format='auto')
...@@ -206,7 +208,79 @@ Saving Sequence Data ...@@ -206,7 +208,79 @@ Saving Sequence Data
:func:`SaveSequence`. :func:`SaveSequence`.
For a list of file formats supported by :func:`SaveAlignment` see For a list of file formats supported by :func:`SaveAlignment` see
:doc:`formats`. :doc:`sequence_formats`.
.. _img-io:
Density Maps
--------------------------------------------------------------------------------
Loading Density Maps
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. function:: LoadImage(filename)
.. function:: LoadImage(filename, format)
Load density map from disk. If no format is given, the function guesses the
filetype based on the extension of the file. If the extension is unknown or not present the
filetype will be guessed based on the content of the file if possible.
:param filename: The filename
:type filename: string
:param format: The file format
: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
:exc:`~ost.io.IOException` if the import fails due to an erroneous or
inexistent file
.. code-block:: python
# recognizes mrc file by file extension
ent=io.LoadImage('file.mrc')
# It is always possible to explicitely set the image format
# DAT file explicitly
ent=io.LoadImage('file', Dat())
For a list of file formats supported by :func:`LoadImage`, see :doc:`image_formats`.
Saving Density Maps
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. function:: SaveImage(image,filename)
.. 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.
:param image: The density map to be saved
:type image: :class:`~ost.img.IMageHandle`
:param filename: The filename
:type filename: string
:param format: The file format
:raises: :exc:`~ost.io.IOUnknownFormatException` if the file format can not be detected based on the
file extension
For a list of file formats supported by :func:`SaveImage`, see :doc:`image_formats`.
.. code-block:: python
# load density map
image=io.LoadImage('density_map.ccp4')
# save density map
io.SaveImage(image, 'new_map.map', CCP4())
.. testsetup:: io .. testsetup:: io
......
Supported Sequence File Formats
================================================================================
FASTA
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions*
fasta, fna, fas, fa, fsa
*Format Name*
fasta
ClustalW
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions*
aln
*Format Name*
clustal
Promod
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions*
ali
*Format Name*
promod
Supported Structure File Formats
================================================================================
The following file formats are supported by :func:`~ost.io.LoadEntity`.
CRD - CARD format file used by CHARMM
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This trajectory file format is used by the CHARMM program suite (Molecular Modelling).
*Recognized File Extensions*
crd
PDB - Brookhaven PDB File
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fine grained control over PDB file import is available via the
:func:`~ost.io.LoadPDB` function. The PDB importer supports loading gzipped PDB
files, which are auto-detected by the .gz file extension.
*Recognized File Extensions*
ent, pdb, ent.gz, pdb.gz
*Format Name*
pdb
PQR
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions*
pqr
*Format Name*
pqr
SDF - Structured Data File
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*Recognized File Extensions*
sdf
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment