aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/refcat/tasks.py50
1 files changed, 48 insertions, 2 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py
index 9d4c982..07c1217 100644
--- a/python/refcat/tasks.py
+++ b/python/refcat/tasks.py
@@ -572,8 +572,8 @@ class BrefZipPMID(Refcat):
"""
def requires(self):
return {
- "refs": RefsDOI(),
- "fatcat": FatcatDOI(),
+ "refs": RefsPMID(),
+ "fatcat": FatcatPMID(),
}
def run(self):
@@ -587,3 +587,49 @@ class BrefZipPMID(Refcat):
def output(self):
return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd)
+
+
+class BrefZipPMCID(Refcat):
+ """
+ Run skate-reduce from two files.
+ """
+ def requires(self):
+ return {
+ "refs": RefsPMCID(),
+ "fatcat": FatcatPMCID(),
+ }
+
+ def run(self):
+ output = shellout(r"""
+ skate-reduce -m exact -r pmcid -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)
+
+
+class BrefZipArxiv(Refcat):
+ """
+ Run skate-reduce from two files.
+ """
+ def requires(self):
+ return {
+ "refs": RefsArxiv(),
+ "fatcat": FatcatArxiv(),
+ }
+
+ def run(self):
+ output = shellout(r"""
+ skate-reduce -m exact -r arxiv -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)