msc.length: Length of minicircles

Description Usage Arguments Value Examples

View source: R/msc.length.R

Description

The msc.length function allows you to check the length of minicircle sequences based on one fasta file.

Usage

1
msc.length(file, samples, groups)

Arguments

file

the name of the fasta file containing all minicircle sequences, e.g. all.minicircles.circ.fasta.

samples

a character vector containing the sample names.

groups

a vector, of equal length as samples, specifying to which group (e.g. subspecies) the samples belong to.

Value

length

a numerical vector containing the length of minicircle sequences.

plot

a histogram visualizing the length frequency of minicircle sequences.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
require(ggplot2)
require(ggpubr)

### run function
bf <- msc.length(file = system.file("extdata", "all.minicircles.fasta", package="rKOMICS"),
                 samples = exData$samples, groups = exData$subspecies)
af <- msc.length(file = system.file("extdata", "all.minicircles.circ.fasta", package="rKOMICS"),
                 samples = exData$samples, groups = exData$subspecies)

length(which(bf$length<800)) 
length(which(bf$length>1400)) 

### visualize results
hist(af$length, breaks=50)

### alter plot
ggarrange(bf$plot + labs(caption = "Before filtering"), 
          af$plot + labs(caption = "After filtering"), nrow=2)

rKOMICS documentation built on July 21, 2021, 5:07 p.m.