# GlobalChem DNA

GlobalChem has the concept of a DNA into a 1-Dimensional format that can be used later on for dna-smiles to dna-ligand interaction of lexical strings. This way we can perhaps make casual inference between sets of ligands and sets of dna or proteins later on.&#x20;

**Import the Package**

```
from global_chem_extensions import GlobalChemExtensions
bioinformatics = GlobalChemExtensions().bioinformatics()
```

**Initialize a DNA Object**

```
dna_molecule = bioinformatics.initialize_globalchem_dna(
        peptide_sequence='TGGGGAGGGTG',
)
```

**Convert to SMILES**

{% tabs %}
{% tab title="Code" %}

```
dna_molecule.convert_to_smiles()
```

{% endtab %}

{% tab title="Output" %}

```
Nc1nc2nc(C3CC(OP(=O)([O-])OCC4OC(Cc5c[nH]c(=O)[nH]c5=O)CC4OP(=O)([O-])OCC4OC(c5nc6nc(N)[nH]c(=O)c6[nH]5)CC4OP(=O)([O-])OCC4OC(Cc5c[nH]c(=O)[nH]c5=O)CC4OP(=O)([O-])OCC4OC(c5nc6nc(N)[nH]c(=O)c6[nH]5)CC4OP(=O)([O-])OCC4OC(Cc5c[nH]c(=O)[nH]c5=O)CC4OP(=O)([O-])OCC4OC(c5nc6nc(N)[nH]c(=O)c6[nH]5)CC4OP(=O)([O-])OCC4OC(Cc5c[nH]c(=O)[nH]c5=O)CC4OP(=O)([O-])OCC4OC(c5nc6ncnc(N)c6[nH]5)CC4OP(=O)([O-])OCC4OC(c5nc6ncnc(N)c6[nH]5)CC4OP(=O)([O-])OCC4OC(c5nc6ncnc(N)c6[nH]5)CC4OP(=O)([O-])OCC4OC(c5nc6ncnc(N)c6[nH]5)CC4OP(=O)([O-])[O-])C(COP(=O)([O-])OC4CCOC4CO)O3)[nH]c2c(=O)[nH]1
```

{% endtab %}
{% endtabs %}

**Convert to SMARTS**

{% tabs %}
{% tab title="Code" %}

```
dna_molecule.convert_to_smarts()
```

{% endtab %}

{% tab title="Output" %}

```
[#7]-[#6]1:[#7]:[#6]2:[#7]:[#6](-[#6]3-[#6]-[#6](-[#8]-[#15](=[#8])(-[#8-])-[#8]-[#6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#15](=[#8])(-[#8-])-[#8]-[#6]-[#6]4-[#8]-[#6](-[#6]5:[#7]:[#6]6:[#7]:[#6]:[#7]:[#6](-[#7]):[#6]:6:[#7H]:5)-[#6]-[#6]-4-[#8]-[#15](=[#8])(-[#8-])-[#8]-[#6]-[#6]4-[#8]-[#6](-[#6]5:[#7]:[#6]6:[#7]:[#6]:[#7]:[#6](-[#7]):[#6]:6:[#7H]:5)-[#6]-[#6]-4-[#8]-[#15](=[#8])(-[#8-])-[#8-])-[#6](-[#6]-[#8]-[#15](=[#8])(-[#8-])-[#8]-[#6]4-[#6]-[#6]-[#8]-[#6]-4-[#6]-[#8])-[#8]-3):[#7H]:[#6]:2:[#6](=[#8]):[#7H]:1
```

{% endtab %}
{% endtabs %}

**Visualize the DNA Strand**

{% tabs %}
{% tab title="Code" %}

```
dna_molecule.visualize_strand()
```

{% endtab %}

{% tab title="Output" %}
![](https://538359177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUSbA3Zf4EXyGn0UpfW5b%2Fuploads%2FXvZIivwqYJGvu0rnggh9%2FScreen%20Shot%202022-04-07%20at%2011.01.39%20PM.png?alt=media\&token=c26e18e6-b655-499e-a481-9995404560b2)
{% endtab %}
{% endtabs %}

**Visualize and Label the DNA Strand**

{% tabs %}
{% tab title="Code" %}

```
dna_molecule.label_feature(
    start=0,
    end=3,
    label='Start'
)

dna_molecule.label_feature(
    start=4,
    end=8,
    label='Middle'
)


dna_molecule.label_feature(
    start=4,
    end=8,
    label='Middle 2',
    color='Blue'
)

dna_molecule.label_feature(
    start=8,
    end=12,
    label='End',
    color='Green'
)

dna_molecule.visualize_strand()
```

{% endtab %}

{% tab title="Output" %}
![](https://538359177-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUSbA3Zf4EXyGn0UpfW5b%2Fuploads%2F96YpVOg20hNQQTINWQOu%2FScreen%20Shot%202022-04-07%20at%2011.04.39%20PM.png?alt=media\&token=b54dbd0e-bca9-428b-ac6e-66c0d59be516)
{% endtab %}
{% endtabs %}

**Save the DNA Image to a file**

```
dna.save_to_image() 
```
