Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def clean(self):
if exists(self.destpath):
shutil.rmtree(self.destpath)
sh.cd(self.root_dir)
'mm9': '/srv/scratch/leepc12/mm9/mm9.chrom.sizes',
}
# TODO: allow default params for index, tssfile given genome
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
args = parse_args()
print args
if args.printscript:
print_fp = open(args.printscript, 'w')
mkdir_p(args.output_directory)
cd(args.output_directory)
workers = []
with open(args.sample_file) as fp:
for line in fp:
line = line.strip().split('\t')
sample_id, description, read1, read2, genome, index, tssfile = line
sample_output_dir = '%s-%s' % (sample_id, description)
logging.info('Processing %s (genome: %s)' %
(sample_output_dir, genome))
mkdir_p(sample_output_dir)
genome_size = GENOME2GENOME_SIZE[genome]
chrom_size = GENOME2CHROM_SIZE[genome]
def recompile(pset):
"""Overwrite params.h and recompiles the speedbenchmark code"""
with open("../src/params.h", "w") as f:
f.write(str(pset))
sh.cd("speedbenchmark")
sh.make("clean")
sh.make()
sh.cd("../")
def cd(d):
import sh
p = os.path.abspath(os.curdir)
if d:
sh.mkdir('-p', d)
sh.cd(d)
try:
yield
except Exception:
raise
finally:
sh.cd(p)
def make_release(flavors, custom_channel):
sh.cd(PATH_PREFIX)
args = [GRADLEW,
'-q',
'clean',
'-PcustomChannel=' + custom_channel]
tasks = ['assemble{0}Release'.format(flavor.title()) for flavor in flavors]
args += tasks
subprocess.call(args)
with open(input_file_name) as input_file:
for record in json.loads(input_file.read()):
dictionary.update(tokenizer.tokenize(record['content']))
dictionary.update(tokenizer.tokenize(record['abstract']))
dictionary = list(sorted(w for w in dictionary if dictionary[w] >= 5)) + ['PADDING', 'UNKNOWN']
with open(output_file_name, 'w') as output_file:
output_file.write("{}\n".format(json.dumps(dictionary)))
if __name__ == "__main__":
if not os.path.exists(papers_dir):
os.makedirs(papers_dir)
sh.cd(papers_dir)
ruffus.pipeline_run(verbose=3, multiprocess=psutil.NUM_CPUS)
def make_bundle(flavors, custom_channel):
sh.cd(PATH_PREFIX)
args = [GRADLEW,
'-q',
'clean',
'-PcustomChannel=' + custom_channel]
tasks = ['bundle{0}Release'.format(flavor.title()) for flavor in flavors]
args += tasks
subprocess.call(args)
def recompile(pset):
"""Overwrite params.h and recompiles the speedbenchmark code"""
with open("../src/params.h", "w") as f:
f.write(str(pset))
sh.cd("speedbenchmark")
sh.make("clean")
sh.make()
sh.cd("../")