diff options
-rw-r--r-- | python/refcat/tasks.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 0339932..86a3712 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -437,3 +437,72 @@ class FatcatDOI(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) + + +class FatcatPMID(Refcat): + """ + PMID from fatcat. + """ + def requires(self): + return ReleaseExportReduced() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + skate-map -m ff -x ext_ids.pmid -skip-on-empty 1 | + LC_ALL=C sort -T {tmpdir} -k1,1 -S25% --parallel 4 | + zstd -T0 -c > {output} + """, + n=self.n, + tmpdir=self.tmpdir, + input=self.input().path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) + + +class FatcatPMCID(Refcat): + """ + PMCID from fatcat. + """ + def requires(self): + return ReleaseExportReduced() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + skate-map -m ff -x ext_ids.pmcid -skip-on-empty 1 | + LC_ALL=C sort -T {tmpdir} -k1,1 -S25% --parallel 4 | + zstd -T0 -c > {output} + """, + n=self.n, + tmpdir=self.tmpdir, + input=self.input().path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) + + +class FatcatArxiv(Refcat): + """ + Arxiv from fatcat. + """ + def requires(self): + return ReleaseExportReduced() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + skate-map -m ff -x extra.arxiv.base_id -skip-on-empty 1 | + LC_ALL=C sort -T {tmpdir} -k1,1 -S25% --parallel 4 | + zstd -T0 -c > {output} + """, + n=self.n, + tmpdir=self.tmpdir, + input=self.input().path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) |