from numpy.matlib import inf
-from Genefinding import *
+#from Genefinding import *
from genome_utils import load_genomic
extended_alphabet = ['-','a','c','g','t','n','[',']']
idx = xrange(len(start)-1,-1,-1)
seq = ''.join([load_genomic(chromosome, strand, start[ix], stop[ix], genome)\
- for ix in idx])
+ for ix in idx])
return seq
try:
import pdb
from Plif import *
-import QPalmaConfiguration as Conf
-
def set_param_palma(param, train_with_intronlengthinformation, run):
print 'Setting parameters ...'
import pdb
import sys
-import qparser
-
from Utils import pprint_alignment
import palma.palma_utils as pu
id = current_prediction['id']
- #current_ground_truth = qparser.fetch_read(id)
- #true_cut = current_ground_truth['true_cut']
- #seq = current_ground_truth['seq']
- #q1 = current_ground_truth['prb']
-
seq = current_prediction['read']
dna = current_prediction['dna']
from qpalma.TrainingParam import Param
from qpalma.Plif import Plf,compute_donacc
-import QPalmaConfiguration as Conf
-
from Utils import calc_stat, calc_info, pprint_alignment, get_alignment
class SpliceSiteException:
del c_qualityPlifsFeatures
del currentAlignment
- assert newSpliceAlign = __newSpliceAlign
- assert newEstAlign = __newEstAlign
- assert newWeightMatch = __newWeightMatch
- assert newDPScores = __newDPScores
- assert newQualityPlifsFeatures = __newQualityPlifsFeatures
+ assert newSpliceAlign == __newSpliceAlign
+ assert newEstAlign == __newEstAlign
+ assert newWeightMatch == __newWeightMatch
+ assert newDPScores == __newDPScores
+ assert newQualityPlifsFeatures == __newQualityPlifsFeatures
return newSpliceAlign, newEstAlign, newWeightMatch, newDPScores,\
newQualityPlifsFeatures, dna_array, est_array
"""
self.run = run
+ self.read_size = 38
self.use_quality_scores = False
if self.run['mode'] == 'using_quality_scores':
if not self.qpalma_debug_mode:
self.plog('Loading example id: %d...\n'% int(id))
- if use_quality_scores = True
+ if use_quality_scores:
quality = currentQualities[quality_index]
else:
quality = [40]*len(read)
if '-' in read:
self.plog('found gap\n')
read = read.replace('-','')
- assert len(read) == Conf.read_size
+ assert len(read) == self.read_size
dna_len = len(dna)
read_len = len(read)
from createAlignmentFileFromPrediction import alignment_reconstruct
+from qpalma.sequence_utils import DataAccessWrapper,SeqSpliceInfo
+
jp = os.path.join
print 'size'
print len(example)
+
+ # fetch the data needed
+ g_dir = run['dna_flat_files'] #'/fml/ag-raetsch/share/projects/genomes/A_thaliana_best/genome/'
+ acc_dir = '/fml/ag-raetsch/home/fabio/tmp/interval_query_files/acc'
+ don_dir = '/fml/ag-raetsch/home/fabio/tmp/interval_query_files/don'
+
+ g_fmt = 'chr%d.dna.flat'
+ s_fmt = 'contig_%d%s'
+
+ num_chromo = 6
+
+ accessWrapper = DataAccessWrapper(g_dir,acc_dir,don_dir,g_fmt,s_fmt)
+ seqInfo = SeqSpliceInfo(accessWrapper,range(1,num_chromo))
+
+
+
qp = QPalma(True)
#qp.init_prediction(run,set_name)
- allPredictions = qp.predict(run,self.prediction_set,param)
+ allPredictions = qp.predict(run,self.prediction_set,param,seqInfo )
for current_prediction in allPredictions:
align_str = print_prediction(current_prediction)
print align_str