From 5f8b63f75e57db1ee0717a3359122320996fdb47 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Fri, 1 Nov 2024 20:21:13 +0000 Subject: [PATCH] build based on 0f4089f --- dev/.documenter-siteinfo.json | 2 +- dev/auxiliary/index.html | 12 +++--- dev/elements/index.html | 4 +- dev/examples/index.html | 2 +- dev/help/index.html | 70 +++++++++++++++++------------------ dev/index.html | 2 +- dev/installation/index.html | 2 +- dev/readwrite/index.html | 2 +- dev/selections/index.html | 2 +- dev/tools/index.html | 10 ++--- 10 files changed, 54 insertions(+), 54 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 33437a4..15798fb 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-30T18:32:17","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-01T20:21:08","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/auxiliary/index.html b/dev/auxiliary/index.html index 6fff709..e3faf63 100644 --- a/dev/auxiliary/index.html +++ b/dev/auxiliary/index.html @@ -15,7 +15,7 @@ 2-element Vector{String}: "Serine" "Alanine" -source

To obtain a list of the residue names of the protein with three- and one-letter codes, use

julia> using PDBTools
+
source

To obtain a list of the residue names of the protein with three- and one-letter codes, use

julia> using PDBTools
 
 julia> getseq(PDBTools.SMALLPDB)
 3-element Vector{String}:
@@ -68,7 +68,7 @@
 
 julia> distance(coor(ligand),protein)
 2.7775834820937417
-
source

The distance between atoms, or sets of atoms, can be computed with the distance function. This function returns the minimum distance between the atoms of the sets involved. For example:

julia> using PDBTools
+
source

The distance between atoms, or sets of atoms, can be computed with the distance function. This function returns the minimum distance between the atoms of the sets involved. For example:

julia> using PDBTools
 
 julia> model = wget("1BSX");
 
@@ -136,7 +136,7 @@
  [45.823, 80.796, 69.974]
  [47.147, 82.98, 71.413]
  [46.541, 82.639, 72.662]
-
source

Use the coor function:

julia> using PDBTools
+
source

Use the coor function:

julia> using PDBTools
 
 julia> atoms = readPDB(PDBTools.SMALLPDB);
 
@@ -164,7 +164,7 @@
  Minimum atom coordinates: xmin = [-29.301, 57.178, 45.668]
  Maximum atom coordinates: xmax = [47.147, 99.383, 86.886]
  Length in each direction: xlength = [76.448, 42.205, 41.217999999999996]
-
source

Use maxmin(atoms), or maxmin(atoms,"resname CA"), for example:

julia> using PDBTools
+
source

Use maxmin(atoms), or maxmin(atoms,"resname CA"), for example:

julia> using PDBTools
 
 julia> atoms = readPDB(PDBTools.SMALLPDB);
 
@@ -188,7 +188,7 @@
 (1:50:201, ["S225", "Q275", "L325", "L375", "L425"])
 
 julia> residue_ticks(collect(eachresidue(atoms)); stride=50) # Vector{Residue} as input
-(1:50:201, ["S225", "Q275", "L325", "L375", "L425"])

The resulting tuple of residue numbers and labels can be used as xticks in Plots.plot, for example.

source

The residue_ticks function provides a practical way to define tick labels in plots associated to an amino-acid sequence:

residue_ticks(
+(1:50:201, ["S225", "Q275", "L325", "L375", "L425"])

The resulting tuple of residue numbers and labels can be used as xticks in Plots.plot, for example.

source

The residue_ticks function provides a practical way to define tick labels in plots associated to an amino-acid sequence:

residue_ticks(
     atoms (or) residues (or) residue iterator; 
     first=nothing, last=nothing, stride=1, oneletter=true, serial=false,
 )

The input structure can be provided as a vector of atoms (type Vector{Atom}) a residue iterator (obtained by eachresidue(atoms)) or a vector of residues (obtained by collect(eachresidue(atoms))).

The function returns a tuple with residue numbers and residue names for the given atoms, to be used as tick labels in plots.

first and last optional keyword parameters are integers that refer to the residue numbers to be included. The stride option can be used to skip residues and declutter the tick labels.

If oneletter is false, three-letter residue codes are returned. Residues with unknown names will be named X or XXX.

if serial=false the positions of the ticks will be returned as a the serial residue index in the structure. If serial=true the positions of the ticks are returned as their residue numbers. This difference is important if the residue numbers do not start at 1 and depending on the indexing of the data to be plotted.

Compat

The functionality of the residue_ticks as described requires PDBTools version 1.6.0 or greater.

The serial option was introduced in v1.8.1

Example

Here we illustrate how to plot the average temperature factor of each residue of a crystallographic model as function of the residues.

julia> using PDBTools, Plots
@@ -210,4 +210,4 @@
 ([1, 11, 21, 31, 41, 51, 61, 71], ["M1", "K11", "D21", "Q31", "Q41", "E51", "I61", "L71"])
 
 julia> residue_ticks(collect(eachresidue(atoms)); stride=10)
-([1, 11, 21, 31, 41, 51, 61, 71], ["M1", "K11", "D21", "Q31", "Q41", "E51", "I61", "L71"])
+([1, 11, 21, 31, 41, 51, 61, 71], ["M1", "K11", "D21", "Q31", "Q41", "E51", "I61", "L71"])
diff --git a/dev/elements/index.html b/dev/elements/index.html index c7aaa0f..e732081 100644 --- a/dev/elements/index.html +++ b/dev/elements/index.html @@ -68,7 +68,7 @@ julia> mass(atoms) 26.017699999999998 -julia> remove_custom_elements!();

Here we repeteadly call remove_custom_elements!() to guarantee the proper execution of the test codes, without any custom elements predefined.

source
PDBTools.remove_custom_elements!Function
remove_custom_elements!()

Remove all custom elements from the elements dictionary.

Example

julia> using PDBTools
+julia> remove_custom_elements!(); 

Here we repeteadly call remove_custom_elements!() to guarantee the proper execution of the test codes, without any custom elements predefined.

source
PDBTools.remove_custom_elements!Function
remove_custom_elements!()

Remove all custom elements from the elements dictionary.

Example

julia> using PDBTools
 
 julia> remove_custom_elements!();
 
@@ -81,4 +81,4 @@
 julia> remove_custom_elements!();
 
 julia> element(Atom(name="GN")) # returns `nothing`
-

Here we repeteadly call remove_custom_elements!() to guarantee the proper execution of the test codes, without any custom elements predefined.

source
+

Here we repeteadly call remove_custom_elements!() to guarantee the proper execution of the test codes, without any custom elements predefined.

source diff --git a/dev/examples/index.html b/dev/examples/index.html index 3c29b0e..de9e264 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -46,4 +46,4 @@ 0.17811534472805368 ⋮ 0.8254040639975442 - 0.6153943592336552 + 0.6153943592336552 diff --git a/dev/help/index.html b/dev/help/index.html index 105e68f..6a593ea 100644 --- a/dev/help/index.html +++ b/dev/help/index.html @@ -77,7 +77,7 @@ 0 julia> custom_field(atom, :index) -1source
PDBTools.ResidueType
Residue(atoms::AbstractVector{Atom}, range::UnitRange{Int})

Residue data structure. It contains two fields: atoms which is a vector of Atom elements, and range, which indicates which atoms of the atoms vector compose the residue.

The Residue structure carries the properties of the residue or molecule of the atoms it contains, but it does not copy the original vector of atoms, only the residue meta data for each residue.

Example

julia> pdb = wget("1LBD");
+1
source
PDBTools.ResidueType
Residue(atoms::AbstractVector{Atom}, range::UnitRange{Int})

Residue data structure. It contains two fields: atoms which is a vector of Atom elements, and range, which indicates which atoms of the atoms vector compose the residue.

The Residue structure carries the properties of the residue or molecule of the atoms it contains, but it does not copy the original vector of atoms, only the residue meta data for each residue.

Example

julia> pdb = wget("1LBD");
 
 julia> residues = collect(eachresidue(pdb))
    Array{Residue,1} with 238 residues.
@@ -93,7 +93,7 @@
 
 julia> residues[8].range
 52:58
-
source
PDBTools.SelectType
Select

This structure acts a function when used within typical julia filtering functions, by converting a string selection into a call to query call.

Example

Using a string to select the CA atoms of the first residue:

julia> using PDBTools
+
source
PDBTools.SelectType
Select

This structure acts a function when used within typical julia filtering functions, by converting a string selection into a call to query call.

Example

Using a string to select the CA atoms of the first residue:

julia> using PDBTools
 
 julia> atoms = readPDB(PDBTools.TESTPDB, "protein");
 
@@ -104,7 +104,7 @@
    Array{Atoms,1} with 1 atoms with fields:
    index name resname chain   resnum  residue        x        y        z occup  beta model segname index_pdb
        5   CA     ALA     A        1        1   -8.483  -14.912   -6.726  1.00  0.00     1    PROT         5
-
source
PDBTools.SequenceType
Sequence

Wrapper for strings, or vectors of chars, strings, or residue names, to dispatch on functions that operate on amino acid sequences.

Example

julia> seq = ["Alanine", "Glutamic acid", "Glycine"];
+
source
PDBTools.SequenceType
Sequence

Wrapper for strings, or vectors of chars, strings, or residue names, to dispatch on functions that operate on amino acid sequences.

Example

julia> seq = ["Alanine", "Glutamic acid", "Glycine"];
 
 julia> mass(Sequence(seq))
 257.2432
@@ -112,12 +112,12 @@
 julia> seq = "AEG";
 
 julia> mass(Sequence(seq))
-257.2432
source
AtomsBase.atomic_numberMethod
atomic_number(atom::Atom)

Returns the atomic number of an atom from its Atom structure.

Example

julia> using PDBTools
+257.2432
source
AtomsBase.atomic_numberMethod
atomic_number(atom::Atom)

Returns the atomic number of an atom from its Atom structure.

Example

julia> using PDBTools
 
 julia> at = Atom(name="NT3");
 
 julia> atomic_number(at)
-7
source
PDBTools._closestMethod
closest(x,y)

Computes the minimum distance between two sets of atoms and returns the indices of the atoms and their distance. Both vector of atoms or vectors of coordinates can be used as input.

Examples

julia> model = wget("1BSX");
+7
source
PDBTools._closestMethod
closest(x,y)

Computes the minimum distance between two sets of atoms and returns the indices of the atoms and their distance. Both vector of atoms or vectors of coordinates can be used as input.

Examples

julia> model = wget("1BSX");
 
 julia> protein = select(model,"protein");
 
@@ -142,7 +142,7 @@
 
 julia> closest(ligand,x)
 (43, 3684, 2.7775834820937417)
-
source
PDBTools.add_element!Method
add_element!(symbol::String, reference_element::PDBTools.Element; elements=PDBTools.elements)

Add a new element to the elements dictionary. If the element already exists, overwrite it.

To remove all custom elements, use remove_custom_elements!().

Example

julia> using PDBTools
+
source
PDBTools.add_element!Method
add_element!(symbol::String, reference_element::PDBTools.Element; elements=PDBTools.elements)

Add a new element to the elements dictionary. If the element already exists, overwrite it.

To remove all custom elements, use remove_custom_elements!().

Example

julia> using PDBTools
 
 julia> remove_custom_elements!(); # if any
 
@@ -163,7 +163,7 @@
 julia> mass(atoms)
 26.017699999999998
 
-julia> remove_custom_elements!(); 

Here we repeteadly call remove_custom_elements!() to guarantee the proper execution of the test codes, without any custom elements predefined.

source
PDBTools.add_hydrogens!Method
add_hydrogens!(atoms::AbstractVector{Atom}; pH=7.0, obabel="obabel", debug=false)

Add hydrogens to a PDB file using Open Babel.

Arguments

  • atoms::AbstractVector{Atom}: structure (usually PDB file of a protein) to add hydrogens to.
  • pH: the pH of the solution. Default is 7.0.
  • obabel: path to the obabel executable. Default is "obabel".
  • debug: if true, print the output message from obabel. Default is false.
Note

This function requires the installation of OpenBabel. Please cite the corresponding reference if using it.

Example

julia> using PDBTools
+julia> remove_custom_elements!(); 

Here we repeteadly call remove_custom_elements!() to guarantee the proper execution of the test codes, without any custom elements predefined.

source
PDBTools.add_hydrogens!Method
add_hydrogens!(atoms::AbstractVector{Atom}; pH=7.0, obabel="obabel", debug=false)

Add hydrogens to a PDB file using Open Babel.

Arguments

  • atoms::AbstractVector{Atom}: structure (usually PDB file of a protein) to add hydrogens to.
  • pH: the pH of the solution. Default is 7.0.
  • obabel: path to the obabel executable. Default is "obabel".
  • debug: if true, print the output message from obabel. Default is false.
Note

This function requires the installation of OpenBabel. Please cite the corresponding reference if using it.

Example

julia> using PDBTools
 
 julia> atoms = readPDB(PDBTools.TESTPDB, "protein and not element H");
 
@@ -176,7 +176,7 @@
                                                        ⋮ 
     1457    H     THR     A      104      208    5.886  -10.722   -7.797  1.00  0.00     1       -      1457
     1458    H     THR     A      104      208    5.871  -10.612   -9.541  1.00  0.00     1       -      1458
-    1459    H     THR     A      104      208    6.423  -12.076   -8.762  1.00  0.00     1       -      1459
source
PDBTools.add_protein_residue!Method
add_protein_residue!(resname::String, reference_residue::PDBTools.ProteinResidue)

Function to add a custom protein residue to the list of protein residues. The function will return the ProteinResidue object that was added. To remove all custom protein residues use remove_custom_protein_residues!().

Example

julia> using PDBTools
+    1459    H     THR     A      104      208    6.423  -12.076   -8.762  1.00  0.00     1       -      1459
source
PDBTools.add_protein_residue!Method
add_protein_residue!(resname::String, reference_residue::PDBTools.ProteinResidue)

Function to add a custom protein residue to the list of protein residues. The function will return the ProteinResidue object that was added. To remove all custom protein residues use remove_custom_protein_residues!().

Example

julia> using PDBTools
 
 julia> remove_custom_protein_residues!();
 
@@ -186,7 +186,7 @@
 julia> isprotein(Atom(resname="sA"))
 true
 
-julia> remove_custom_protein_residues!(); # clean up

Here we repeteadly call remove_custom_residues!() to guarantee the proper execution of the test codes, without any custom residues in the list of protein residues.

source
PDBTools.center_of_massMethod
center_of_mass(atoms::AbstractVector{<:Atom})

Calculate the center of mass of the atoms.

Example

julia> using PDBTools
+julia> remove_custom_protein_residues!(); # clean up

Here we repeteadly call remove_custom_residues!() to guarantee the proper execution of the test codes, without any custom residues in the list of protein residues.

source
PDBTools.center_of_massMethod
center_of_mass(atoms::AbstractVector{<:Atom})

Calculate the center of mass of the atoms.

Example

julia> using PDBTools
 
 julia> atoms = readPDB(PDBTools.SMALLPDB);
 
@@ -194,7 +194,7 @@
 3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
   -5.584422752942997
  -13.110413157869903
-  -7.139970815730879
source
PDBTools.coorMethod
coor(atoms; selection)

Returns the coordinates of the atoms. The input may be one atom (type Atom), a vector of atoms, or a Residue. The coordinates are returned as a vector of static vectors (from StaticArrays), more specifically as a Vector{SVector{3,Float64}}.

Examples

julia> using PDBTools, StaticArrays 
+  -7.139970815730879
source
PDBTools.coorMethod
coor(atoms; selection)

Returns the coordinates of the atoms. The input may be one atom (type Atom), a vector of atoms, or a Residue. The coordinates are returned as a vector of static vectors (from StaticArrays), more specifically as a Vector{SVector{3,Float64}}.

Examples

julia> using PDBTools, StaticArrays 
 
 julia> protein = wget("1LBD");
 
@@ -235,7 +235,7 @@
  [45.823, 80.796, 69.974]
  [47.147, 82.98, 71.413]
  [46.541, 82.639, 72.662]
-
source
PDBTools.distanceMethod
distance(x,y)

Computes the minimum distance between two sets of atoms, between an atom and a set of atoms, or simply the distance between two atoms. The input may be a vector of Atoms, or the coordinates that are output of the coor function.

Examples

julia> model = wget("1BSX");
+
source
PDBTools.distanceMethod
distance(x,y)

Computes the minimum distance between two sets of atoms, between an atom and a set of atoms, or simply the distance between two atoms. The input may be a vector of Atoms, or the coordinates that are output of the coor function.

Examples

julia> model = wget("1BSX");
 
 julia> protein = select(model,"protein");
 
@@ -249,7 +249,7 @@
 
 julia> distance(coor(ligand),protein)
 2.7775834820937417
-
source
PDBTools.eachresidueMethod
eachresidue(atoms::AbstractVector{Atom})

Iterator for the residues (or molecules) of a selection.

Example

julia> atoms = wget("1LBD");
+
source
PDBTools.eachresidueMethod
eachresidue(atoms::AbstractVector{Atom})

Iterator for the residues (or molecules) of a selection.

Example

julia> atoms = wget("1LBD");
 
 julia> length(eachresidue(atoms))
 238
@@ -272,27 +272,27 @@
        8   CA     ALA     A      226        2   43.020   80.825   70.455 63.69  1.00     1       -         8
        9    C     ALA     A      226        2   41.996   80.878   69.340 59.69  1.00     1       -         9
                                                       ...
-
source
PDBTools.edit!Method
edit!(atoms::Vector{Atom})

Opens a temporary PDB file in which the fields of the vector of atoms can be edited.

source
PDBTools.elementMethod
element(atom::Atom)

Returns the element symbol, as a string, of an atom given the Atom structure. If the pdb_element is empty or "X", the element is inferred from the atom name. Othwerwise, the pdb_element is returned.

Example

julia> using PDBTools
+
source
PDBTools.edit!Method
edit!(atoms::Vector{Atom})

Opens a temporary PDB file in which the fields of the vector of atoms can be edited.

source
PDBTools.elementMethod
element(atom::Atom)

Returns the element symbol, as a string, of an atom given the Atom structure. If the pdb_element is empty or "X", the element is inferred from the atom name. Othwerwise, the pdb_element is returned.

Example

julia> using PDBTools
 
 julia> at = Atom(name="NT3");
 
 julia> element(at)
-"N"
source
PDBTools.element_nameMethod
element_name(atom::Atom)

Returns the element name of an atom given its name, or Atom structure.

Example

julia> using PDBTools
+"N"
source
PDBTools.element_nameMethod
element_name(atom::Atom)

Returns the element name of an atom given its name, or Atom structure.

Example

julia> using PDBTools
 
 julia> at = Atom(name="NT3");
 
 julia> element_name(at)
-"Nitrogen"
source
PDBTools.element_symbolMethod
element_symbol(atom::Atom)

Returns a symbol for element name of an atom given its name, or Atom structure.

Example

julia> using PDBTools 
+"Nitrogen"
source
PDBTools.element_symbolMethod
element_symbol(atom::Atom)

Returns a symbol for element name of an atom given its name, or Atom structure.

Example

julia> using PDBTools 
 
 julia> at = Atom(name="NT3");
 
 julia> element_symbol(at)
-:N
source
PDBTools.element_symbol_stringMethod
element_symbol_string(atom::Atom)

Returns a string with the symbol of the element, given the Atom structure.

Example

julia> using PDBTools 
+:N
source
PDBTools.element_symbol_stringMethod
element_symbol_string(atom::Atom)

Returns a string with the symbol of the element, given the Atom structure.

Example

julia> using PDBTools 
 
 julia> at = Atom(name="NT3");
 
 julia> element_symbol_string(at)
-"N"
source
PDBTools.formulaMethod
formula(atoms::AbstractVector{Atom})

Returns the molecular formula of the current selection.

Example

julia> using PDBTools
+"N"
source
PDBTools.formulaMethod
formula(atoms::AbstractVector{Atom})

Returns the molecular formula of the current selection.

Example

julia> using PDBTools
 
 julia> pdb  = readPDB(PDBTools.TESTPDB, "residue 1"); # testing PDB file
 
@@ -300,7 +300,7 @@
 "ALA"
 
 julia> formula(pdb)
-H₇C₃N₁O₁
source
PDBTools.getseqMethod
getseq(Vector{Atom} or filename; selection, code)

Returns the sequence of aminoacids from the vector of atoms or file name. Selections may be applied. Code defines if the output will be a one-letter, three-letter or full-residue name array.

Example

julia> protein = wget("1LBD");
+H₇C₃N₁O₁
source
PDBTools.getseqMethod
getseq(Vector{Atom} or filename; selection, code)

Returns the sequence of aminoacids from the vector of atoms or file name. Selections may be applied. Code defines if the output will be a one-letter, three-letter or full-residue name array.

Example

julia> protein = wget("1LBD");
 
 julia> getseq(protein,"residue < 3")
 2-element Vector{String}:
@@ -316,7 +316,7 @@
 2-element Vector{String}:
  "Serine"
  "Alanine"
-
source
PDBTools.massMethod
mass(atom::Atom)
+
source
PDBTools.massMethod
mass(atom::Atom)
 mass(atoms::AbstractVector{<:Atoms})

Returns the mass of an atom given its name, or Atom structure, or the total mass of a vector of Atoms.

If a mass is defined as a custom field in the the Atom structure, it is returned. Otherwise, the mass is retrieved from the element mass as inferred from the atom name.

Example

julia> using PDBTools
 
 julia> atoms = [ Atom(name="NT3"), Atom(name="CA") ];
@@ -325,7 +325,7 @@
 14.0067
 
 julia> mass(atoms)
-26.017699999999998
source
PDBTools.massMethod
mass(s::Sequence)

Returns the mass of a sequence of amino acids, given a Sequence struct type.

Examples

julia> seq = ["Alanine", "Glutamic acid", "Glycine"];
+26.017699999999998
source
PDBTools.massMethod
mass(s::Sequence)

Returns the mass of a sequence of amino acids, given a Sequence struct type.

Examples

julia> seq = ["Alanine", "Glutamic acid", "Glycine"];
 
 julia> mass(Sequence(seq))
 257.2432
@@ -338,14 +338,14 @@
 julia> seq = ["ALA", "GLU", "GLY"];
 
 julia> mass(Sequence(seq))
-257.2432
source
PDBTools.maxminMethod
maxmin(atoms::Vector{Atom}; selection)

Returns the maximum and minimum coordinates of an atom vector, and the length (maximum minus minimum) in each direction.

Example

julia> protein = wget("1LBD");
+257.2432
source
PDBTools.maxminMethod
maxmin(atoms::Vector{Atom}; selection)

Returns the maximum and minimum coordinates of an atom vector, and the length (maximum minus minimum) in each direction.

Example

julia> protein = wget("1LBD");
 
 julia> maxmin(protein)
  
  Minimum atom coordinates: xmin = [-29.301, 57.178, 45.668]
  Maximum atom coordinates: xmax = [47.147, 99.383, 86.886]
  Length in each direction: xlength = [76.448, 42.205, 41.217999999999996]
-
source
PDBTools.moveto!Method
moveto!(atoms::AbstractVector{<:Atom}; center::AbstractVector{<:Real}=SVector(0.0, 0.0, 0.0))

Move the center of mass of the atoms to the specified center position, which defaults to the origin.

Example

julia> using PDBTools
+
source
PDBTools.moveto!Method
moveto!(atoms::AbstractVector{<:Atom}; center::AbstractVector{<:Real}=SVector(0.0, 0.0, 0.0))

Move the center of mass of the atoms to the specified center position, which defaults to the origin.

Example

julia> using PDBTools
 
 julia> atoms = readPDB(PDBTools.SMALLPDB);
 
@@ -361,12 +361,12 @@
 3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
  1.0
  2.0000000000000036
- 3.0000000000000018
source
PDBTools.oneletterMethod
oneletter(residue::Union{String,Char})

Function to return a one-letter residue code from the three letter code or residue name. The function is case-insensitive.

Examples

julia> oneletter("ALA")
+ 3.0000000000000018
source
PDBTools.oneletterMethod
oneletter(residue::Union{String,Char})

Function to return a one-letter residue code from the three letter code or residue name. The function is case-insensitive.

Examples

julia> oneletter("ALA")
 "A"
 
 julia> oneletter("Glutamic acid")
 "E"
-
source
PDBTools.printatomMethod
printatom(atom::Atom)

Prints an Atom structure in a human-readable format, with a title line.

Example

julia> using PDBTools
+
source
PDBTools.printatomMethod
printatom(atom::Atom)

Prints an Atom structure in a human-readable format, with a title line.

Example

julia> using PDBTools
 
 julia> atoms = readPDB(PDBTools.TESTPDB, "protein and residue 2");
 
@@ -375,7 +375,7 @@
       13    N     CYS     A        2        2   -6.351  -14.461   -5.695  1.00  0.00     1    PROT        13
 
 julia> atoms[1] # default show method
-      13    N     CYS     A        2        2   -6.351  -14.461   -5.695  1.00  0.00     1    PROT        13
source
PDBTools.readPDBFunction
readPDB(pdbfile::String, selection::String)
+      13    N     CYS     A        2        2   -6.351  -14.461   -5.695  1.00  0.00     1    PROT        13
source
PDBTools.readPDBFunction
readPDB(pdbfile::String, selection::String)
 readPDB(pdbfile::String; only::Function = all)
 
 readPDB(pdbdata::IOBuffer, selection::String)
@@ -404,7 +404,7 @@
        2  HT1     ALA     A        1        1  -10.048  -15.427   -5.569  0.00  0.00     1    PROT         2
                                                        ⋮ 
     1339    C     ALA     A       95       95   14.815   -3.057   -5.633  0.00  1.00     1    PROT      1339
-    1340    O     ALA     A       95       95   14.862   -2.204   -6.518  0.00  1.00     1    PROT      1340
source
PDBTools.remove_custom_elements!Function
remove_custom_elements!()

Remove all custom elements from the elements dictionary.

Example

julia> using PDBTools
+    1340    O     ALA     A       95       95   14.862   -2.204   -6.518  0.00  1.00     1    PROT      1340
source
PDBTools.remove_custom_elements!Function
remove_custom_elements!()

Remove all custom elements from the elements dictionary.

Example

julia> using PDBTools
 
 julia> remove_custom_elements!();
 
@@ -417,7 +417,7 @@
 julia> remove_custom_elements!();
 
 julia> element(Atom(name="GN")) # returns `nothing`
-

Here we repeteadly call remove_custom_elements!() to guarantee the proper execution of the test codes, without any custom elements predefined.

source
PDBTools.remove_custom_protein_residues!Method
remove_custom_protein_residues!()

Function to remove all custom protein residues from the list of protein residues.

Example

julia> using PDBTools
+

Here we repeteadly call remove_custom_elements!() to guarantee the proper execution of the test codes, without any custom elements predefined.

source
PDBTools.remove_custom_protein_residues!Method
remove_custom_protein_residues!()

Function to remove all custom protein residues from the list of protein residues.

Example

julia> using PDBTools
 
 julia> remove_custom_protein_residues!(); # clean up
 
@@ -430,7 +430,7 @@
 julia> remove_custom_protein_residues!();
 
 julia> isprotein(Atom(resname="sA"))
-false

Here we repeteadly call remove_custom_residues!() to guarantee the proper execution of the test codes, without any custom residues in the list of protein residues.

source
PDBTools.residue_ticksMethod
residue_ticks(
+false

Here we repeteadly call remove_custom_residues!() to guarantee the proper execution of the test codes, without any custom residues in the list of protein residues.

source
PDBTools.residue_ticksMethod
residue_ticks(
     atoms (or) residues (or) residue iterator; 
     first=nothing, last=nothing, stride=1, oneletter=true, serial=true
 )

Returns a tuple with residue numbers and residue names for the given atoms, to be used as tick labels in plots.

The structure data can be provided a vector of Atoms, a vector of Residues or an EachResidue iterator.

first and last optional keyword parameters are integers that refer to the residue numbers to be included. The stride option can be used to skip residues and declutter the tick labels.

If oneletter is false, three-letter residue codes are returned. Residues with unknown names will be named X or XXX.

If serial=true the sequential residue index will be used as the index of the ticks. If instead serial=false, the positions will be set to the residue numbers.

Examples

julia> using PDBTools
@@ -447,29 +447,29 @@
 (1:50:201, ["S225", "Q275", "L325", "L375", "L425"])
 
 julia> residue_ticks(collect(eachresidue(atoms)); stride=50) # Vector{Residue} as input
-(1:50:201, ["S225", "Q275", "L325", "L375", "L425"])

The resulting tuple of residue numbers and labels can be used as xticks in Plots.plot, for example.

source
PDBTools.residuenameMethod
residuename(residue::Union{String,Char})

Function to return the long residue name from other residue codes. The function is case-insensitive.

Examples

julia> residuename("A")
+(1:50:201, ["S225", "Q275", "L325", "L375", "L425"])

The resulting tuple of residue numbers and labels can be used as xticks in Plots.plot, for example.

source
PDBTools.residuenameMethod
residuename(residue::Union{String,Char})

Function to return the long residue name from other residue codes. The function is case-insensitive.

Examples

julia> residuename("A")
 "Alanine"
 
 julia> residuename("Glu")
 "Glutamic Acid"
-
source
PDBTools.resnameMethod
resname(residue::Union{String,Char})

Returns the residue name, given the one-letter code or residue name. Differently from threeletter, this function will return the force-field name if available in the list of protein residues.

Examples

julia> resname("ALA")
+
source
PDBTools.resnameMethod
resname(residue::Union{String,Char})

Returns the residue name, given the one-letter code or residue name. Differently from threeletter, this function will return the force-field name if available in the list of protein residues.

Examples

julia> resname("ALA")
 "ALA"
 
 julia> resname("GLUP")
-"GLUP"
source
PDBTools.select_with_vmdMethod
select_with_vmd(inputfile::String, selection::String; vmd="vmd", srcload=nothing)
-select_with_vmd(atoms::AbstractVector{<:Atom}, selection::String; vmd="vmd", srcload=nothing)

Select atoms using vmd selection syntax, with vmd in background. The input can be a file or a list of atoms.

Returns a tuple with list of index (one-based) and atom names of the selection.

Function to return the selection from a input file (topology, coordinates, etc), by calling VMD in the background.

The srcload argument can be used to load a list of scripts before loading the input file, for example with macros to define custom selection keywords.

source
PDBTools.stoichiometryMethod
stoichiometry(atoms::AbstractVector{Atom})

Returns the stoichiometry of atom selection in a Formula structure.

Example

julia> using PDBTools
+"GLUP"
source
PDBTools.select_with_vmdMethod
select_with_vmd(inputfile::String, selection::String; vmd="vmd", srcload=nothing)
+select_with_vmd(atoms::AbstractVector{<:Atom}, selection::String; vmd="vmd", srcload=nothing)

Select atoms using vmd selection syntax, with vmd in background. The input can be a file or a list of atoms.

Returns a tuple with list of index (one-based) and atom names of the selection.

Function to return the selection from a input file (topology, coordinates, etc), by calling VMD in the background.

The srcload argument can be used to load a list of scripts before loading the input file, for example with macros to define custom selection keywords.

source
PDBTools.stoichiometryMethod
stoichiometry(atoms::AbstractVector{Atom})

Returns the stoichiometry of atom selection in a Formula structure.

Example

julia> using PDBTools
 
 julia> pdb  = readPDB(PDBTools.TESTPDB, "water"); # testing PDB file
 
 julia> stoichiometry(pdb)
-H₂O₁
source
PDBTools.threeletterMethod
threeletter(residue::String)

Function to return the three-letter natural-amino acid residue code from the one-letter code or residue name. The function is case-insensitive.

Examples

julia> threeletter("A")
+H₂O₁
source
PDBTools.threeletterMethod
threeletter(residue::String)

Function to return the three-letter natural-amino acid residue code from the one-letter code or residue name. The function is case-insensitive.

Examples

julia> threeletter("A")
 "ALA"
 
 julia> threeletter("Aspartic acid")
 "ASP"
 
 julia> threeletter("HSD")
-"HIS"
source
PDBTools.wgetMethod
wget(PDBid; selection)

Retrieves a PDB file from the protein data bank. Selections may be applied.

Example

julia> protein = wget("1LBD","chain A")
+"HIS"
source
PDBTools.wgetMethod
wget(PDBid; selection)

Retrieves a PDB file from the protein data bank. Selections may be applied.

Example

julia> protein = wget("1LBD","chain A")
    Array{Atoms,1} with 1870 atoms with fields:
    index name resname chain   resnum  residue        x        y        z  beta occup model segname index_pdb
        1    N     SER     A      225        1   45.228   84.358   70.638 67.05  1.00     1       -         1
@@ -479,4 +479,4 @@
     1868  OG1     THR     A      462      238  -27.462   74.325   48.885 79.98  1.00     1       -      1868
     1869  CG2     THR     A      462      238  -27.063   71.965   49.222 78.62  1.00     1       -      1869
     1870  OXT     THR     A      462      238  -25.379   71.816   51.613 84.35  1.00     1       -      1870
-
source
PDBTools.writePDBMethod
writePDB(atoms::Vector{Atom}, filename, selection; header=:auto, footer=:auto)

Write a PDB file with the atoms in atoms to filename. The selection argument is a string that can be used to select a subset of the atoms in atoms. For example, writePDB(atoms, "test.pdb", "name CA").

The header and footer arguments can be used to add a header and footer to the PDB file. If header is :auto, then a header will be added with the number of atoms in atoms. If footer is :auto, then a footer will be added with the "END" keyword. Either can be set to nothing if no header or footer is desired.

source
+source
PDBTools.writePDBMethod
writePDB(atoms::Vector{Atom}, filename, selection; header=:auto, footer=:auto)

Write a PDB file with the atoms in atoms to filename. The selection argument is a string that can be used to select a subset of the atoms in atoms. For example, writePDB(atoms, "test.pdb", "name CA").

The header and footer arguments can be used to add a header and footer to the PDB file. If header is :auto, then a header will be added with the number of atoms in atoms. If footer is :auto, then a footer will be added with the "END" keyword. Either can be set to nothing if no header or footer is desired.

source
diff --git a/dev/index.html b/dev/index.html index 9c423db..9aa276c 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,4 +1,4 @@ Home · PDBTools.jl

PDBTools

PDBTools is a simple package to read and write Protein Data Bank files, select atoms, and work with their coordinates.

Features:

Simple data structure:

julia> printatom(atoms[1])
   index name resname chain   resnum  residue        x        y        z  beta occup model segname index_pdb
-      1   OW     SOL     X        1        1   54.370   45.310   33.970  0.00  0.00     1       -         1

Selection syntax:

resname ARG and name CA

Allows use of Julia (possibly user-defined) functions for selection:

atom -> ( atom.resname == "ARG" && atom.x < 10 ) || atom.name == "N"

Not indicated for:

We do not aim to provide the fastest PDB parsing methods. If speed in reading files, returning subsets of the structures, etc., is critical to you, probably you will do better with some packages of BioJulia, BioStructures in particular.

+ 1 OW SOL X 1 1 54.370 45.310 33.970 0.00 0.00 1 - 1

Selection syntax:

resname ARG and name CA

Allows use of Julia (possibly user-defined) functions for selection:

atom -> ( atom.resname == "ARG" && atom.x < 10 ) || atom.name == "N"

Not indicated for:

We do not aim to provide the fastest PDB parsing methods. If speed in reading files, returning subsets of the structures, etc., is critical to you, probably you will do better with some packages of BioJulia, BioStructures in particular.

diff --git a/dev/installation/index.html b/dev/installation/index.html index 4b5fd8a..0233ffc 100644 --- a/dev/installation/index.html +++ b/dev/installation/index.html @@ -1,4 +1,4 @@ Installation · PDBTools.jl

Installation

Install the package using the package manager:

julia> ] add PDBTools
 

and load it with

julia> using PDBTools
-
+ diff --git a/dev/readwrite/index.html b/dev/readwrite/index.html index 6e550d1..67bcf20 100644 --- a/dev/readwrite/index.html +++ b/dev/readwrite/index.html @@ -52,4 +52,4 @@ ⋮ 1425 CA GLU A 102 102 4.414 -4.302 -7.734 1.00 0.00 1 PROT 1425 1440 CA CYS A 103 103 4.134 -7.811 -6.344 1.00 0.00 1 PROT 1440 - 1454 CA THR A 104 104 3.244 -10.715 -8.603 1.00 0.00 1 PROT 1454
Compat

Reading directly from IOBuffer requires PDBTools version 0.15.1 or greater.

+ 1454 CA THR A 104 104 3.244 -10.715 -8.603 1.00 0.00 1 PROT 1454
Compat

Reading directly from IOBuffer requires PDBTools version 0.15.1 or greater.

diff --git a/dev/selections/index.html b/dev/selections/index.html index be2ed12..304633a 100644 --- a/dev/selections/index.html +++ b/dev/selections/index.html @@ -79,4 +79,4 @@ 73.09488999999999

Which, in this simple example, results in the same as:

julia> sum(mass(at) for at in protein if resname(at) == "ALA" )
 73.09488999999999

or

julia> sum(mass(res) for res in eachresidue(protein) if resname(res) == "ALA" )
 73.09488999999999

Using VMD

VMD is a very popular and powerful package for visualization of simulations. It contains a very versatile library to read topologies and trajectory files, and a powerful selection syntax. We provide here a wrapper to VMD which allows using its capabilities.

Compat

The select_with_vmd with all the described cababilities is available in PDBTools v1.0.0 or greater.

For example, the solute can be defined with:

indices, names = select_with_vmd("./system.gro","protein",vmd="/usr/bin/vmd")

The output will contain two lists, one of atom indices (one-based) and atom names. The indices correspond to sequential indices in the input, not the indices written in the PDB file, for example.

The input may also be a vector of atoms of type PDBTools.Atom:

atoms = readPDB("mypdbfile.pdb")
-indices, names = select_with_vmd(atoms,"protein",vmd="/usr/bin/vmd")
Tip

If vmd is available in your path, there is no need to pass it as a keyword parameter.

The main advantage here is that all the file types and the complete selection syntax that VMD supports are supported. But VMD needs to be installed and is run in background, and it takes a few seconds to run.

Loading vmd scripts

The select_with_vmd function also accepts an optional keyword parameter srcload, which can be used to load custom scripts within vmd before running setting the selection. This allows the definition of tcl scripts with custom selection macros, for instance. The usage would be:

sel = select_with_vmd("file.pdb", "resname MYRES"; srcload = [ "mymacros1.tcl", "mymacros2.tcl" ])

Which corresponds to sourceing each of the macro files in VMD before defining the selection with the custom MYRES name.

Warning

VMD uses 0-based indexing and select_with_vmd adjusts that. However, if a selection is performed by index, as with index 1, VMD will select the second atom, and the output will be [2]. Selections by type, name, segment, residue name, etc, will be consistent with one-based indexing.

+indices, names = select_with_vmd(atoms,"protein",vmd="/usr/bin/vmd")
Tip

If vmd is available in your path, there is no need to pass it as a keyword parameter.

The main advantage here is that all the file types and the complete selection syntax that VMD supports are supported. But VMD needs to be installed and is run in background, and it takes a few seconds to run.

Loading vmd scripts

The select_with_vmd function also accepts an optional keyword parameter srcload, which can be used to load custom scripts within vmd before running setting the selection. This allows the definition of tcl scripts with custom selection macros, for instance. The usage would be:

sel = select_with_vmd("file.pdb", "resname MYRES"; srcload = [ "mymacros1.tcl", "mymacros2.tcl" ])

Which corresponds to sourceing each of the macro files in VMD before defining the selection with the custom MYRES name.

Warning

VMD uses 0-based indexing and select_with_vmd adjusts that. However, if a selection is performed by index, as with index 1, VMD will select the second atom, and the output will be [2]. Selections by type, name, segment, residue name, etc, will be consistent with one-based indexing.

diff --git a/dev/tools/index.html b/dev/tools/index.html index 00be07c..42b937c 100644 --- a/dev/tools/index.html +++ b/dev/tools/index.html @@ -12,7 +12,7 @@ ⋮ 1457 H THR A 104 208 5.886 -10.722 -7.797 1.00 0.00 1 - 1457 1458 H THR A 104 208 5.871 -10.612 -9.541 1.00 0.00 1 - 1458 - 1459 H THR A 104 208 6.423 -12.076 -8.762 1.00 0.00 1 - 1459source

Custom protein residue types

Compat

These functions were added in version 1.4.0.

It is possible to add to the list of protein residues, custom residue types. This can be done by simply adding to the PDBTools.protein_residues dictionary of residues a new PDBTools.ProteinResidue entry. For example, here we create a new resiude type NEW with the same properties of an ALA residue. To remove all custom protein residues, use remove_custom_protein_residues!().

julia> using PDBTools
+    1459    H     THR     A      104      208    6.423  -12.076   -8.762  1.00  0.00     1       -      1459
source

Custom protein residue types

Compat

These functions were added in version 1.4.0.

It is possible to add to the list of protein residues, custom residue types. This can be done by simply adding to the PDBTools.protein_residues dictionary of residues a new PDBTools.ProteinResidue entry. For example, here we create a new resiude type NEW with the same properties of an ALA residue. To remove all custom protein residues, use remove_custom_protein_residues!().

julia> using PDBTools
 
 julia> remove_custom_protein_residues!();
 
@@ -34,7 +34,7 @@
 julia> isprotein(Atom(resname="sA"))
 true
 
-julia> remove_custom_protein_residues!(); # clean up

Here we repeteadly call remove_custom_residues!() to guarantee the proper execution of the test codes, without any custom residues in the list of protein residues.

source
PDBTools.remove_custom_protein_residues!Function
remove_custom_protein_residues!()

Function to remove all custom protein residues from the list of protein residues.

Example

julia> using PDBTools
+julia> remove_custom_protein_residues!(); # clean up

Here we repeteadly call remove_custom_residues!() to guarantee the proper execution of the test codes, without any custom residues in the list of protein residues.

source
PDBTools.remove_custom_protein_residues!Function
remove_custom_protein_residues!()

Function to remove all custom protein residues from the list of protein residues.

Example

julia> using PDBTools
 
 julia> remove_custom_protein_residues!(); # clean up
 
@@ -47,7 +47,7 @@
 julia> remove_custom_protein_residues!();
 
 julia> isprotein(Atom(resname="sA"))
-false

Here we repeteadly call remove_custom_residues!() to guarantee the proper execution of the test codes, without any custom residues in the list of protein residues.

source

The SIRAH force-field residues and element types

Conveniencie functions can be created to add sets of new types of residues and atom types to the list of residues and elements. This is illustrated in the custom_types.jl file of the source code, in this case for the residues and atom types of the SIRAH force field for Coarse-Grained protein simulations.

With those definitions, adding all SIRAH protein residue types and element names can be done with:

julia> using PDBTools 
+false

Here we repeteadly call remove_custom_residues!() to guarantee the proper execution of the test codes, without any custom residues in the list of protein residues.

source

The SIRAH force-field residues and element types

Conveniencie functions can be created to add sets of new types of residues and atom types to the list of residues and elements. This is illustrated in the custom_types.jl file of the source code, in this case for the residues and atom types of the SIRAH force field for Coarse-Grained protein simulations.

With those definitions, adding all SIRAH protein residue types and element names can be done with:

julia> using PDBTools 
 
 julia> remove_custom_protein_residues!(); remove_custom_elements!();
 
@@ -94,7 +94,7 @@
 3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
   -5.584422752942997
  -13.110413157869903
-  -7.139970815730879
source
PDBTools.moveto!Function
moveto!(atoms::AbstractVector{<:Atom}; center::AbstractVector{<:Real}=SVector(0.0, 0.0, 0.0))

Move the center of mass of the atoms to the specified center position, which defaults to the origin.

Example

julia> using PDBTools
+  -7.139970815730879
source
PDBTools.moveto!Function
moveto!(atoms::AbstractVector{<:Atom}; center::AbstractVector{<:Real}=SVector(0.0, 0.0, 0.0))

Move the center of mass of the atoms to the specified center position, which defaults to the origin.

Example

julia> using PDBTools
 
 julia> atoms = readPDB(PDBTools.SMALLPDB);
 
@@ -110,4 +110,4 @@
 3-element StaticArraysCore.SVector{3, Float64} with indices SOneTo(3):
  1.0
  2.0000000000000036
- 3.0000000000000018
source
+ 3.0000000000000018source