From 359d6a41af768ec997d3bd8cc2b91337f6b7a651 Mon Sep 17 00:00:00 2001 From: zes017 Date: Sat, 25 Jul 2020 23:21:43 -0700 Subject: [PATCH] Update sequence extraction --- maggie/utils.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/maggie/utils.py b/maggie/utils.py index 6a6ba1c..b9bcfa0 100644 --- a/maggie/utils.py +++ b/maggie/utils.py @@ -104,7 +104,7 @@ def load_genome(ref_path): return ref_dict -def data_prep(path, genomes, size=100, skiprows=0, file_format='bed'): +def data_prep(path, genomes, size=None, skiprows=0, file_format='bed'): ''' Extract sequences based on reference genome and input file with information of location ''' @@ -132,9 +132,10 @@ def data_prep(path, genomes, size=100, skiprows=0, file_format='bed'): return # rescale the regions - mid = (start+end)//2 - start = mid - size//2 - end = mid + size//2 + if size is not None: + mid = (start+end)//2 + start = mid - size//2 + end = mid + size//2 try: seq = genomes[chromID][start:end] except: