<commit_before># FornaContainer

In many situations, the user interaction is superfluous and the desired goal is
to simply display a secondary structure on a web page. This is a common
scenario in, for example, servers that predict a secondary structure. The
output, a dot-bracket string can simply be added to a `FornaContainer` object
to display.

## Trivial Example

Below is an example of a simple web page which uses a `FornaContainer` to show
a simple RNA molecule:

![blah blah](https://raw.githubusercontent.com/pkerpedjiev/fornac/develop/doc/img/forna-container-screenshot.png "An example of the FornaContainer")

The code for creating this web page is rather straightforward. After importing
some necessary javascript files, we create a container using `new
FornaContainer("#rna_ss", {'applyForce': false})`, passing in `#rna_ss` as the
id of the `div` which will hold the container and then populate it with a
structure and sequence using `container.addRNA`:

```html
<!DOCTYPE html>
<meta charset="utf-8">

This is an RNA container.
<div id='rna_ss'> </div>
This after the RNA container.

    <link rel='stylesheet' type='text/css' href='styles/fornac.css' />
    <script type='text/javascript' src='scripts/fornac.js'></script>
    <script type='text/javascript'>
        var container = new FornaContainer("#rna_ss", {'applyForce': false});

        var options = {'structure': '((..((....)).(((....))).))',
                        'sequence': 'CGCUUCAUAUAAUCCUAAUGACCUAU'
        };

        container.addRNA(options.structure, options);
    </script>
```

### Cofolded sequences

Display two cofolded sequences using the format of [RNAcofold](http://rna.tbi.univie.ac.at/cgi-bin/RNAcofold.cgi):

![Cofolded sequences](https://raw.githubusercontent.com/pkerpedjiev/fornac/master/doc/img/cofold_example.png "An example of cofolded sequences displayed using the FornaContainer")

```javascript
    var container = new fornac.FornaContainer("#cofold_ss",
            {'applyForce': false, 'allowPanningAndZooming': true, 'initialSize':[500,300]});
                                                     
    var options = {'structure': '..((((...))))...((...((...((..&............))...))...))..',
        'sequence': 'ACGAUCAGAGAUCAGAGCAUACGACAGCAG&ACGAAAAAAAGAGCAUACGACAGCAG'
    };                                                                                     
    container.addRNA(options.structure, options);
    container.setSize(); 
```

## Options

The `FornaContainer` supports a number of options to allow users to customize how the RNA will be presented.

### applyForce<commit_msg>Added a little documentation about getStructureDotBracket<commit_after># FornaContainer

In many situations, the user interaction is superfluous and the desired goal is
to simply display a secondary structure on a web page. This is a common
scenario in, for example, servers that predict a secondary structure. The
output, a dot-bracket string can simply be added to a `FornaContainer` object
to display.

## Trivial Example

Below is an example of a simple web page which uses a `FornaContainer` to show
a simple RNA molecule:

![blah blah](https://raw.githubusercontent.com/pkerpedjiev/fornac/develop/doc/img/forna-container-screenshot.png "An example of the FornaContainer")

The code for creating this web page is rather straightforward. After importing
some necessary javascript files, we create a container using `new
FornaContainer("#rna_ss", {'applyForce': false})`, passing in `#rna_ss` as the
id of the `div` which will hold the container and then populate it with a
structure and sequence using `container.addRNA`:

```html
<!DOCTYPE html>
<meta charset="utf-8">

This is an RNA container.
<div id='rna_ss'> </div>
This after the RNA container.

    <link rel='stylesheet' type='text/css' href='styles/fornac.css' />
    <script type='text/javascript' src='scripts/fornac.js'></script>
    <script type='text/javascript'>
        var container = new FornaContainer("#rna_ss", {'applyForce': false});

        var options = {'structure': '((..((....)).(((....))).))',
                        'sequence': 'CGCUUCAUAUAAUCCUAAUGACCUAU'
        };

        container.addRNA(options.structure, options);
    </script>
```

### Cofolded sequences

Display two cofolded sequences using the format of [RNAcofold](http://rna.tbi.univie.ac.at/cgi-bin/RNAcofold.cgi):

![Cofolded sequences](https://raw.githubusercontent.com/pkerpedjiev/fornac/master/doc/img/cofold_example.png "An example of cofolded sequences displayed using the FornaContainer")

```javascript
    var container = new fornac.FornaContainer("#cofold_ss",
            {'applyForce': false, 'allowPanningAndZooming': true, 'initialSize':[500,300]});
                                                     
    var options = {'structure': '..((((...))))...((...((...((..&............))...))...))..',
        'sequence': 'ACGAUCAGAGAUCAGAGCAUACGACAGCAG&ACGAAAAAAAGAGCAUACGACAGCAG'
    };                                                                                     
    container.addRNA(options.structure, options);
    container.setSize(); 
```

## Programmatic Use

### Extracting the secondary structure (dot-bracket string)

```
fornac.getStructuresDotBracket()
```

Returns a dot-bracket representation of the visible structure. This is useful
if integrating this component with structure editing functionality. Returns an 
array of length 2 (e.g. `['CCCCAAAAGGGG', '((((....))))']`).


## Options

The `FornaContainer` supports a number of options to allow users to customize how the RNA will be presented.

### applyForce
{'fraction_non_alphanumeric': 0.13238180196253346, 'fraction_numerical': 0.0026761819803746653, 'mean_word_length': 3.2631178707224335, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '157603', 'n_tokens_mistral': 1668, 'n_tokens_neox': 1556, 'n_words': 506}