From 057be7680bfbf29a5e3922100f816368c2ab4724 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 19 May 2021 21:25:44 +0200 Subject: tasks: add BrefZipPMID --- python/refcat/tasks.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'python') diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 877e2be..9d4c982 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -564,3 +564,26 @@ class BrefZipDOI(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) + + +class BrefZipPMID(Refcat): + """ + Run skate-reduce from two files. + """ + def requires(self): + return { + "refs": RefsDOI(), + "fatcat": FatcatDOI(), + } + + def run(self): + output = shellout(r""" + skate-reduce -m exact -r pmid -F <(zstdcat -T0 {refs}) -L <(zstdcat -T0 {fatcat}) | + zstd -c -T0 > {output} + """, + refs=self.input().get("refs").path, + fatcat=self.input().get("fatcat").path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) -- cgit v1.2.3