def constructOverlap(bamfile, ah, edge, tolerance): qid = ah.query_name qs = ah.query_alignment_start qe = ah.query_alignment_end ql = ah.query_length tid = bamfile.getrname(ah.reference_id) ts = ah.reference_start te = ah.reference_end tl = ah.reference_length strand = 0 score = ah.mapping_quality if ah.is_reverse: strand = 1 ov = overlap(qid, tid, score, -1, strand, qs, qe, ql, 0, ts, te, tl) return ov
# proc.communicate() #Make sure you load the Overlap.py from the mrsa_analysis directory from Overlap import overlap from Overlap import read_overlaps c=0 blasr_file = "/sc/orga/scratch/webste01/mrsa_analysis/unitig_54_blasr_out" with open(blasr_file,"r") as bf: for l in bf: name1, name2, score, pctiden, strand1, start1, end1, len1, strand2, start2, end2, len2 = l.split()[0:12] #check to see that the read is in an overhanging read if name1 in overhanging_reads_list: print "in list" o = overlap(name1, name2, score, pctiden, strand1, start1, end1, len1, strand2, start2, end2, len2) if o.hasFullOverlap(): print name1, "overlapping" #else: # print name1, "not full overlap" #else: # print "non overhanging" #Check whether the overhanging reads are also overlapping reads #Check whether the branching reads align to neighbors of the unitig in the graph
doors = [] has_door_been_init = True door_occup = np.zeros(len(doors), dtype=np.int16) print(doors, "\n", door_occup) #HOG sliding window is 64x128 ped = detectors.ped_det(image) #Ped np array if zero_f_exists == False: #First frame ovlp_o = [False] * len( doors) #create empty array to fill in/vector of 1xn ct = 0 for object in doors: ovlp_o[ct] = overlap(object, ped, 0.3) ct += 1 ped_len_o = len(ped) zero_f_exists = True print("Init conditions scanned") else: ct_d = 0 ped_len_n = len(ped) ovlp_n = [False] * len(doors) for object in doors: #Object is door num #Please check for errors again ovlp_n_v = overlap(object, ped, 0.3) ovlp_n[ct_d] = ovlp_n_v