aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-19 21:25:44 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-19 21:25:44 +0200
commit057be7680bfbf29a5e3922100f816368c2ab4724 (patch)
tree65722babb2164ee89c8cd564b287be5b17480cc5 /python
parentd0bf30ec249ba6d329d768c46f2ab08ffbfdf883 (diff)
downloadrefcat-057be7680bfbf29a5e3922100f816368c2ab4724.tar.gz
refcat-057be7680bfbf29a5e3922100f816368c2ab4724.zip
tasks: add BrefZipPMID
Diffstat (limited to 'python')
-rw-r--r--python/refcat/tasks.py23
1 files changed, 23 insertions, 0 deletions
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)