Beispiel #1
0
	def __init__(self,name,dirname,fname,fans):
		# name is used as log file name
		# dirname is location saving log file
		self._name = name
		self._dir = dirname
		#pssm = pssm2feature2.pssm(fname)
		self._starts = {idch:start for idch,start,seq in seq2feature.fasta2seq(fname)}
		if fans is not None:
			self._ans = util.ans(fans)
Beispiel #2
0
import os
import random
import util

from core import seq2feature

#DIR = "/net2/presto-users/masaki070540/code/xbind/"
DIR = "./"

log_path = lambda name,window,c,g,no,idch:DIR + "tmp/svm/fold_whole/%s.%s.%s.%s.log.%s/%s.log" % (
    name,window,c,g,no,idch)

starts = lambda fname:{idch:start for idch,start,seq in seq2feature.fasta2seq(fname)}

def _readliner(line):
	rec = line.strip().split()
	idch = rec[0].split(':')[0]
	val = float(rec[2])
	return idch,val

def iter_desc(name,window,c,g,idch):
	fname = get_log(name,window,c,g,idch)
	# For get_log() bagg. ( Test didn't execute using All proteins.
	if fname is not None:
		with open(fname) as fp:
			for idch,val in (_readliner(line) for line in iter(fp.readline,"")):
				yield val

def get_log(name,window,c,g,idch):
	for no in range(5):
		if os.path.exists(log_path(name,window,c,g,no,idch)):
Beispiel #3
0
	def __init__(self,name,dirname,fname):
		valid.__init__(self,name,dirname)
		self._starts = {idch:start for idch,start,seq in seq2feature.fasta2seq(fname)}
Beispiel #4
0
 def __init__(self, name, dirname, fname):
     valid.__init__(self, name, dirname)
     self._starts = {
         idch: start
         for idch, start, seq in seq2feature.fasta2seq(fname)
     }