Skip to content

Commit

Permalink
docs: remove last absolute links
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnighter committed Apr 6, 2024
1 parent 1bdb03e commit 39478bd
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 54 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ With these minimal arguments, taxpasta produces a two column output consisting o
You can count on the second column being integers :wink: Having such a simple
and tidy table should make your downstream analysis much smoother to start out
with. Please, have a look at the full [getting
started](/tutorials/getting-started) tutorial for a more thorough
started](tutorials/getting-started.md) tutorial for a more thorough
introduction.

### Merge
Expand Down
2 changes: 1 addition & 1 deletion docs/supported_profilers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ each taxonomic profiler can be standardised by taxpasta.

In particular, when comparing results between various tools, please be very
aware of their differences. In the document on
[terminology](terminology), we describe how we think about the different
[terminology](terminology.md), we describe how we think about the different
tools. Spending some time on considering the consequences now, will save
you a lot of headache and prevent potentially wrong results later.

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/deepdive.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ names](../how-tos/how-to-add-names.md).
!!! tip

Carefully read our [background
documentation](/supported_profilers/terminology) on terminology and
documentation](../supported_profilers/terminology.md) on terminology and
considerations for comparing results from different metagenomic profilers.

You may have noticed that when "standardising" the output from each profiler
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_python_snippets.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ execute:
<!-- --8<-- [start:software] -->

- Unix terminal (e.g., `bash`)
- [Python environment with taxpasta](/#install)
- [Python environment with taxpasta](../index.md#install)
- No additional requirements, since we will make use of [pandas](https://pandas.pydata.org/) which is already part of the taxpasta installation.

<!-- --8<-- [end:software] -->
Expand Down
97 changes: 48 additions & 49 deletions docs/tutorials/tutorial_r_snippets.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@

<!-- --8<-- [start:software] -->

- Unix terminal (e.g., `bash`)
- Unix terminal (e.g., `bash`)

- [Python environment with taxpasta](/#install)
- [Python environment with taxpasta](../index.md#install)

- [R](https://rstudio-education.github.io/hopr/starting.html#how-to-download-and-install-r)
- [R](https://rstudio-education.github.io/hopr/starting.html#how-to-download-and-install-r)

- Package dependencies
- Package dependencies

``` r
install.packages(c("readr", "dplyr"), dependencies = TRUE)
```
```r
install.packages(c("readr", "dplyr"), dependencies = TRUE)
```

<!-- --8<-- [end:software] -->
<!-- --8<-- [start:raw-motus] -->

We can try loading a mOTUs profile into R using the common table reading
function `read_tsv()` from the `readr` package with default arguments.

``` r
```r
requireNamespace("readr")
```

Loading required namespace: readr

``` r
```r
profile_motus <- readr::read_tsv("2612_pe-ERR5766176-db_mOTU.out")
```

Expand All @@ -52,7 +51,7 @@ into software expecting ‘true’ tabular data, we have to instead add
extra options to the function, which makes loading the table less than
smooth for downstream analyses.

``` r
```r
profile_motus <- readr::read_tsv("2612_pe-ERR5766176-db_mOTU.out", comment = "#")
```

Expand All @@ -70,11 +69,11 @@ profile_motus <- readr::read_tsv("2612_pe-ERR5766176-db_mOTU.out", comment = "#"
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

However, once again we hit another error: the column headers are *also*
However, once again we hit another error: the column headers are _also_
specified as a comment line… Instead we can try to skip the first two
lines entirely.

``` r
```r
profile_motus <- readr::read_tsv("2612_pe-ERR5766176-db_mOTU.out", skip = 2)
```

Expand All @@ -87,7 +86,7 @@ profile_motus <- readr::read_tsv("2612_pe-ERR5766176-db_mOTU.out", skip = 2)
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

``` r
```r
profile_motus
```

Expand All @@ -110,7 +109,7 @@ profile_motus
<!-- --8<-- [end:raw-motus] -->
<!-- --8<-- [start:raw-kraken2] -->

``` r
```r
profile_kraken2 <- readr::read_tsv("2612_pe-ERR5766176-db1.kraken2.report.txt")
```

Expand All @@ -124,30 +123,30 @@ profile_kraken2 <- readr::read_tsv("2612_pe-ERR5766176-db1.kraken2.report.txt")
• `627680` -> `627680...2`
• `627680` -> `627680...3`

``` r
```r
profile_kraken2
```

# A tibble: 43 × 6
`99.97` `627680...2` `627680...3` U `0` unclassified
<dbl> <dbl> <dbl> <chr> <dbl> <chr>
1 0.03 168 0 R 1 root
`99.97` `627680...2` `627680...3` U `0` unclassified
<dbl> <dbl> <dbl> <chr> <dbl> <chr>
1 0.03 168 0 R 1 root
2 0.03 168 0 R1 131567 cellular organisms
3 0.03 168 0 D 2759 Eukaryota
4 0.03 168 0 D1 33154 Opisthokonta
5 0.02 152 0 K 33208 Metazoa
6 0.02 152 0 K1 6072 Eumetazoa
7 0.02 152 0 K2 33213 Bilateria
8 0.02 152 0 K3 33511 Deuterostomia
9 0.02 152 0 P 7711 Chordata
10 0.02 152 0 P1 89593 Craniata
3 0.03 168 0 D 2759 Eukaryota
4 0.03 168 0 D1 33154 Opisthokonta
5 0.02 152 0 K 33208 Metazoa
6 0.02 152 0 K1 6072 Eumetazoa
7 0.02 152 0 K2 33213 Bilateria
8 0.02 152 0 K3 33511 Deuterostomia
9 0.02 152 0 P 7711 Chordata
10 0.02 152 0 P1 89593 Craniata
# … with 33 more rows

This doesn’t fail to load but unfortunately the column headers look a
bit weird. It seems the Kraken2 file does not include a column header!
In this case we have to specify these ourselves.

``` r
```r
profile_kraken2 <- readr::read_tsv(
"2612_pe-ERR5766176-db1.kraken2.report.txt",
col_names = c(
Expand All @@ -170,15 +169,15 @@ profile_kraken2 <- readr::read_tsv(
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

``` r
```r
profile_kraken2
```

# A tibble: 44 × 6
percent clade_assigned_reads direct_assigned_reads taxonomy_lvl taxon…¹ name
percent clade_assigned_reads direct_assigned_reads taxonomy_lvl taxon…¹ name
<dbl> <dbl> <dbl> <chr> <dbl> <chr>
1 100. 627680 627680 U 0 uncl…
2 0.03 168 0 R 1 root
2 0.03 168 0 R 1 root
3 0.03 168 0 R1 131567 cell…
4 0.03 168 0 D 2759 Euka…
5 0.03 168 0 D1 33154 Opis…
Expand All @@ -196,13 +195,13 @@ In the tidyverse flavour of R, we can do this with the `full_join`
function of the `dplyr` package. This form of joining tables includes
all rows both from the left and right table in the resulting table.

``` r
```r
requireNamespace("dplyr")
```

Loading required namespace: dplyr

``` r
```r
dplyr::full_join(profile_motus, profile_kraken2)
```

Expand All @@ -217,24 +216,24 @@ for the different profilers’ outputs.
We need to specify which column of the left table should be joined with
what column of the right table.

``` r
```r
raw_merged_table <- dplyr::full_join(profile_motus, profile_kraken2, by = c("NCBI_tax_id" = "taxonomy_id"))
raw_merged_table
```

# A tibble: 33,615 × 8
`#consensus_taxonomy` NCBI_…¹ 2612_…² percent clade…³ direc…⁴ taxon…⁵ name
`#consensus_taxonomy` NCBI_…¹ 2612_…² percent clade…³ direc…⁴ taxon…⁵ name
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <chr> <chr>
1 Leptospira alexanderi … 100053 0 NA NA NA <NA> <NA>
2 Leptospira weilii [ref… 28184 0 NA NA NA <NA> <NA>
3 Chryseobacterium sp. [… NA 0 NA NA NA <NA> <NA>
4 Chryseobacterium galli… 1324352 0 NA NA NA <NA> <NA>
5 Chryseobacterium indol… 253 0 NA NA NA <NA> <NA>
6 Chryseobacterium artoc… NA 0 NA NA NA <NA> <NA>
7 Chryseobacterium jejue… 445960 0 NA NA NA <NA> <NA>
8 Chryseobacterium sp. G… 1805473 0 NA NA NA <NA> <NA>
9 Chryseobacterium conta… 1423959 0 NA NA NA <NA> <NA>
10 Chryseobacterium indol… 253 0 NA NA NA <NA> <NA>
1 Leptospira alexanderi … 100053 0 NA NA NA <NA> <NA>
2 Leptospira weilii [ref… 28184 0 NA NA NA <NA> <NA>
3 Chryseobacterium sp. [… NA 0 NA NA NA <NA> <NA>
4 Chryseobacterium galli… 1324352 0 NA NA NA <NA> <NA>
5 Chryseobacterium indol… 253 0 NA NA NA <NA> <NA>
6 Chryseobacterium artoc… NA 0 NA NA NA <NA> <NA>
7 Chryseobacterium jejue… 445960 0 NA NA NA <NA> <NA>
8 Chryseobacterium sp. G… 1805473 0 NA NA NA <NA> <NA>
9 Chryseobacterium conta… 1423959 0 NA NA NA <NA> <NA>
10 Chryseobacterium indol… 253 0 NA NA NA <NA> <NA>
# … with 33,605 more rows, and abbreviated variable names ¹​NCBI_tax_id,
# ²​`2612_pe-ERR5766176-db_mOTU`, ³​clade_assigned_reads,
# ⁴​direct_assigned_reads, ⁵​taxonomy_lvl
Expand All @@ -245,7 +244,7 @@ raw_merged_table
Now let’s try to load the taxpasta standardised Kraken2 result into R
again.

``` r
```r
profile_kraken2_std <- readr::read_tsv("2612_pe-ERR5766176-db1_kraken2.tsv")
```

Expand All @@ -257,7 +256,7 @@ profile_kraken2_std <- readr::read_tsv("2612_pe-ERR5766176-db1_kraken2.tsv")
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

``` r
```r
profile_kraken2_std
```

Expand All @@ -282,7 +281,7 @@ profile_kraken2_std
Once again, let’s try loading the standardised and merged mOTUs result
into R.

``` r
```r
profile_motus_merged <- readr::read_tsv("dbMOTUs_motus.tsv")
```

Expand All @@ -294,7 +293,7 @@ profile_motus_merged <- readr::read_tsv("dbMOTUs_motus.tsv")
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

``` r
```r
profile_motus_merged
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial_r_snippets.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ execute:
<!-- --8<-- [start:software] -->

- Unix terminal (e.g., `bash`)
- [Python environment with taxpasta](/#install)
- [Python environment with taxpasta](../index.md#install)
- [R](https://rstudio-education.github.io/hopr/starting.html#how-to-download-and-install-r)
- Package dependencies

Expand Down

0 comments on commit 39478bd

Please sign in to comment.