From 65668624e1a792d479bfdbc35cd465348c224684 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 4 Aug 2021 00:58:37 +0200 Subject: tasks: add ReleaseIdentDOIList --- python/refcat/tasks.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 8df25f2..5e53f98 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -375,6 +375,25 @@ class ReleaseExportReduced(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) +class ReleaseIdentDOIList(Refcat): + """ + Create TSV (ident, doi). + """ + def requires(self): + return ReleaseExportExpanded() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + parallel --block 10M -j 20 --pipe + "jq -rc 'select(.ext_ids.doi != null) | [.ident, .ext_ids.doi] | @tsv'" > {output} + """, + input=self.input().path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="tsv")) + class UnmatchedRefs(Refcat): """ -- cgit v1.2.3