Fast5: R6 Class for loading and analysing nanopore FAST5 sequence...

Fast5R Documentation

R6 Class for loading and analysing nanopore FAST5 sequence files

Description

This class aims to simplify the handling and exploration of FAST5 files and provides simple methods for accessing information that can be used to identify the sequencing platform, flowcell used, sequencing kit and other metainformation that includes whether they are single- or- multi format files.

Public fields

fast5_file

the file.path to the query FAST5 file

Methods

Public methods


Method new()

Creates a new Fast5 object. This initialisation method performs other sanity checking of the defined file to ensure that it is indeed a file, a single file, is in HDF5 format and is either single- or multi-FAST5 compliant

Usage
Fast5$new(fast5_file = NA)
Arguments
fast5_file

The source FAST5 file.

Returns

A new Fast5 object.


Method is_single_fast5()

Check if a provided file corresponds to a single entry FAST5 file

Simple method to check whether the provided file path corresponds to a valid FAST5 file and if this file corresponds to a single FAST5 format.

Usage
Fast5$is_single_fast5()
Returns

boolean

Examples
promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$is_single_fast5()

Method is_multi_fast5()

Check if a provided file corresponds to a multiple entry FAST5 file

Simple method to check whether the provided file path corresponds to a valid FAST5 file and if this file corresponds to a multi FAST5 format.

Usage
Fast5$is_multi_fast5()
Returns

boolean

Examples
promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$is_multi_fast5()

Method get_platform()

Extract the sequencing platform identified within a FAST5 file

This method parses a FAST5 sequence file and extracts the information on specified sequencing platform - this can be used to identify e.g. gridion or promethion based information.

Usage
Fast5$get_platform()
Returns

vector of platform

Examples
promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_platform()

Method get_flowcell_id()

Extract the flowcell_id identified within a FAST5 file

This method parses a FAST5 sequence file and extracts the information on specified flowcell_id - this can be used to track flowcells used within a laboratory

Usage
Fast5$get_flowcell_id()
Returns

vector of flowcell_id

Examples
promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_flowcell_id()

Method get_exp_start_time()

Extract the experiment start time identified within a FAST5 file

This method parses a FAST5 sequence file and extracts the information on specified experiment start time - this can be used in palaeogenomics of such ancient datasets. Please note that the sampled start time is transformed using lubridate for presentation.

Usage
Fast5$get_exp_start_time()
Returns

vector of experiment_start_time

Examples
promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_exp_start_time()

Method get_read_count()

Extract the number of reads identified within a FAST5 file

This method parses a FAST5 sequence file and extracts the information on the read count - this is a simple count only

Usage
Fast5$get_read_count()
Returns

integer count of reads

Examples
promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_read_count()

Method get_flowcell_type()

Extract the flowcell type identified within a FAST5 file

This method parses a FAST5 sequence file and extracts the information on the flowcell type - this is based on user entry at start of run.

Usage
Fast5$get_flowcell_type()
Returns

vector of flowcell_types

Examples
promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_flowcell_type()

Method get_sequencing_kit()

Extract the sequencing kit identified within a FAST5 file

This method parses a FAST5 sequence file and extracts the information on the sequencing_kit used - this is based on user entry at start of run.

Usage
Fast5$get_sequencing_kit()
Returns

vector of sequencing_kit

Examples
promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_sequencing_kit()

Method get_info()

Extract salient experimental information from a FAST5 file

The FAST5 sequence file contains information relating to the sequencing platform, flowcell and library preparation kits used in a study. This method pulls these information into a data.frame.

Usage
Fast5$get_info(atomic = TRUE)
Arguments
atomic

whether a single entity (multi files only) should be considered (FALSE)

Returns

data.frame

Examples
promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_info(atomic=FALSE)

Method print()

print method to override the standard R6 printing

Usage
Fast5$print(...)
Arguments
...

stuff passed onwards


Method clone()

The objects of this class are cloneable with this method.

Usage
Fast5$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `Fast5$is_single_fast5`
## ------------------------------------------------

promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$is_single_fast5()

## ------------------------------------------------
## Method `Fast5$is_multi_fast5`
## ------------------------------------------------

promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$is_multi_fast5()

## ------------------------------------------------
## Method `Fast5$get_platform`
## ------------------------------------------------

promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_platform()

## ------------------------------------------------
## Method `Fast5$get_flowcell_id`
## ------------------------------------------------

promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_flowcell_id()

## ------------------------------------------------
## Method `Fast5$get_exp_start_time`
## ------------------------------------------------

promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_exp_start_time()

## ------------------------------------------------
## Method `Fast5$get_read_count`
## ------------------------------------------------

promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_read_count()

## ------------------------------------------------
## Method `Fast5$get_flowcell_type`
## ------------------------------------------------

promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_flowcell_type()

## ------------------------------------------------
## Method `Fast5$get_sequencing_kit`
## ------------------------------------------------

promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_sequencing_kit()

## ------------------------------------------------
## Method `Fast5$get_info`
## ------------------------------------------------

promFast5 <- system.file("extdata", "prom.fast5", package="floundeR")
promF5 <- Fast5$new(fast5_file=promFast5)
promF5$get_info(atomic=FALSE)

sagrudd/floundeR documentation built on Nov. 18, 2022, 10:31 a.m.