Skip to content

Commit f53816e

Browse files
authored
Merge pull request #174 from SPAAM-community/bibtex_libs
Infer required BibTex entries from the library table instead of the sample table
2 parents 2507445 + 22178ed commit f53816e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

amdirt/convert/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def run_convert(
131131
bibfile = f"{output}/AncientMetagenomeDir_bibliography.bib"
132132
logger.info(f"Writing Bibtex citation file to {bibfile}")
133133
with open(bibfile, "w") as fw:
134-
fw.write(prepare_bibtex_file(samples))
134+
fw.write(prepare_bibtex_file(libraries))
135135

136136
if table_name in ["ancientmetagenome-environmental"]:
137137
col_drop = ["archive_accession"]

amdirt/core/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,10 @@ def prepare_aMeta_table(
519519

520520

521521
@st.cache_data
522-
def prepare_bibtex_file(samples: pd.DataFrame) -> str:
522+
def prepare_bibtex_file(libraries: pd.DataFrame) -> str:
523523
dois = set()
524524
failed_dois = set()
525-
dois_set = set(list(samples["publication_doi"]))
525+
dois_set = set(list(libraries["data_publication_doi"]))
526526
dois_set.add("10.1038/s41597-021-00816-y")
527527
for doi in dois_set:
528528
try:

docs/source/how_to/convert.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ All possible output is as follows:
5959

6060
- `<outdir>`: where all the pipeline samplesheets are placed (by default `.`)
6161
- `AncientMetagenomeDir_bibliography.bib`:
62-
- A BibTex format citation information file with all references (where available) present in the filtered sample table.
62+
- A BibTex format citation information file with all references (where available) present in the filtered sample table. In case a library table is provided using `--libraries`, only the references relevant to the selected libraries are reported.
6363
- `AncientMetagenomeDir_filtered_libraries.tsv`:
6464
- The associated AncientMetagenomeDir curated metadata for all _libraries_ of the samples in the input table.
6565
- `AncientMetagenomeDir_curl_download_script.sh`:

0 commit comments

Comments
 (0)