This is a test version of Biostars. For the public version, visit https://www.biostars.org.
UpSet R plot using text files

Hello All,

I want to make an UpSet plot using text files. A few lines from the input text files are:

Sample1 Sample2 Sample3
A C T
G G G
T C A

All the text files contain the same pattern of information with the first line of sample names and rest SNPs without any CHROM ,POS etc. information. I have made a plot using vcf files but I am not sure how to do it using this kind of text files. Can anyone please help with this. Thank you!

snp r upset

The answer is: read the docs. If the issue can't be solved by this then you need to be more precise about what the issue is.

Thank you! I have three separate excel files looking like:

Sample1 Sample2 Sample3 Sample4
C   C   C   C
G   G   G   G
C   C   C   C
C   C   C   C
T   T   T   T
T   T   T   T
A   A   A   A
A   A   A   A
T   T   T   T
G   G   G   G

I uploaded these three files to R and made an input read list using:

set1 <- read.csv(file = "set1.csv", header = FALSE)
set2 <- read.csv(file = "set2.csv", header = FALSE)
set3 <- read.csv(file = "set3.csv", header = FALSE)
set1 <- as.vector(set1)
set2 <- as.vector(set2)
set3 <- as.vector(set3)
read_sets <- list(set1_reads = set1, 
                  set2_reads = set2, 
                  set3_reads = set3)
head(read_sets)
upset(fromList(read_sets), order.by = "freq")

But it is showing the error Error in start_col:end_col : argument of length 0

This is because you're reading the files as csv which stands for "comma-separated values". Adapt the separator argument to match the type of white spaces used in your files. Also header = FALSE means that the first row is going to be treated as data, probably not what you want. Please read the doc for read.csv().

0 answers

No answers yet.

Log in to answer this question.