File size: 2,741 Bytes
4bf9a40
b1c7433
 
 
 
 
 
4bf9a40
 
b1c7433
 
 
 
 
 
 
 
 
 
 
 
8fd637e
b1c7433
 
 
 
 
 
 
 
 
 
0d880d2
 
 
 
 
 
b1c7433
 
0d880d2
 
 
 
 
 
b1c7433
0d880d2
 
 
 
 
 
 
 
 
 
 
 
 
b1c7433
0d880d2
b1c7433
 
 
 
 
 
 
 
 
f161796
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
license: mit
pipeline_tag: text-generation
library_name: transformers
tags:
- enhancer-generation
- jamba
---

# EnhancAR Sorted
EnhancAR Sorted is an autoregressive generative model of enhancer homology families, trained on 233,158,475 enhancers extracted from 241 vertebrate genomes. By "unrolling" homology families (enhancer sequences are sorted into sets of homology sequences, and input data is sequences concatenated to each other with a separator token delimiting different sequences), EnhancAR-Sorted learns to generate new sequences that conserve the function of prompt sequences. We demonstrate that this can be used to design new enhancers "by example", which is particularly useful when the function of enhancers is not known a priori.

## Model Details

- **Developed by:** Kevin K. Yang, Alex J. Lee, Andrew G. Duncan, Micaela E Consens, Lorin Crawford, Jennifer A. Mitchell, and Alan M. Moses
- **Model type:** Hybrid state-space-model transformer architecture with mixture-of-experts
- **License:** MIT

## Model Sources

- **Repository:** https://github.com/microsoft/enhancar
- **Data:** https://zenodo.org/records/19052620

## Uses

EnhancAR-sorted is a generative enhancer model that can be used for:
* Unconditional generation of enhancer sequences
* Conditional design of shortened enhancer sequences

## Getting Started with EnhancAR-Sorted

**Requirements**:
* PyTorch: 2.7.1
* CUDA: 12.8 and above
  
```py
pip install transformers==4.48.2 huggingface_hub
```

**Example generation**:

The following shows an example for generating an unconditional sequence. To generate a sequence conditionally, replace the input_sequence with a string of the form:
{homolog A/homolog B/.../homolog N}.

For a full example, please see the [Google Colab]()

```py
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig

config = AutoConfig.from_pretrained("aduncan94/EnhancAR-Sorted", trust_remote_code=True)
config.use_mamba_kernels = False
model = AutoModelForCausalLM.from_pretrained("aduncan94/EnhancAR-Sorted", trust_remote_code=True, config=config).to("cuda")
tokenizer = AutoTokenizer.from_pretrained("aduncan94/EnhancAR-Sorted", trust_remote_code=True)

input_sequence = "{"
inputs = tokenizer(input_sequence, return_tensors="pt", return_token_type_ids=False, add_special_tokens=False)

outputs = generate_sequence(inputs, model, tokenizer)
output = tokenizer.batch_decode(outputs, skip_special_tokens=False)[0]

print(output)
```

## Technical Specifications

### Compute Infrastructure
* The 170M-parameter model was trained on 8 MI300X GPUs

## Citation

If you use the code, models, or results, please cite our [preprint](https://www.biorxiv.org/content/10.64898/2026.04.13.718170v1)