<commit_before>import argparse
import sys
from subprocess import Popen, PIPE
from time import time
import os
import fileinput
import json
import urllib2

import config
import meme_util

def run_tomtom(meme, outdir, central=True, th=0.05, minovlp=1, evalue=False):
	args = [
		config.tomtom,
		'-oc', outdir,
		'-min-overlap', str(minovlp),
		'-thresh', str(th),
		meme,
		config.central_motifs if central else config.all_motifs
	]

	if evalue:
		args.insert(1, '-evalue')

	p = Popen(args, shell=False, stdout=PIPE, stderr=PIPE)
	tt_stdout, tt_stderr = p.communicate()

def parse_iupac(iupac, outdir):
	p = Popen([
		config.iupac2meme,
		'-alpha', 'DNA',
		iupac
	], shell=False, stdout=PIPE)

	meme = p.communicate()[0]

	outfname = os.path.join(outdir, 'input.meme')<commit_msg>permission issue with temp files from motif search<commit_after>import argparse
import sys
from subprocess import Popen, PIPE
from time import time
import os
import fileinput
import json
import urllib2

import config
import meme_util

def run_tomtom(meme, outdir, central=True, th=0.05, minovlp=1, evalue=False):
	args = [
		config.tomtom,
		'-oc', outdir,
		'-min-overlap', str(minovlp),
		'-thresh', str(th),
		meme,
		config.central_motifs if central else config.all_motifs
	]

	if evalue:
		args.insert(1, '-evalue')

	p = Popen(args, shell=False, stdout=PIPE, stderr=PIPE)
	tt_stdout, tt_stderr = p.communicate()

	for root, dirs, files in os.walk(outdir, topdown=False):
		for d in dirs:
			os.chmod(os.path.join(root, d), 0o775)
		for f in files:
			os.chmod(os.path.join(root, f), 0o664)

def parse_iupac(iupac, outdir):
	p = Popen([
		config.iupac2meme,
		'-alpha', 'DNA',
		iupac
	], shell=False, stdout=PIPE)

	meme = p.communicate()[0]

	outfname = os.path.join(outdir, 'input.meme')
{'fraction_non_alphanumeric': 0.13295774647887323, 'fraction_numerical': 0.013521126760563381, 'mean_word_length': 4.584905660377358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3918445', 'n_tokens_mistral': 763, 'n_tokens_neox': 707, 'n_words': 175}