Description Usage Arguments Details Value Author(s) See Also Examples
A comparison is a collection of similarities, representing the comparison between two DNA segments. These functions are class functions to create, convert and test comparison objects.
1 2 3 |
x |
Can be a |
df |
A |
comparison |
Any object to test. |
Objects (either data frames or lists) should have at least named
elements start1
, end1
, start2
and end2
. In
addition, it can take a col
or column. Additional numeric columns can
be used for color-coding (via apply_color_scheme
.
comparison
tries to build a comparison object from either a
data frame or a list, as.comparison
accepts only data.frames.
is.comparison
returns TRUE
if the object tested is a
comparison object.
Read functions such as read_comparison_from_tab
and
read_comparison_from_blast
also return comparison objects.
A comparison object for comparison
and
as.comparison
. Comparison objects are also of class
data.frame
. They contain the columns start1
,
end1
, start2
, end2
, direction
and
col
(color).
A logical for is.comparison
.
Lionel Guy
dna_seg
, read_comparison_from_tab
,
read_comparison_from_blast
,
trim.comparison
, reverse.comparison
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Get some values
starts1 <- c(2, 1000, 1050)
ends1 <- c(600, 800, 1345)
starts2 <- c(50, 800, 1200)
ends2 <- c(900, 1100, 1322)
## From a data.frame
comparison1 <- as.comparison(data.frame(start1=starts1, end1=ends1,
start2=starts2, end2=ends2))
comparison1
is.comparison(comparison1)
is.data.frame(comparison1)
comparison(data.frame(start1=starts1, end1=ends1,
start2=starts2, end2=ends2))
## From a list
comparison(list(start1=starts1, end1=ends1,
start2=starts2, end2=ends2))
## From a file
comparison2_file <- system.file('extdata/comparison2.tab',
package = 'genoPlotR')
comparison2 <- read_comparison_from_tab(comparison2_file)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.