Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def mask_sequence(args):
assert len(args.default_seq) == 1
fasta = Fasta(args.fasta, mutable=True)
for line in args.bed:
rname, start, end = bed_split(line)
if args.action == 'replace':
fasta[rname][start:end] = (end - start) * args.default_seq
elif args.action == 'lowercase':
fasta[rname][start:end] = fasta[rname][start:end].lowercase()
def split_regions(args):
if args.bed:
regions_to_fetch = args.bed
split_function = bed_split
else:
regions_to_fetch = args.regions
split_function = ucsc_split
return (regions_to_fetch, split_function)