@@ -355,26 +355,30 @@ First we can download the ancientsinglegenome-hostassociated samples table with
355355AMDirT 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
361365ls
362366```
363367``` {verbatim}
364- ancientsinglegenome-hostassociated_samples_v24.03.0 .tsv
368+ ancientsinglegenome-hostassociated_samples_<DATA_VERSION> .tsv
365369```
366370
367371Then we can use a bit of bash to filter the table in the same way as we did in the GUI.
368372In 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
374378Then, 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
380384This 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
386390Then 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
392396You 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
401405AncientMetagenomeDir_filtered_libraries.tsv
402406AncientMetagenomeDir_filtered_libraries_capturedonly.tsv
403407AncientMetagenomeDir_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
408412Therefore 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
419423You can calculate this with the CLI method as follows.
420424
421425``` bash
422426# # Download the ancient metagenome table
423427AMDirT 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
432436awk -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
4914953 . ** Switch** to a new branch called ` dev `
492496
493497 ```bash
494-
495498 git switch -c dev
496499 ```
497500
0 commit comments