Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
logger.debug("Skipping because I've seen before.")
continue
else:
logger.debug("Analysing {} samples".format(len(read_block)))
sample_rate = read_block.sample_rate
events = minknow_event_detect(
read_block, read_block.sample_rate, **{
'window_lengths':[3, 6], 'thresholds':[1.4, 1.1],
'peak_height':0.2
}
)
if len(events) < 100:
continue
#TODO: do this in a process pool
score, basecall = pyscrap.basecall_events(events)
#TODO: check sanity of basecall
if len(basecall) < 100:
continue
alignment, returncode = yield from align_client.call.align(basecall)
hits = []
if returncode != 0:
logger.warning('Alignment failed for {}'.format(read_block.info))
else:
recs = [x for x in alignment.split('\n') if len(x) > 0 and x[0] != '@']
for r in recs:
fields = r.split('\t')
if fields[2] != '*':
hits.append(fields[2])
logger.debug('{} aligns to {}'.format(read_block.info, hits))