Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gp0 committed Mar 31, 2015
1 parent ddfe670 commit 121743f
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 60 deletions.
34 changes: 32 additions & 2 deletions docs/kabsch.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ julia> kabsch_rmsd(P, Q)

## Exported functions

### rmsd

```julia
rmsd(A::Array{Float64,2}, B::Array{Float64,2})
```
Expand All @@ -32,23 +34,44 @@ Calculates the root mean square deviation of two matrices A and B in using the f

![RMSD formula](assets/kabsch/rmsd.png)

**A** a matrix

**B** a matrix

### calc_centroid

```julia
calc_centroid(m::Array{Float64,2})
```

Returns the centroid of a matrix m as a [x y z] vector (An ```Array{Float54,2}```).

**m** a matrix


### translate_points
```julia
translate_points(P::Array{Float64,2}, Q::Array{Float64,2})
```

Translates two matrices P, Q so that their centroids are equal to the origin of the coordinate system.

**P** a matrix

**Q** a matrix

### kabsch

```julia
kabsch(reference::Array{Float64,2},coords::Array{Float64,2})
```

Calculates the optimal rotation matrix of two matrices P, Q.
Calculates the optimal rotation matrix of two matrices P, Q and superimposes the two matrices

**reference** a matrix to superimpose on.

**coords** the matrix to be rotated

Using ```translate_points``` it shifts the matrices' centroids to the origin of the coordinate system, then computes the covariance matrix A:

![Covariance Formula](assets/kabsch/cov.png)
Expand All @@ -69,10 +92,17 @@ The last two steps are translating U so that the superimposed matrix will "fit"

The function returns the superimposed matrix.

### kabsch_rmsd

```julia
kabsch_rmsd(P::Array{Float64,2}, Q::Array{Float64,2})
```
Directly returns the RMSD after rotation for convenience.
Directly returns the RMSD after rotation for
convenience.

**P** reference matrix

**Q** matrix to be rotated

## Background

Expand Down
20 changes: 10 additions & 10 deletions docs/mafft.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ mafft(fasta_in::String, preconfiguration=:default)

Runs mafft with the provided fasta file and returns the alignment in FastaIO dataformat. By default mafft is called with the `--auto` option.

*fasta_in*: path to FASTA file
**fasta_in**: path to FASTA file

*preconfiguration*: optional commandline arguments for MAFFT (array of strings)

Expand All @@ -48,17 +48,17 @@ mafft_from_string(fasta_in::String, preconfiguration=:default)

Calls MAFFT with the given FASTA string as input and returns aligned FASTA in the FastaIO dataformat.

*fasta_in*: FASTA string
**fasta_in**: FASTA string

*preconfiguration*: optional commandline arguments for MAFFT (array of strings)
**preconfiguration**: optional commandline arguments for MAFFT (array of strings)

```julia
mafft_from_fasta(fasta_in, preconfiguration=:default)
```

Calls MAFFT with the given FASTA in FastaIO format

*fasta_in*: FASTA in FastaIO format
**fasta_in**: FASTA in FastaIO format

*preconfiguration*: optional commandline arguments for MAFFT (array of strings)

Expand All @@ -67,22 +67,22 @@ mafft_profile(group1::String, group2::String)
```
Group-to-group alignments

*group1* and *group2* have to be files with alignments. Returns aligned FASTA in the FastaIO dataformat.
**group1** and **group2** have to be files with alignments. Returns aligned FASTA in the FastaIO dataformat.

```julia
mafft_profile_from_string(group1::String, group2::String)
```
Group-to-group alignments with input strings in FASTA format.

*group1* and *group2* have to be strings with alignments in FASTA format.
**group1** and **group2** have to be strings with alignments in FASTA format.

```julia
mafft_profile_from_fasta(group1, group2)
```

Group-to-group alignments with input in FastaIO format

*group1* and *group2* have to be in FastaIO format and have to be alignments
**group1** and **group2** have to be in FastaIO format and have to be alignments

### Helper functions for aligned FASTA
This module also includes a few helper functions for the FastaIO dataformat (which is returned by the mafft functions of this module).
Expand All @@ -92,21 +92,21 @@ alignment_length(fasta)
```
Returns the length of the alignment.

*fasta*: A FastaIO dataformat object
**fasta**: A FastaIO dataformat object

```julia
to_aminoacids(fasta)
```
Converts a FastaIO-formatted array into an array of BioSeq AminoAcid.

*fasta*: A FastaIO dataformat object
**fasta**: A FastaIO dataformat object

```julia
print_fasta(fasta)
```
Prints a FastaIO object in a nicely formatted way to the screen.

*fasta*: A FastaIO dataformat object
**fasta**: A FastaIO dataformat object


## Supported pre-configurations (strategies)
Expand Down
40 changes: 20 additions & 20 deletions docs/modeller.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ gen_modeller_script(name::String)

Generates Julia templates for MODELLER usage with Julia.

*name:* The name of the script (minus the extension). Possible values: "align2d", "build_profile", "compare", "evaluate_model", "model-single", "plot_profiles".
**name:** The name of the script (minus the extension). Possible values: "align2d", "build_profile", "compare", "evaluate_model", "model-single", "plot_profiles".

These scripts are based on the basic example scripts from the [tutorial](https://salilab.org/modeller/tutorial/basic.html) on the MODELLER website.
Scripts are generated in the current working directory. You can find all scripts that can be generated in `src/MODELLER/modeller-basic-example-julia`.
Expand Down Expand Up @@ -51,7 +51,7 @@ compare(pdbs)
```
Prints out a table with the similarities between the given structures and a dendrogram.

*pdbs:* Array of pairs of pdb-files and chains that should be compared.
**pdbs:** Array of pairs of pdb-files and chains that should be compared.

#### align2d

Expand All @@ -61,39 +61,39 @@ align2d(model_file::String, model_segment, model_align_codes::String, atom_files

Aligns a structure model (pdb) with a sequence. Writes the alignment to <outputname>.ali in PIR format and to <outputname>.pap in PAP format.

*model_file:* the file of the structure model
**model_file:** the file of the structure model

*model_segment:* the segment of the model to be used, e.g. ``('FIRST:A','LAST:A')``
**model_segment:** the segment of the model to be used, e.g. ``('FIRST:A','LAST:A')``

*model_align_codes:* the code name of the structure. e.g. "1bdmA" for "1bdm:A"
**model_align_codes:** the code name of the structure. e.g. "1bdmA" for "1bdm:A"

*atom_files:* path to the model pdb file
**atom_files:** path to the model pdb file

*sequence_file:* path to the sequence file
**sequence_file:** path to the sequence file

*sequence_codes:* the code name of the structure, e.g. "TvLDH"
**sequence_codes:** the code name of the structure, e.g. "TvLDH"

*outputname:* name of the files that ``align2d()`` creates.
**outputname:** name of the files that ``align2d()`` creates.

#### model_single

```julia
model_single(alnf::String, known_structure::String, seq::String)
```
*alnf:* path to alignment file
**alnf:** path to alignment file

*known_structure:* path or name of known pdb structure
**known_structure:** path or name of known pdb structure

*seq:* sequence
**seq:** sequence

#### evaluate_model

```julia
evaluate_model(pdbfile::String, outputfile::String = "")
```
*pdbfile:* path to pdb file
**pdbfile:** path to pdb file

*outputfile:* optional path to output file. Defaults to pdbfile+".profile"
**outputfile:** optional path to output file. Defaults to pdbfile+".profile"

#### plot_profiles

Expand All @@ -103,17 +103,17 @@ plot_profiles(alignment_file::String, template_profile::String, template_sequenc

Plots a two profiles with data from a corresponding alignment file (for both structures).

*alignment_file:* path to alignment file
**alignment_file:** path to alignment file

*template_profile:* path to profile that was used as the template
**template_profile:** path to profile that was used as the template

*template_profile:* sequence name from *template_profile* that should be used
**template_profile:** sequence name from *template_profile* that should be used

*model_profile:* path to model profile
**model_profile:** path to model profile

*model_profile:* sequence name from *model_profile* that should be used
**model_profile:** sequence name from *model_profile* that should be used

*plot_file:* (optional) path where created plot should be saved. Default: dope_profile.png
**plot_file:** (optional) path where created plot should be saved. Default: dope_profile.png

## Usage / Usecase
This usecase is again based on the [tutorial](https://salilab.org/modeller/tutorial/basic.html) on the MOELLER website. You should download the corresponding files and call the julia functions with the julia interactive prompt inside the tutorial example folder.
Expand Down
32 changes: 29 additions & 3 deletions docs/pdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,53 @@ The PDB module provides utility functions to deal with [PDB (Protein Data Bank)]

## Exported functions

### get_structure
```julia
get_structure(filename::String)
```

Parses a PDB file and returns a structure PyObject.

*filename* Path/Filename of a PDB file.

### get_chains
```julia
get_chains(structure::PyObject)
```

Gets the chains of protein structure from a BioPython PyObject and returns an Array of Array{Float64,2} matrices.
Gets the chains of a protein structure from a BioPython PyObject and returns an Array of Array{Float64,2} matrices of C<sub>&alpha;</sub> atomic coordinates.

**structure** A protein structure.

### structure_to_matrix
```julia
structure_to_matrix(structure::PyObject)
```

Converts a BioPython structure to a Array{Float64,2} matrix.
Converts a BioPython structure to a Array{Float64,2} matrix of C<sub>&alpha;</sub> atomic coordinates.

**structure** A protein structure

### export_pdb (experimental)

```julia
export_to_pdb(residueName::String,chainID::String,matrix::Array{Float64,2}, filename::String)
```

Exports a matrix of C<sub>&alpha;</sub> atomic coordinates to a PDB File. As of now, it produces files as defined in the [PDB specification](http://deposit.rcsb.org/adit/docs/pdb_atom_format.html) (Section ATOM) with one minor difference: The atom name is right-aligned, because Formatting.jl does not support center-aligning (yet). This isn't in the specification, but [some descriptions](http://cupnet.net/tag/pdb/) include it.

**residueName** residue name to write to the file

**chainID** chain ID (e.g. "A", "B", "C"..)

**matrix** the matrix to export.

**filename** Path/filename to export to.

### get_remote_pdb
```julia
get_remote_pdb(id::String)
```

Downloads and caches a PDB from [rcsb.org](http://www.rcsb.org/)

**id** a PDB ID
8 changes: 7 additions & 1 deletion docs/plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ Provides a utility function to plot two matrices P, Q

## Exported functions

### matrices_plot

```julia
matrices_plot(P::Array{Float64,2},Q::Array{Float64,2})
```

Plots two matrices P, Q. Example output:

![Example output](assets/kabsch/alpha_init.png)
![Example output](assets/kabsch/alpha_init.png)

**P** A matrix

**Q** A matrix
34 changes: 10 additions & 24 deletions docs/webblast.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
# WebBLAST

An API for Julia to call the BLAST Web API of NCBI and EBI.
## Usage
API for Julia to call the BLAST Web API of NCBI and EBI.

```
usage: WebBLAST.jl [-f FASTA FASTA] [-s SEQUENCE] [-t THRESHOLD] [-h]
fasta_out
WebBLAST
## Exported functions

positional arguments:
fasta_out FASTA output file
optional arguments:
-f, --fasta FASTA FASTA
Sequences in FASTA format, Sequence #
-s, --sequence SEQUENCE
Sequence as string
-t, --threshold THRESHOLD
E-Value threshold (type: Float64, default:
0.0)
-h, --help show this help message and exit
#### webblast

```julia
webblast(provider::String, sequence::String, threshold::Float64, cached=false)
```
## Examples

Sequence:
```julia WebBLAST/WebBLAST.jl -s MNQLQQLQNPGESPPVHPFVAPLSYLLGTWRGQGEGEYPTIPSFRYGEEIRFSHSGKPVIAY -t 0.000000000000000000000000000001 out.fasta```
Calls the the API of the given provider to search for a protein sequence and returns all hits within a E-Value threshold.

**provider** A provider for a BLAST REST API, e.g. NCBI/EBI BLAST. Default "ncbi" (EBI to be implemented), "ncbi" searches for the sequence in the PDB.

FASTA:
**sequence** The sequence to search for.

```julia WebBLAST.jl -f fasta.txt 4```
**cached** Default ```false```, results can be cached, for example during development.

0 comments on commit 121743f

Please sign in to comment.