# uniprot


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## UniProt Queries

------------------------------------------------------------------------

<a
href="https://github.com/sky1ove/kprot/blob/main/kprot/uniprot.py#L18"
target="_blank" style="float:right; font-size:smaller">source</a>

### get_uniprot_seq

``` python

def get_uniprot_seq(
    uniprot_id:str
)->str:

```

*Queries the UniProt database to retrieve the protein sequence for a
given UniProt ID.*

``` python
get_uniprot_seq("P04626")[:60]
```

------------------------------------------------------------------------

<a
href="https://github.com/sky1ove/kprot/blob/main/kprot/uniprot.py#L31"
target="_blank" style="float:right; font-size:smaller">source</a>

### get_uniprot_features

``` python

def get_uniprot_features(
    uniprot_id:str
)->dict:

```

*Given a UniProt ID, fetch the protein metadata and annotated features.*

``` python
get_uniprot_features("P04626").keys()
```

------------------------------------------------------------------------

<a
href="https://github.com/sky1ove/kprot/blob/main/kprot/uniprot.py#L58"
target="_blank" style="float:right; font-size:smaller">source</a>

### get_uniprot_kd

``` python

def get_uniprot_kd(
    uniprot_id:str
)->list:

```

*Query Domain: Protein kinase entries based on a UniProt ID.*

``` python
get_uniprot_kd("P04626")
```

------------------------------------------------------------------------

<a
href="https://github.com/sky1ove/kprot/blob/main/kprot/uniprot.py#L83"
target="_blank" style="float:right; font-size:smaller">source</a>

### get_uniprot_type

``` python

def get_uniprot_type(
    uniprot_id:str, # UniProt accession to inspect
    type_:str='Signal', # feature type to filter for
)->list[dict[str, object]] | list[str]:

```

*Get region sequences for a UniProt feature type.*

``` python
get_uniprot_type("P04626", "Signal")[:1]
```

## Sequence Mutation

------------------------------------------------------------------------

<a
href="https://github.com/sky1ove/kprot/blob/main/kprot/uniprot.py#L118"
target="_blank" style="float:right; font-size:smaller">source</a>

### apply_mut_single

``` python

def apply_mut_single(
    seq:str, # protein sequence to edit
    mutations:str, # point mutations such as E709A
    start_pos:int=1, # residue number of seq[0]
)->str:

```

*Apply point mutations to a protein sequence.*

``` python
apply_mut_single("MEEPQ", "M1A", "E2S")
```

------------------------------------------------------------------------

<a
href="https://github.com/sky1ove/kprot/blob/main/kprot/uniprot.py#L143"
target="_blank" style="float:right; font-size:smaller">source</a>

### apply_mut_complex

``` python

def apply_mut_complex(
    seq:str, # protein sequence to edit
    mut:str, # composite mutation such as G776delinsVC/S783C
    start_pos:int=1, # residue number of seq[0]
)->str:

```

*Apply a composite mutation string to a protein sequence.*

``` python
her2_seq = "LRKVKVLGSGAFGTVYKGIWIPDGENVKIPVAIKVLRENTSPKANKEILDEAYVMAGVGSPYVSRLLGICLTSTVQLVTQLMPYGCLLDHVRENRGRLGSQDLLNWCMQIAKGMSYLEDVRLVHRDLAARNVLVKSPNHVKITDFGLARLLDIDETEYHADGGKVPIKWMALESILRRRFTHQSDVWSYGVTVWELMTFGAKPYDGIPAREIPDLLEKGERLPQPPICTIDVYMIMVKCWMIDSECRPRFRELVSEFSRMARDPQRFV"
apply_mut_complex(her2_seq, "G776delinsVC/S783C", start_pos=720)[:25]
```

------------------------------------------------------------------------

<a
href="https://github.com/sky1ove/kprot/blob/main/kprot/uniprot.py#L188"
target="_blank" style="float:right; font-size:smaller">source</a>

### compare_seq

``` python

def compare_seq(
    seq1:str, # reference sequence
    seq2:str, # sequence to compare against seq1
    start_pos:int=1, # residue number of seq1[0]
    label1:str='Original', # label for the first sequence block
    label2:str='Mutant', # label for the second sequence block
    visualize:bool=True, # include block alignment output when True
    return_text:bool=False, # return the rendered text instead of None
)->str | None:

```

*Align two protein sequences and summarize the differences.*

``` python
print(compare_seq("MEEPQ", "MAEPQ", return_text=True))
```
