Skip to content

Commit

Permalink
Add language tags to docs code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
eachanjohnson committed May 16, 2023
1 parent 6d3a544 commit 995a65f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 30 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Python utilities for working with nucleotide sequence strings.

Install the pre-compiled version from PyPI:

```
```bash
pip install streq
```

### From source

Clone the repository, then `cd` into it. Then run:

```
```bash
pip install -e .
```

Expand All @@ -29,7 +29,7 @@ Sequences can be upper or lower case, and case will be preserved through transfo

Reverse complement.

```
```python
>>> import streq as sq
>>>
>>> sq.reverse_complement('ATCG')
Expand All @@ -38,7 +38,7 @@ Reverse complement.

Convert between RNA and DNA alphabets.

```
```python
>>> sq.to_rna('ATCG')
'AUCG'
>>> sq.to_dna('AUCG')
Expand All @@ -47,7 +47,7 @@ Convert between RNA and DNA alphabets.

Slice circular sequences such as plasmids or bacterial genomes.

```
```python
>>> sq.Circular('ATCG')[-1:3]
'GATC'
>>> sq.reverse_complement(sq.Circular('ATCG'))[-1:3]
Expand All @@ -56,7 +56,7 @@ Slice circular sequences such as plasmids or bacterial genomes.

Cases are preserved throughout the transformations.

```
```python
>>> sq.reverse_complement(sq.Circular('ATCg'))
'cGAT'
```
Expand All @@ -65,7 +65,7 @@ Cases are preserved throughout the transformations.

Get GC and pyrimidine content.

```
```python
>>> sq.gc_content('AGGG')
0.75
>>> sq.pyrimidine_content('AUGGG')
Expand All @@ -74,7 +74,7 @@ Get GC and pyrimidine content.

Get autocorrelation (rough indicator for secondary structure).

```
```python
>>> sq.correlation('AACC')
0.0
>>> sq.correlation('AAATTT')
Expand All @@ -87,7 +87,7 @@ Get autocorrelation (rough indicator for secondary structure).

Provide a second sequence to get correlation between sequences.

```
```python
>>> sq.correlation('AAA', 'TTT')
0.0
>>> sq.correlation('AAA', 'AAA')
Expand All @@ -98,7 +98,7 @@ Provide a second sequence to get correlation between sequences.

Calculate Levenshtein (insert, delete, mutate) distance.

```
```python
>>> sq.levenshtein('AAATTT', 'AAATTT')
0
>>> sq.levenshtein('AAATTT', 'ACTTT')
Expand All @@ -109,7 +109,7 @@ Calculate Levenshtein (insert, delete, mutate) distance.

Calculate Hamming (mismatch) distance.

```
```python
>>> sq.hamming('AAA', 'ATA')
1
>>> sq.hamming('AAA', 'ATT')
Expand All @@ -122,7 +122,7 @@ Calculate Hamming (mismatch) distance.

Search sequences using IUPAC symbols and iterate through the results.

```
```python
>>> for (start, end), match in sq.find_iupac('ARY', 'AATAGCAGTGTGAAC'):
... print(f"Found ARY at {start}:{end}: {match}")
...
Expand All @@ -134,7 +134,7 @@ Found ARY at 12:15: AAC

Find common Type IIS restriction sites:

```
```python
>>> sq.which_re_sites('AAAGAAG')
()
>>> sq.which_re_sites('AAAGAAGAC')
Expand Down
4 changes: 2 additions & 2 deletions docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

Install the pre-compiled version from PyPI:

```
```bash
pip install streq
```

## From source

Clone the repository, then `cd` into it. Then run:

```
```bash
pip install -e .
```
26 changes: 11 additions & 15 deletions docs/source/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Sequences can be upper or lower case, and case will be preserved through transfo

Reverse complement.

```
```python
>>> import streq as sq
>>>
>>> sq.reverse_complement('ATCG')
Expand All @@ -16,7 +16,7 @@ Reverse complement.

Convert between RNA and DNA alphabets.

```
```python
>>> sq.to_rna('ATCG')
'AUCG'
>>> sq.to_dna('AUCG')
Expand All @@ -25,7 +25,7 @@ Convert between RNA and DNA alphabets.

Slice circular sequences such as plasmids or bacterial genomes.

```
```python
>>> sq.Circular('ATCG')[-1:3]
'GATC'
>>> sq.reverse_complement(sq.Circular('ATCG'))[-1:3]
Expand All @@ -34,7 +34,7 @@ Slice circular sequences such as plasmids or bacterial genomes.

Cases are preserved throughout the transformations.

```
```python
>>> sq.reverse_complement(sq.Circular('ATCg'))
'cGAT'
```
Expand All @@ -43,7 +43,7 @@ Cases are preserved throughout the transformations.

Get GC and pyrimidine content.

```
```python
>>> sq.gc_content('AGGG')
0.75
>>> sq.pyrimidine_content('AUGGG')
Expand All @@ -52,7 +52,7 @@ Get GC and pyrimidine content.

Get autocorrelation (rough indicator for secondary structure).

```
```python
>>> sq.correlation('AACC')
0.0
>>> sq.correlation('AAATTT')
Expand All @@ -65,7 +65,7 @@ Get autocorrelation (rough indicator for secondary structure).

Provide a second sequence to get correlation between sequences.

```
```python
>>> sq.correlation('AAA', 'TTT')
0.0
>>> sq.correlation('AAA', 'AAA')
Expand All @@ -76,7 +76,7 @@ Provide a second sequence to get correlation between sequences.

Calculate Levenshtein (insert, delete, mutate) distance.

```
```python
>>> sq.levenshtein('AAATTT', 'AAATTT')
0
>>> sq.levenshtein('AAATTT', 'ACTTT')
Expand All @@ -87,7 +87,7 @@ Calculate Levenshtein (insert, delete, mutate) distance.

Calculate Hamming (mismatch) distance.

```
```python
>>> sq.hamming('AAA', 'ATA')
1
>>> sq.hamming('AAA', 'ATT')
Expand All @@ -100,7 +100,7 @@ Calculate Hamming (mismatch) distance.

Search sequences using IUPAC symbols and iterate through the results.

```
```python
>>> for (start, end), match in sq.find_iupac('ARY', 'AATAGCAGTGTGAAC'):
... print(f"Found ARY at {start}:{end}: {match}")
...
Expand All @@ -112,15 +112,11 @@ Found ARY at 12:15: AAC

Find common Type IIS restriction sites:

```
```python
>>> sq.which_re_sites('AAAGAAG')
()
>>> sq.which_re_sites('AAAGAAGAC')
('BbsI',)
>>> sq.which_re_sites('AAAGAAGACACCTGC')
('BbsI', 'PaqCI')
```

## Documentation

Check the API [here](https://streq.readthedocs.io/).

0 comments on commit 995a65f

Please sign in to comment.