This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once('ARC2.php'); | |
| // Init parser | |
| $parser = ARC2::getTurtleParser(); | |
| $turtle = <<<EOD | |
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess as sub | |
| def exec_cmd(commandstr): | |
| proc = sub.Popen(commandstr, stdout=sub.PIPE, shell=True) | |
| return proc.communicate()[0].strip() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from numap import NuMap | |
| import time | |
| def capitalizer(name): | |
| time.sleep(1) | |
| return name.capitalize() | |
| namelist = ('rolf', 'mariann', 'samuel', 'sandra', 'simon', 'theresa', 'jonathan', 'elias', 'miryam') | |
| result_iterator = NuMap(capitalizer, namelist) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'samuel' | |
| from papy.core import Worker, Plumber, Piper | |
| from papy.core import start_logger | |
| from numap import NuMap | |
| infile_name = "Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa.short" | |
| def base_complement( inbox ): | |
| def basecompl_nucl(nucl): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| __author__ = 'samuel' | |
| from papy.core import Worker, Plumber, Piper | |
| from papy.core import start_logger | |
| from numap import NuMap | |
| infile_name = "Homo_sapiens.GRCh37.67.dna_rm.chromosome.Y.fa.short" | |
| def base_complement( inbox ): | |
| def basecompl_nucl(nucl): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ATask(luigi.Task): | |
| def requires(self): | |
| # Defines what is the upstream task to this one. | |
| # Is later used by the input() function. | |
| return APreviousTask() | |
| def output(self): | |
| return luigi.LocalTarget(self.input().path + ".new_extension") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| from sys import stdin, stdout | |
| tsv_in = csv.reader(stdin, delimiter="\t") | |
| tsv_out = csv.writer(stdout, delimiter="\t") | |
| for row in tsv_in: | |
| # Write out only columns 2-* | |
| tsv_out.writerow(row[1:]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import luigi | |
| class ATask(luigi.Task): | |
| def output(self): | |
| return luigi.LocalTarget("atask_output.txt") | |
| def run(self): | |
| with self.output().open("w") as outfile: | |
| outfile.write("Test") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import luigi | |
| class ATask(luigi.Task): | |
| def output(self): | |
| return luigi.LocalTarget("atask_output.txt") | |
| def run(self): | |
| with self.output().open("w") as outfile: | |
| outfile.write("Test") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "Neat way to {do_what} in {lang}".format(do_what="format strings", lang="python") |