Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nemitheasura committed Oct 3, 2023
1 parent 584352c commit df8ce6d
Showing 1 changed file with 0 additions and 152 deletions.
152 changes: 0 additions & 152 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,164 +250,12 @@ The `class` column contains information whether the given read was recognized as
| qc_tag | quality tag assigned by nanopolish polya function |


### Data postprocessing

The **Ninetails** package offers possibility of further processing of obtained files (objects), including visualizations.

#### Reading file(s) into R

Data postprocessing module needs output from main **Ninetails** pipeline (e.g. `check_tails()`) to work. It can read a single output file with `read_class_single()` in case of **read_classes** dataframe and `read_residue_single()` in case of **nonadenosine_residues** dataframe:

``` r
class_path <- "/directory/with/ninetails/read_class_output.tsv"
class_data <- ninetails::read_class_single(class_path)

residue_path <- "/directory/with/ninetails/nonadenosine_residues_output.tsv"
residue_data <- ninetails::read_residue_single(residue_path)

```

### Visual inspection of reads of interest

**Ninetails** has built-in functions `plot_squiggle()` and `plot_tail_range()` for plotting whole reads and the poly(A) tail region, respectively.

With their help you can visualise: \* raw signal (`rescale=FALSE`) \* signal scaled to picoamperes [pA] per second [s] (`rescale=TRUE`)

In addition, the graphs can depict only signal data (`moves=FALSE`) or they can also contain informations regarding the change of state between the subsequent k-mers (moves) (`moves=TRUE`).

#### Plotting an entire signal

The following example demonstrates how to use the `plot_squiggle()` function:

``` r
plot <- ninetails::plot_squiggle(
readname = "0226b5df-f9e5-4774-bbee-7719676f2ceb",
nanopolish = system.file('extdata',
'test_data',
'nanopolish_output.tsv',
package = 'ninetails'),
sequencing_summary = system.file('extdata',
'test_data',
'sequencing_summary.txt',
package = 'ninetails'),
workspace = system.file('extdata',
'test_data',
'basecalled_fast5',
package = 'ninetails'),
basecall_group = 'Basecall_1D_000',
moves = FALSE,
rescale = TRUE)

print(plot)
```

The output of the above command is the following graph: ![plot_squiggle](https://user-images.githubusercontent.com/68285258/183749085-633a8b95-f36a-4484-bb47-4916807b05e5.png)

If the (`moves=TRUE`) argument is passed, then the graph also contains information regarding moves, which looks as follows: ![plot_squiggle_moves](https://user-images.githubusercontent.com/68285258/183749261-162683a1-b13c-4cab-b2b8-e8a360831fb2.png)

#### Plotting tail range

The `plot_tail_range()` function accepts the same arguments as the abovementioned function. An example usage looks as follows:

``` r
plot <- ninetails::plot_tail_range(
readname = "0226b5df-f9e5-4774-bbee-7719676f2ceb",
nanopolish = system.file('extdata',
'test_data',
'nanopolish_output.tsv',
package = 'ninetails'),
sequencing_summary = system.file('extdata',
'test_data',
'sequencing_summary.txt',
package = 'ninetails'),
workspace = system.file('extdata',
'test_data',
'basecalled_fast5',
package = 'ninetails'),
basecall_group = 'Basecall_1D_000',
moves = TRUE,
rescale = TRUE)

print(plot)
```

Which outputs: ![tail_range](https://user-images.githubusercontent.com/68285258/183749972-58b40238-d2e6-4f2a-b134-c462c3b0bbc2.png)

Or below, if the (`moves=TRUE`) argument is passed: ![tail_range_moves](https://user-images.githubusercontent.com/68285258/183749982-e8dc21fd-2220-4256-85c3-c60b0b25afe8.png)

#### Plotting the tail segment of interest

Ninetails allows you to visualise a particular fragment among the list of fragments generated by the `create_tail_chunk_list()` function. This is what the function `plot_tail_chunk()` is for. This function only allows to preview the raw signal, currently there is no built-in scaling to picoamperes [pA].

An example of how the `plot_tail_chunk()` function works:

``` r
example <- ninetails::plot_tail_chunk(
chunk_name = "5c2386e6-32e9-4e15-a5c7-2831f4750b2b_1",
tail_chunk_list = tcl)

print(example)
```

And an example output:

![chunk](https://user-images.githubusercontent.com/68285258/183750409-9b89eb98-790c-4cb8-8e61-a69d728d0476.png)

### Plotting the gramian angular fields

The package allows to create a visual representation of gramian angular fields (GAFs) using `ggplot2`.

#### Plotting single GASF of interest

The `plot_gaf()` function draws a single matrix of interest. It requires the name of a particular segment and a list of matrices produced by the `create_gaf_list()` function as an input.

Below is an example of the usage of the `plot_gaf()` function. Please note that in order for this example to work properly, one must first execute the 3 first commands from the **Classification of reads using standalone functions** section.

``` r
example_gaf <- ninetails::plot_gaf(
gaf_name = "5c2386e6-32e9-4e15-a5c7-2831f4750b2b_1",
gaf_list = gl,
save_file = TRUE)

print(example_gaf)
```

And here is an example output:

![test_gaf_2channel](https://user-images.githubusercontent.com/68285258/183750865-9ab4b705-230b-4e5e-9f0a-d29acec08bfc.png)

#### Plotting multiple GASFs

**Ninetails** also allows the user to plot the entire list of matrices produced by the `create_gaf_list()` function at once. The files will be saved in the current working directory. An example of usage is given below:

``` r
ninetails::plot_multiple_gaf(gaf_list = gl,
num_cores = 10)
```

And this results in multiple plots, like this:

![gafs](https://user-images.githubusercontent.com/68285258/183752592-177fe651-8791-4b4d-8c1e-49273a9c8283.png)


<div>

> **Warning**
>
> However, it is advisable to use this function with caution. The data contained in a `gaf_list` object tends to be large. Drawing multiple graphs at once may overload the system and cause it to crash.
>
</div>
## Citation

Please cite **Ninetails** as: Gumińska N., Matylla-Kulińska K., Krawczyk P., Orzeł W., Maj M., Mroczek S., Dziembowski A. Direct detection of non-adenosine nucleotides within poly(A) tails -- a new tool for the analysis of post-transcriptional mRNA tailing, 27th Annual Meeting of the RNA Society, Boulder, Colorado, May 31 to June 5, 2022.

Preprint is in the preparation.

## Future plans

- model finetuning
- additional post-processing & data analysis features

## Troubleshooting

Expand Down

0 comments on commit df8ce6d

Please sign in to comment.