You are reading the documentation for version 1.6 of OpenStructure. You may also want to read the documentation for:
1.1
1.2
1.3
1.4
1.5
1.7
1.7.1
1.8
1.9
1.10
1.11
2.0
2.1
2.2
devel
|
Raises: |
|
---|
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
LoadPDB()
. It offers tighter control over the exact loading behaviour.
IO Profiles for entity importer
LoadPDB
(filename, restrict_chains='', no_hetatms=None, fault_tolerant=None, load_multi=False, quack_mode=None, join_spread_atom_records=None, calpha_only=None, profile='DEFAULT', remote=False, dialect=None, seqres=False, bond_feasibility_check=None)¶Load PDB file from disk and return one or more entities. Several options allow to customize the exact behaviour of the PDB import. For more information on these options, see IO Profiles for entity importer.
Residues are flagged as ligand if they are mentioned in a HET record.
Parameters: |
|
---|---|
Return type: |
|
Raises: |
|
Saving a complete entity or a view is a matter of calling
SaveEntity()
.
ent = io.LoadEntity('protein.pdb')
# save full entity
io.SaveEntity(ent, 'full.pdb')
# only save C-alpha atoms
io.SaveEntity(ent.Select('aname=CA and peptide=true'), 'calpha.pdb')
SavePDB()
provides a simple way to save several entities into one
file:
ent = io.LoadEntity('protein.pdb')
# Save complete entity
io.SavePDB(ent, 'full.pdb')
# Save chain A and chain B separately
io.SavePDB([ent.Select('cname=A'), ent.Select('cname=B')], 'split.pdb')
SaveEntity
(ent, filename, format='auto')¶Save entity to disk. If format is set to ‘auto’, the function guesses the filetype based on the file extension, otherwise the supplied format is checked against the available export plugins.
Parameters: |
|
---|---|
Raises: |
|
SavePDB
(models, filename, dialect=None, pqr=False, profile='DEFAULT')¶Save entity or list of entities to disk. If a list of entities is supplied the PDB file will be saved as a multi PDB file. Each of the entities is wrapped into a MODEL/ENDMDL pair.
If the atom number exceeds 99999, ‘*‘ is used.
Parameters: |
|
---|
LoadSequence
(filename, format='auto')¶Load sequence data from disk. If format is set to ‘auto’, the function guesses the filetype based on the extension of the file. Files ending in ‘.fasta’, ‘.aln’ will automatically be loaded.
For files with non-standard extensions, the format can be set explicitly specifying the format parameter.
# recognizes FASTA file by file extension
myseq = io.LoadSequence('seq.fasta')
# for obtaining a SequenceList
seqlist = io.LoadSequenceList('seqs.fasta')
# or for multiple aligned fasta files use
aln = io.LoadAlignment('algnm.aln',format="clustal")
For a list of file formats supported by LoadSequence()
see
Supported Sequence File Formats.
Raises: |
|
---|
LoadSequenceList
(filename, format='auto')¶For a description of how to use LoadSequenceList()
please refer to
LoadSequence()
. For a list of file formats supported by
LoadSequenceList()
see Supported Sequence File Formats.
LoadAlignment
(filename, format='auto')¶For a description of how to use LoadAlignment()
please refer to
LoadSequence()
. For a list of file formats supported by
LoadAlignment()
see Supported Sequence File Formats.
LoadSequenceProfile
(filename, format='auto')¶Load sequence profile data from disk. If format is set to ‘auto’, the function guesses the filetype based on the extension of the file. Files ending in ‘.hhm’ (output of HHblits) and ‘.pssm’ (ASCII Table (PSSM) output of PSI-BLAST as generated with blastpgp and flag -Q) will automatically be loaded.
For files with non-standard extensions, the format can be set explicitly specifying the format parameter.
# recognizes hhm file by file extension
myprof = io.LoadSequenceProfile('myhmm.hhm')
# recognizes pssm file by file extension
myprof = io.LoadSequenceProfile('myprof.pssm')
# to override format
myprof = io.LoadSequenceProfile('myfile', format='hhm')
myprof = io.LoadSequenceProfile('myfile', format='pssm')
For a list of file formats supported by LoadSequenceProfile()
see
Supported Sequence Profile File Formats.
Return type: | |
---|---|
Raises: |
|
SaveSequence
(sequence, filename, format='auto')¶Saving sequence data is performed by calling SaveSequence()
.
For files with non-standard extensions, the format can be set explicitly
specifying the ‘format’ parameter.
# recognizes FASTA file by file extension
io.SaveSequence(myseq,'seq.fasta')
# for saving a SequenceList
io.SaveSequenceList(seqlist,'seqlist.fasta')
# or multiple aligned fasta files
io.SaveAlignment(aln,'algnm.aln',format="clustal")
For a list of file formats supported by SaveSequence()
see
Supported Sequence File Formats.
Raises: |
|
---|
SaveSequenceList
(seq_list, filename, format='auto')¶For a desription of how to use SaveSequenceList()
please refer to
SaveSequence()
. For a list of file formats supported by
SaveSequenceList()
see Supported Sequence File Formats.
SaveAlignment
(aln, filename, format='auto')¶For a desription of how to use SaveAlignment()
please refer to
SaveSequence()
.
For a list of file formats supported by SaveAlignment()
see
Supported Sequence File Formats.
LoadImage
(filename)¶Load density map from disk with the extension being guessed by the function.
Parameters: | filename (string) – The filename |
---|
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.
Parameters: |
|
---|---|
Raises: |
|
# recognizes mrc file by file extension
ent = io.LoadImage('file.mrc')
# it is always possible to explicitly set the image format
# DAT file explicitly
ent = io.LoadImage('file', Dat())
For a list of file formats supported by LoadImage()
, see Supported Image File Formats.
SaveImage
(image, filename)¶Save density map to disk with the function guessing the filetype based on the file extension.
SaveImage
(image, filename, format)Save density map to disk. If no format is set, the function guesses the filetype based on the file extension.
Parameters: |
|
---|---|
Raises: |
|
For a list of file formats supported by SaveImage()
, see Supported Image File Formats.
# load density map
image = io.LoadImage('density_map.ccp4')
# save density map
io.SaveImage(image, 'new_map.map', CCP4())
Enter search terms or a module, class or function name.
cadscore
- Compare protein structures by difference between physical contacts
Supported Structure File Formats
io
- Input and Output of Sequences, Structures and Maps