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 |
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.
minimap2( reference, query_sequences, output_file_prefix, a = TRUE, preset_string = "map-hifi", threads = 1, return = FALSE, verbose = TRUE, ... )
minimap2( reference, query_sequences, output_file_prefix, a = TRUE, preset_string = "map-hifi", threads = 1, return = FALSE, verbose = TRUE, ... )
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 |
This function returns the line needed to add minimap2 to PATH
## 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)
## 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)
Check if minimap2 is installed
minimap2_check(return = TRUE)
minimap2_check(return = TRUE)
return |
Logical value to return the path of minimap2 |
If minimap2 is installed, this function returns the path of minimap2 (character).
minimap2_check(return = TRUE)
minimap2_check(return = TRUE)
This function prints installation instructions specific to the user's operating system.
minimap2_installation(source_directory, verbose = TRUE, return = FALSE)
minimap2_installation(source_directory, verbose = TRUE, return = FALSE)
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 |
This function returns the path of the installed 'minimap2' tool (character).
## Not run: install_dir <- file.path("/dir/to/install") minimap2_path <- minimap2_installation(source_directory = install_dir, verbose = FALSE) ## End(Not run)
## Not run: install_dir <- file.path("/dir/to/install") minimap2_path <- minimap2_installation(source_directory = install_dir, verbose = FALSE) ## End(Not run)
Install minimap2
from Heng Li's github repository. If using a Windows operating system, installation of the MSYS2 Linux emulator is required.
mm2_install(source_directory, verbose = TRUE, return = FALSE)
mm2_install(source_directory, verbose = TRUE, return = FALSE)
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 |
If 'minimap2
' is not installed, this function installs it on linux and returns the path of the installed 'minimap2
' tool (character).
## Not run: install_dir <- file.path("/dir/to/install") minimap2_path <- mm2_install(source_directory = install_dir, verbose = FALSE) ## End(Not run)
## Not run: install_dir <- file.path("/dir/to/install") minimap2_path <- mm2_install(source_directory = install_dir, verbose = FALSE) ## End(Not run)
Check if samtools is installed
samtools_check(return = TRUE)
samtools_check(return = TRUE)
return |
Logical value to return the path of samtools |
If 'samtools
' is installed, this function returns the path of samtools (character).
samtools_check(return = TRUE)
samtools_check(return = TRUE)
Install samtools with conda
samtools_install(verbose = TRUE)
samtools_install(verbose = TRUE)
verbose |
Logical value to print progress of the installation |
If 'samtools
' is not installed, this function installs it on linux and returns the path of the installed 'samtools'
tool (character).
## Not run: samtools_install() ## End(Not run)
## Not run: samtools_install() ## End(Not run)