Package 'minimapR'

Title: Wrapper for 'minimap2'
Description: Wrapper for 'Minimap2'. 'Minimap2' is a very valuable long read aligner for the Pacbio and Oxford Nanopore Technologies sequencing platforms. 'minimapR' is an R wrapper for 'minimap2' which was developed by Heng Li <[email protected]>. *SPECIAL NOTES 1. Examples can only be run from 'GitHub' installation. 2. If using a Windows operating system, installation of the 'MSYS2' Linux emulator is required. 3. If using a Mac operating system, installation of 'Homebrew' is required. Li, Heng (2018) <doi:10.1093/bioinformatics/bty191> "Minimap2: pairwise alignment for nucleotide sequences".
Authors: Jake Reed [aut, cre] , Pradyun Pulipaka [ctb]
Maintainer: Jake Reed <[email protected]>
License: MIT + file LICENSE
Version: 0.0.1.0
Built: 2024-08-21 06:07:11 UTC
Source: CRAN

Help Index


minimap2

Description

This function is a wrapper for the command line tool minimap2. minimap2 is a long read sequencing alignment tool that is used to align long reads to a reference genome.

Usage

minimap2(
  reference,
  query_sequences,
  output_file_prefix,
  a = TRUE,
  preset_string = "map-hifi",
  threads = 1,
  return = FALSE,
  verbose = TRUE,
  ...
)

Arguments

reference

Reference genome to align the query sequences

query_sequences

Query sequences to align to the reference genome

output_file_prefix

Output file to save the alignment results

a

Logical value to use the preset string with the -a flag

preset_string

Preset string to use with the -x flag

threads

Number of threads to use

return

Logical value to return the alignment results

verbose

Logical value to print progress of the installation

...

Additional arguments to pass to minimap2

Value

This function returns the line needed to add minimap2 to PATH

Examples

## Not run: 
reference <- system.file("extdata/S288C_ref_genome.fasta", package = "minimapR")
query_sequences <- system.file("extdata/yeast_sample_hifi.fastq.gz", package = "minimapR")
out_dir <- system.file("extdata/test_out", package = "minimapR")
output_file_prefix <- paste0(out_dir, "/yeast_sample_hifi")
bam_out <- minimap2(reference, 
 query_sequences, 
 output_file_prefix,
 threads = 4,
 preset_string = "map-hifi", 
 return = TRUE, 
 verbose = TRUE)

## End(Not run)

## Not run: 
reference <- system.file("extdata/GRCh38_chr1_50m.fa", package = "minimapR")
query_sequences <- system.file("extdata/ont_hs_sample.fastq.gz", package = "minimapR")
out_dir <- system.file("extdata/test_out", package = "minimapR")
output_file_prefix <- paste0(out_dir, "/ont_hs_sample")
bam_out <- minimap2(reference, 
 query_sequences, 
 output_file_prefix,
 threads = 4,
 preset_string = "map-hifi",
 return = TRUE, 
 verbose = TRUE)

## End(Not run)

minimap2_check

Description

Check if minimap2 is installed

Usage

minimap2_check(return = TRUE)

Arguments

return

Logical value to return the path of minimap2

Value

If minimap2 is installed, this function returns the path of minimap2 (character).

Examples

minimap2_check(return = TRUE)

minimap2_installation

Description

This function prints installation instructions specific to the user's operating system.

Usage

minimap2_installation(source_directory, verbose = TRUE, return = FALSE)

Arguments

source_directory

Source directory to install minimap2. Do not include minimap2 name in the source directory. Note that this must be entered as a full path location.

verbose

Logical value to print progress of the installation

return

This logical value causes the minimap2_install function to return the path of minimap2

Value

This function returns the path of the installed 'minimap2' tool (character).

Examples

## Not run: 
install_dir <- file.path("/dir/to/install")
minimap2_path <- minimap2_installation(source_directory = install_dir, verbose = FALSE)

## End(Not run)

minimap2_install

Description

Install minimap2 from Heng Li's github repository. If using a Windows operating system, installation of the MSYS2 Linux emulator is required.

Usage

mm2_install(source_directory, verbose = TRUE, return = FALSE)

Arguments

source_directory

Source directory to install minimap2. Do not include minimap2 name in the source directory. Note that this must be entered as a full path location.

verbose

Logical value to print progress of the installation

return

This logical value causes the minimap2_install function to return the path of minimap2

Value

If 'minimap2' is not installed, this function installs it on linux and returns the path of the installed 'minimap2' tool (character).

Examples

## Not run: 
install_dir <- file.path("/dir/to/install")
minimap2_path <- mm2_install(source_directory = install_dir, verbose = FALSE)

## End(Not run)

samtools_check

Description

Check if samtools is installed

Usage

samtools_check(return = TRUE)

Arguments

return

Logical value to return the path of samtools

Value

If 'samtools' is installed, this function returns the path of samtools (character).

Examples

samtools_check(return = TRUE)

samtools_install

Description

Install samtools with conda

Usage

samtools_install(verbose = TRUE)

Arguments

verbose

Logical value to print progress of the installation

Value

If 'samtools' is not installed, this function installs it on linux and returns the path of the installed 'samtools' tool (character).

Examples

## Not run: 
samtools_install()

## End(Not run)