Skip to content

Commit

Permalink
Update installation instructions and package list
Browse files Browse the repository at this point in the history
  • Loading branch information
percyfal committed Oct 25, 2023
1 parent 13b0390 commit 41061dc
Show file tree
Hide file tree
Showing 13 changed files with 101 additions and 117 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ install-pgip: ## Create pgip environment and install packages to render site
if conda env list | cut -f1 -d ' ' | grep -q "${PGIP}$$"; then \
echo "Environment exists; skipping install"; \
else \
mamba env create -n ${PGIP} --file environment.yml; \
mamba env create -n ${PGIP} conda-linux-64.lock; \
fi;

install-dev: install-pgip ## Install additional development tools
mamba env update -n ${PGIP} --file environment-dev.yml

install-R: install-pgip ## Install additional R packages that require manual installation
R -e "install.packages('dotenv', repos=c(CRAN = 'https://cran.rstudio.com/'))"
R -e "tinytex::tlmgr_update()"
R -e "tinytex::reinstall_tinytex(force=TRUE)"
#R -e "tinytex::tlmgr_update()"
#R -e "tinytex::reinstall_tinytex(force=TRUE)"
R -e "library(devtools); devtools::install_local('src/R/pgip')"

install-kernels: install-pgip ## Install python and bash kernel
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ environment variable:
conda activate pgip
make install-R
make install-kernels
make install-bcftools
make install-pixy
make install-dev

Expand All @@ -73,9 +72,9 @@ issues](#installation-issues).

### Create pgip conda environment

Create a conda environment called `pgip` using the environment file
Create a conda environment called `pgip` using the conda lock file

mamba env create --file environment.yml
mamba env create -n pgip conda-linux-64.lock

and activate the environment

Expand Down Expand Up @@ -123,7 +122,10 @@ information.

[Install Quarto](https://quarto.org/docs/get-started) version [Quarto\>=1.2.475](https://quarto.org/docs/download/).

### bcftools manual install
### bcftools manual install (OBSOLETE)

**OBSOLETE**: installing pgip using `conda-linux-64.lock` obviates the
need to install bcftools manually.

Due to dependency issues, bcftools has to be manually installed:

Expand Down
66 changes: 55 additions & 11 deletions conda-linux-64.lock

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions docs/exercises/variant_filtering/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In this exercise we will look at ways of filtering variant data. We
will begin by applying filters to the variant file containing all
sites data, followed by a more general approach based on sequencing
coverage that works also when the variant file lacks information about
monomorphic sites.
invariant sites.

::: {.callout-tip collapse=true}

Expand Down Expand Up @@ -348,7 +348,6 @@ csvtk summary -t -f MEAN_DEPTH:mean ${OUT}.idepth
data <- read.table("vcftools/allsites.idepth", header=TRUE)
LDEPTH_MEAN <- round(mean(data$MEAN_DEPTH), 1)
ldepth <- sprintf("%.1fX", LDEPTH_MEAN)
```

Note that `vcftools` treats uncalled sites as missing data, which is
Expand All @@ -374,7 +373,10 @@ total depth across all samples.

We plot the distribution of depths by counting how many times each
depth is observed. This can be done with `csvtk summary` where we
count positions and group (`-g`) by the `SUM_DEPTH` value:
count positions and group (`-g`) by the `SUM_DEPTH` value:^[Viewing
`csvtk` output: either you can **redirect** (`>`) the results from
`csvtk` to a png output file, or you can **pipe** (`|`) it to the
command `display`, which should fire up a window with your plot.]

```{bash }
#| label: csvtk-plot-vcftools-depth-per-site
Expand Down
42 changes: 26 additions & 16 deletions docs/slides/foundations/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ format:
#| echo: false
#| eval: true
#| cache: false
library(viridislite)
library(viridisLite)
library(gganimate)
library(patchwork)
library(expm)
Expand Down Expand Up @@ -444,6 +444,10 @@ The latter expression is called the *nucleotide diversity*

## Alleles as algebraic entities

:::: {.columns}

::: {.column width="50%"}

Recall: **alleles** refer to *different variants* of a sequence at a
locus (genomic position).

Expand All @@ -467,32 +471,31 @@ Will use combination $A$, $a$ for *bi-allelic* loci from now on

:::

::: {.fragment .large}
:::

::: {.column width="50%"}

::: {.fragment}

::: {.callout-important appearance="simple" icon=false}

### Example: gene coding for flower color

:::::: {.columns}

::::: {.column width="30%"}
::::: {.column width="50%"}

[{{< fa solid circle >}}]{style="color: #ff2a2a;"} $A$ red color

{{< fa regular circle >}} $a$ white color

:::::

:::::{.column width="5%"}

:::::

:::::{.column width="20%" .fragment}
::: {.fragment}

[Punnett square](https://en.wikipedia.org/wiki/Punnett_square)

:::: {style="display: grid; grid-template-columns: auto auto auto;
grid-row-gap: 0px; grid-column-gap: 0px; text-align: center; align-items: center;"}
grid-row-gap: 0px; grid-column-gap: 0px; text-align: center;
align-items: center;"}

:::{}

Expand Down Expand Up @@ -520,13 +523,13 @@ A

:::{}

![](assets/images/flower-red.svg){width=100}
![](assets/images/flower-red.svg){width=75}

:::

:::{}

![](assets/images/flower-pink.svg){width=100}
![](assets/images/flower-pink.svg){width=75}

:::

Expand All @@ -538,25 +541,27 @@ a

:::{}

![](assets/images/flower-pink.svg){width=100}
![](assets/images/flower-pink.svg){width=75}

:::

:::{}

![](assets/images/flower-white.svg){width=100}
![](assets/images/flower-white.svg){width=75}

:::

::::

:::

:::::

:::::{.column width="5%"}

:::::

::::: {.column width="40%" .fragment}
::::: {.column width="45%" .fragment}

:::: {style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
grid-row-gap: 0px; grid-column-gap: 10px; text-align: center; align-items: center;"}
Expand Down Expand Up @@ -621,6 +626,10 @@ Heterozygote has intermediate color phenotype (pink).

:::

:::

::::

::: {.notes}

Until now the examples have been based on nucleotide sequences.
Expand Down Expand Up @@ -4218,6 +4227,7 @@ xi <- L / 2
#| fig-align: center
#| fig-height: 5
#| fig-width: 10
#| fig-format: png
#| fig-cap: The effect of a selective sweep on
#| diversity. The arrow points to the site under selection.
#| The y-axis shows Tajima's D which is proportional to the
Expand Down
4 changes: 1 addition & 3 deletions environment-dev.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
# Development environment
name: pgip-dev
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- conda-lock
- pip
- pre-commit
- r-docopt
- r-fontawesome
- r-languageserver
- r-leaflet
- r-lintr
- r-precommit
- pip:
Expand Down
21 changes: 0 additions & 21 deletions environment-run.yml

This file was deleted.

13 changes: 0 additions & 13 deletions environment-site.yml

This file was deleted.

12 changes: 4 additions & 8 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- bedtools
- bcftools
- bokeh
- bwa
- ca-certificates
- csvtk
- cyvcf2=0.30.16
Expand All @@ -25,10 +26,11 @@ dependencies:
- multiqc
- pandas
- pip
- picard
- pyslim
- python>=3.10
- python-newick
# - r-animation
- qualimap
- r-ape
- r-codetools
- r-curl
Expand All @@ -48,8 +50,6 @@ dependencies:
- r-gsalib
- r-highcharter
- r-igraph
# # - r-irkernel
# # - r-jsonlite
- r-kableextra
- r-latex2exp
- r-leaflet
Expand All @@ -58,20 +58,16 @@ dependencies:
- r-patchwork
- r-pdftools
- r-plotly
# # - r-reactable
- r-readr
- r-readxl
- r-reticulate
- r-rmarkdown>=2.19
- r-tidyr
# # - r-transformr
- r-viridis
- samtools=1.15.1
# # - scikit-learn
- scikit-allel
- slim>=4.0
- sgkit
- tskit>=0.5.0
- vcflib
- vcftools
# # - tqdm
# # - yarl
6 changes: 0 additions & 6 deletions requirements-dev.txt

This file was deleted.

13 changes: 0 additions & 13 deletions requirements-dev.yml

This file was deleted.

15 changes: 0 additions & 15 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/condalock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -xeuo pipefail
if [[ $# == 1 ]]; then
if [[ "$1" == "--force" ]]; then
echo "generating conda-linux-64.lock from environment.yml"
conda-lock --kind explicit --platform linux-64
conda-lock lock -f environment.yml --kind explicit --platform linux-64
else
echo "Usage: $0 [--force]"
exit 1
Expand Down

0 comments on commit 41061dc

Please sign in to comment.