Question: UpSet Plot R for more than five datasets
1
gravatar for evelyn
10 days ago by
evelyn20
evelyn20 wrote:

I am trying to make UpSetR plot for nine vcf files using working code. However, the output plot shows only five files out of total nine files.

snp R • 83 views
ADD COMMENTlink modified 10 days ago by SMK430 • written 10 days ago by evelyn20
4
gravatar for SMK
10 days ago by
SMK430
Gentopia, Belgium
SMK430 wrote:

Try increasing nsets when calling upset, like:

upset(fromList(read_sets), order.by = "freq", nsets = 9)

?upset shows:

nsets Number of sets to look at

ADD COMMENTlink modified 10 days ago • written 10 days ago by SMK430

It worked, thank you!

ADD REPLYlink written 10 days ago by evelyn20

Try to provide your code and even example dataset next time, if possible. :-)

ADD REPLYlink written 10 days ago by SMK430

The working code for UpSet R plot for vcf files is:

rm(list = ls())
library(UpSetR)
library(vcfR)

set1 <- read.vcfR("Set1.vcf")
set2 <- read.vcfR("Set2.vcf")
set3 <- read.vcfR("Set3.vcf")
set4 <- read.vcfR("Set4.vcf")
set5 <- read.vcfR("Set5.vcf")
set6 <- read.vcfR("Set6.vcf")
set7 <- read.vcfR("Set7.vcf")

set1 <- as.vector(paste(set1@fix[, "CHROM"], set1@fix[, "POS"], sep = "_"))
set2 <- as.vector(paste(set2@fix[, "CHROM"], set2@fix[, "POS"], sep = "_"))
set3 <- as.vector(paste(set3@fix[, "CHROM"], set3@fix[, "POS"], sep = "_"))
set4 <- as.vector(paste(set4@fix[, "CHROM"], set4@fix[, "POS"], sep = "_"))
set5 <- as.vector(paste(set5@fix[, "CHROM"], set5@fix[, "POS"], sep = "_"))
set6 <- as.vector(paste(set6@fix[, "CHROM"], set6@fix[, "POS"], sep = "_"))
set7 <- as.vector(paste(set7@fix[, "CHROM"], set7@fix[, "POS"], sep = "_"))

read_sets <- list(set1_reads = set1,
                  set2_reads = set2,
                  set3_reads = set3,
                  set4_reads = set4,
                  set5_reads = set5,
                  set6_reads = set6,
                  set7_reads = set7)

upset(fromList(read_sets), order.by = "freq", nsets = 7)

You can change the number of sets (nsets)

ADD REPLYlink written 8 days ago by evelyn20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 814 users visited in the last hour