Skip to content

Commit 05c7d36

Browse files
committed
Minor fixes to acecesing-metagenomic-data
1 parent 3b3d047 commit 05c7d36

2 files changed

Lines changed: 62 additions & 13 deletions

File tree

accessing-ancient-metagenomic-data.qmd

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -355,26 +355,30 @@ First we can download the ancientsinglegenome-hostassociated samples table with
355355
AMDirT download -t ancientsinglegenome-hostassociated -y samples
356356
```
357357

358-
This will produce a file called `ancientsinglegenome-hostassociated_samples_v24.03.0.tsv` in your current directory (by default).
358+
This will produce a file called `ancientsinglegenome-hostassociated_samples_<DATA_VERSION>.tsv` in your current directory (by default).
359+
360+
::: {.callout-warning}
361+
You will need to replace `<DATA_VERSION>` with the version number of the AncientMetagenomeDir release you are using in all commands of this tutorial!
362+
:::
359363

360364
```bash
361365
ls
362366
```
363367
```{verbatim}
364-
ancientsinglegenome-hostassociated_samples_v24.03.0.tsv
368+
ancientsinglegenome-hostassociated_samples_<DATA_VERSION>.tsv
365369
```
366370

367371
Then we can use a bit of bash to filter the table in the same way as we did in the GUI.
368372
In this command, we tell `awk` that the column separator is a tab, print the row if either it's the first record (line of the file), or if column one matches `Muhlemann2020` and column seven matches `Norway`.
369373

370374
```bash
371-
awk -F "\t" 'NR==1 || $1 == "Muhlemann2020" && $7 == "Norway"' ancientsinglegenome-hostassociated_samples_v24.03.0.tsv > ancientsinglegenome-hostassociated_samples_v24.03.0_filtered.tsv
375+
awk -F "\t" 'NR==1 || $1 == "Muhlemann2020" && $7 == "Norway"' ancientsinglegenome-hostassociated_samples_<DATA_VERSION>.tsv > ancientsinglegenome-hostassociated_samples_<DATA_VERSION>_filtered.tsv
372376
```
373377

374378
Then, we can pass this filtered table to the `AMDirT convert` command to firstly retrieve the library-level metadata.
375379

376380
```bash
377-
AMDirT convert --librarymetadata ancientsinglegenome-hostassociated_samples_v24.03.0_filtered.tsv ancientsinglegenome-hostassociated
381+
AMDirT convert --librarymetadata ancientsinglegenome-hostassociated_samples_<DATA_VERSION>_filtered.tsv ancientsinglegenome-hostassociated
378382
```
379383

380384
This has downloaded a new file called `AncientMetagenomeDir_filtered_libraries.tsv`, which we can then further filter in the same away to match the desired libraries as we picked during the GUI section of the tutorial!
@@ -386,7 +390,7 @@ awk -F "\t" 'NR==1 || $14 == "Targeted-Capture"' AncientMetagenomeDir_filtered_l
386390
Then with these two filtered files, one for samples,and one for libraries, we can supply them to the `convert` command to generate the same download scripts, eager input samplesheet, and citation `.bib` file as we did before!
387391

388392
```bash
389-
AMDirT convert -o . --bibliography --curl --eager --libraries AncientMetagenomeDir_filtered_libraries_capturedonly.tsv ancientsinglegenome-hostassociated_samples_v24.03.0_filtered.tsv ancientsinglegenome-hostassociated
393+
AMDirT convert -o . --bibliography --curl --eager --libraries AncientMetagenomeDir_filtered_libraries_capturedonly.tsv ancientsinglegenome-hostassociated_samples_<DATA_VERSION>_filtered.tsv ancientsinglegenome-hostassociated
390394
```
391395

392396
You should see a few messages saying `Writing <XYZ>`, and then if we run `ls`, you should see the same resulting files starting with `AncientMetagenomeDir_` as before with the GUI!
@@ -401,32 +405,32 @@ AncientMetagenomeDir_curl_download_script.sh
401405
AncientMetagenomeDir_filtered_libraries.tsv
402406
AncientMetagenomeDir_filtered_libraries_capturedonly.tsv
403407
AncientMetagenomeDir_nf_core_eager_input_table.tsv
404-
ancientsinglegenome-hostassociated_samples_v24.03.0.tsv
405-
ancientsinglegenome-hostassociated_samples_v24.03.0_filtered.tsv
408+
ancientsinglegenome-hostassociated_samples_<DATA_VERSION>.tsv
409+
ancientsinglegenome-hostassociated_samples_<DATA_VERSION>_filtered.tsv
406410
```
407411

408412
Therefore the `convert` command route of AMDirT allows you to include AMDirT in more programmatic workflows to make downloading data more efficiently.
409413

410414
### AMDirT Practise
411415

412416
::: {.callout-tip title="Question" appearance="simple"}
413-
Try to use your preferred AMDirT interface (GUI or CLI) to find the number of all single-stranded libraries of dental calculus _metagenomes_, published since 2021
417+
Try to use your preferred AMDirT interface (GUI or CLI) to find the number of all single-stranded libraries of palaeofaeces _metagenomes_, published since 2021
414418
:::
415419

416420
::: {.callout-note collapse="true" title="Answer"}
417-
The answer is 16 libraries across 2 publications: Klapper et al. [-@Klapper2023-nv] and Fotani et al. [-@Fontani2023-io]
421+
The answer is 19 libraries across 1 publications: Maixner 2021 [-@Maixner2021-sg]
418422

419423
You can calculate this with the CLI method as follows.
420424

421425
```bash
422426
## Download the ancient metagenome table
423427
AMDirT download -t ancientmetagenome-hostassociated -y samples
424428

425-
## Filter to just dental calculus since 2021
426-
awk -F "\t" 'NR==1 || $2 >= 2021 && $13 == "dental calculus"' ancientmetagenome-hostassociated_samples_v24.03.0.tsv > ancientmetagenome-hostassociated_samples_v24.03.0_filtered.tsv
429+
## Filter to just palaeofaeces since 2021
430+
awk -F "\t" 'NR==1 || $2 >= 2021 && $13 == "palaeofaeces"' ancientmetagenome-hostassociated_samples_<DATA_VERSION>.tsv > ancientmetagenome-hostassociated_samples_<DATA_VERSION>_filtered.tsv
427431

428432
## Get the library metadata of the dental calculus (might take a little bit of time)
429-
AMDirT convert --librarymetadata ancientmetagenome-hostassociated_samples_v24.03.0_filtered.tsv ancientmetagenome-hostassociated
433+
AMDirT convert --librarymetadata ancientmetagenome-hostassociated_samples_<DATA_VERSION>_filtered.tsv ancientmetagenome-hostassociated
430434

431435
## Filter to just single stranded libraries
432436
awk -F "\t" 'NR==1 || $9 == "single"' AncientMetagenomeDir_filtered_libraries.tsv > AncientMetagenomeDir_filtered_libraries_singlestranded.tsv
@@ -491,7 +495,6 @@ We are forking a personal fork of the main repository to ensure we don't acciden
491495
3. **Switch** to a new branch called `dev`
492496

493497
```bash
494-
495498
git switch -c dev
496499
```
497500

assets/references/accessing-ancient-metagenomic-data.bib

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,3 +493,49 @@ @article{Klapper2023-nv
493493
issn = {0036-8075,1095-9203},
494494
language = {en}
495495
}
496+
497+
@article{Maixner2021-sg,
498+
title = {Hallstatt miners consumed blue cheese and beer during the Iron Age
499+
and retained a non-Westernized gut microbiome until the Baroque
500+
period},
501+
author = {Maixner, Frank and Sarhan, Mohamed S and Huang, Kun D and Tett,
502+
Adrian and Schoenafinger, Alexander and Zingale, Stefania and
503+
Blanco-Míguez, Aitor and Manghi, Paolo and Cemper-Kiesslich, Jan
504+
and Rosendahl, Wilfried and Kusebauch, Ulrike and Morrone, Seamus
505+
R and Hoopmann, Michael R and Rota-Stabelli, Omar and Rattei,
506+
Thomas and Moritz, Robert L and Oeggl, Klaus and Segata, Nicola
507+
and Zink, Albert and Reschreiter, Hans and Kowarik, Kerstin},
508+
journal = {Current biology: CB},
509+
abstract = {We subjected human paleofeces dating from the Bronze Age to the
510+
Baroque period (18th century AD) to in-depth microscopic,
511+
metagenomic, and proteomic analyses. The paleofeces were preserved
512+
in the underground salt mines of the UNESCO World Heritage site of
513+
Hallstatt in Austria. This allowed us to reconstruct the diet of
514+
the former population and gain insights into their ancient gut
515+
microbiome composition. Our dietary survey identified bran and
516+
glumes of different cereals as some of the most prevalent plant
517+
fragments. This highly fibrous, carbohydrate-rich diet was
518+
supplemented with proteins from broad beans and occasionally with
519+
fruits, nuts, or animal food products. Due to these traditional
520+
dietary habits, all ancient miners up to the Baroque period have
521+
gut microbiome structures akin to modern non-Westernized
522+
individuals whose diets are also mainly composed of unprocessed
523+
foods and fresh fruits and vegetables. This may indicate a shift
524+
in the gut community composition of modern Westernized populations
525+
due to quite recent dietary and lifestyle changes. When we
526+
extended our microbial survey to fungi present in the paleofeces,
527+
in one of the Iron Age samples, we observed a high abundance of
528+
Penicillium roqueforti and Saccharomyces cerevisiae DNA.
529+
Genome-wide analysis indicates that both fungi were involved in
530+
food fermentation and provides the first molecular evidence for
531+
blue cheese and beer consumption in Iron Age Europe.},
532+
month = oct,
533+
year = 2021,
534+
url = {http://dx.doi.org/10.1016/j.cub.2021.09.031},
535+
keywords = {Hallstatt; beer; cheese; diet; fermented food; microbiome;
536+
paleofeces; protohistory; salt mine},
537+
doi = {10.1016/j.cub.2021.09.031},
538+
pmid = 34648730,
539+
issn = {0960-9822,1879-0445},
540+
language = {en}
541+
}

0 commit comments

Comments
 (0)