Skip to content

Commit

Permalink
Fix README's example
Browse files Browse the repository at this point in the history
- dg -> ddg
- don't use typing.List that has to be imported
  • Loading branch information
jjti committed Mar 4, 2021
1 parent 8ca6a29 commit 21db7aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ pip install seqfold
### Python

```python
from seqfold import dg, dg_cache, fold, Struct
from seqfold import dg, dg_cache, fold

# just returns minimum free energy
dg("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC", temp = 37.0) # -12.94

# `fold` returns a list of `seqfold.Struct` from the minimum free energy structure
structs: List[Struct] = fold("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC")
structs = fold("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC")
print(sum(s.e for s in structs)) # -12.94, same as dg()
for struct in structs:
print(struct) # prints the i, j, ddg, and description of each structure

# `dg_cache` returns a 2D array where each (i,j) combination returns the MFE from i to j inclusive
cache: List[List[float]] = dg_cache("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC")
cache = dg_cache("GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC")
```

### CLI
Expand Down Expand Up @@ -61,7 +61,7 @@ $ seqfold GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC -t 32
$ seqfold GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC -t 32 -v -l
GGGAGGTCGTTACATCTGGGTAACACCGGTACTGATCCGGTGACCTCCC
((((((((.((((......))))..((((.......)))).))))))))
i j dg description
i j ddg description
0 48 -2.2 STACK:GG/CC
1 47 -2.2 STACK:GG/CC
2 46 -1.4 STACK:GA/CT
Expand Down

0 comments on commit 21db7aa

Please sign in to comment.