Skip to content

Commit 342915c

Browse files
committed
accept list of string representations of genetic sequence
1 parent 98e3602 commit 342915c

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ model = Enformer(
2424
target_length = 896,
2525
)
2626

27-
seq = torch.randint(0, 5, (1, 196_608)) # for ACGTN, in that order
27+
seq = torch.randint(0, 5, (1, 196_608)) # for ACGTN, in that order (-1 for padding)
2828
output = model(seq)
2929

3030
output['human'] # (1, 896, 5313)

enformer_pytorch/enformer_pytorch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ def forward(
413413
return_only_embeddings = False,
414414
head = None
415415
):
416+
if isinstance(x, list):
417+
x = str_to_seq_indices(x)
418+
416419
dtype = x.dtype
417420

418421
if x.dtype == torch.long:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
name = 'enformer-pytorch',
55
packages = find_packages(exclude=[]),
66
include_package_data = True,
7-
version = '0.1.28',
7+
version = '0.1.29',
88
license='MIT',
99
description = 'Enformer - Pytorch',
1010
author = 'Phil Wang',

0 commit comments

Comments
 (0)