Skip to content

Commit

Permalink
Update sequence extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
zes017 committed Jul 26, 2020
1 parent 1a4e2f5 commit 359d6a4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions maggie/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
'''
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 359d6a4

Please sign in to comment.