diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-05-14 12:13:57 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-05-14 12:13:57 +0200 |
commit | a213228006b66229a7e3b032e34d3c709c913c81 (patch) | |
tree | b24735dcc49eaa6ea28a34fde72f5152a7c072e3 /python | |
parent | a89e1ea2e38b923d2be9a6f440c7d27a2670a22f (diff) | |
download | refcat-a213228006b66229a7e3b032e34d3c709c913c81.tar.gz refcat-a213228006b66229a7e3b032e34d3c709c913c81.zip |
add task: BrefZipDOI
Diffstat (limited to 'python')
-rw-r--r-- | python/refcat/tasks.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 3dcdd65..530eb6a 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -552,3 +552,25 @@ class FatcatMapped(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) + + +class BrefZipDOI(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 doi -F <(zstdcat -T0 {refs}) -L <(zstdcat -T0 {fatcat}) | + zstd -c -T0 > {output} + """, + refs=self.input().get("refs").path, + fatcat=self.input().get("fatcat").path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) |