Skip to content

Commit

Permalink
added docs on recommended workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Apr 18, 2023
1 parent 20d2f9e commit 6212311
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 18 deletions.
60 changes: 42 additions & 18 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,68 @@
# Installation

## Install Julia

First you need to install the Julia language in your platform, from:
[http://julialang.org](http://julialang.org). Julia version 1.6 or greater is required.
[http://julialang.org](http://julialang.org). Julia version 1.6 or greater is required. Using the [juliaup](https://github.com/JuliaLang/juliaup) tool is also a highly recommended way of installing and keeping Julia up to date.

!!! tip
New to Julia? Julia is a modern high-level yet performant programming language. Some tips
and a nice workflow for using it effectively can be found [here](https://m3g.github.io/JuliaNotes.jl/stable/workflow/).

For this specific package, following a the step-by-step examples provided here after installing Julia should be enough.

Next, run julia, and within the julia REPL interface, install the ComplexMixtures package using
## Install the packages

Within Julia, to install the packages required for running the examples here you need to do:

```julia-repl
julia> import Pkg
julia> Pkg.add("ComplexMixtures")
julia> Pkg.add(["ComplexMixtures","Plots","PDBTools"])
```

Please read the recommended workflow below, for further information and to be sure to have a smoother experience.

## Recommended workflow for reproducibility

### Create an environment

Once Julia is installed, we recommend to create an environment that will contain all the packages you may use for your
analyses, including `ComplexMixtures`, in such a way that your results can always be reproduced and you don't get
any version incompatibility.

We illustrate this by creating the "MyNewPaper" environment, which will be hosted in a simple directory,
```bash
mkdir /home/user/Documents/MyNewPaper
```
or simply (you cannot copy/paste this, the `]` will take you to the `pkg>` prompt):

Then, start Julia and activate the environment that will be hosted there:
```julia-repl
julia> ] add ComplexMixtures
julia> import Pkg; Pkg.activate("/home/user/Documents/MyNewPaper")
Activating new project at `~/Documents/MyNewPaper`
```

To follow all the examples provided in this manual, the
[PDBTools](http://m3g.iqm.unicamp.br/PDBTools)
and [Plots](http://docs.juliaplots.org/latest/) have to be installed as well:
and add to this environment the packages that your analyses will require:

```julia-repl
julia> ] add PDBTools, Plots
julia> Pkg.add(["ComplexMixtures","PDBTools","Plots"])
```

If you are first-time `julia` user, load these packages for the first
time after installation. Loading the `Plots` package, in particular, may
take quite a while when done for the first time, because it is compiled
at this point (this was greatly improved in Julia versions greater than 1.6, which
are highly recommended). To load the packages, use:
That's it. Close Julia. Note that this created the files `Manifest.toml` and `Project.toml` in the `MyNewPaper` directory, which contain the information of packages and exact package versions you are using now on in this environment. Saving these files may be relevant for the future exact reproduction of your analyses.

### Run your analysis scripts in that environment

Now, your analysis scripts, described in the next section in details, will look like:

```julia
using ComplexMixtures, PDBTools, Plots
```
import Pkg; Pkg.activate("/home/user/Documents/MyNewPaper")

If no errors were shown in any of these steps, the packages are ready to
be used following the instructions and examples.
using ComplexMixtures
using PDBTools
using Plots

# etc ...
```

!!! tip
By loading the package with
Expand Down
5 changes: 5 additions & 0 deletions docs/src/quickguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ format in this example, which is the default output of `NAMD` and `CHARMM` simul
packages.

```julia
# Activate environment (see the Installation -> Recommended Workflow manual section)
import Pkg; Pkg.activate("/home/user/MyNewPaper")

# Load packages
using PDBTools
using ComplexMixtures
Expand Down Expand Up @@ -71,6 +74,8 @@ where `-t auto` will launch `julia` with multi-threading. It is highly recommend
```
The first time the script was called it took ~30s, which included compilation of the code and loading of the packages. The second time the script was included it took 0.7s. Thus, for interactive modification of the script, don't restart Julia.

This has been much improved in Julia 1.9, particularly if a stable environment is used, as suggested.

## Detailed description of the example

Start `julia` and load the ComplexMixtures package, using:
Expand Down

0 comments on commit 6212311

Please sign in to comment.