G3viz / g3viz

Lollipop-diagram to interactively visualize genetic mutations
https://g3viz.github.io/g3viz/
Other
29 stars 19 forks source link

Is there any example TSV data for testing the package? #17

Open ghost opened 2 years ago

ghost commented 2 years ago

I'm trying to use the guide to generate plots from a tsv file. The first command for reading tsv files read my file as an empty file, i.e.: "". I'm not sure what I'm doing wrong. Could you please provide a test tsv file so I can start from there and modify it to make my input? My tsv file contains three columns: Hugo_Symbol Variant_Classification amino_acid_change

The command I used: mutation.tsv <- system.file("extdata", "myfile.tsv", package = "g3viz")

Thank you!

ghost commented 2 years ago

I did find an example file. I regenerated my input file to match the format of the example file. I'm still getting an empty file when I run the first command. But if I run the following command then the file is read correctly. Is there a bug in g3viz in reading the files?

mutation.tsv <- read.table("myfile.tsv", header=T)

zhangrener commented 2 years ago

Hi,

Sorry for the late reply. Maybe you have already figured this out but please allow me to explain it again

  1. mutation.tsv <- system.file("extdata", "myfile.tsv", package = "g3viz")

The command system.file is used to find the file from the g3viz package for demonstration purpose. Since your file is not saved in the package, R cannot locate the file in the package and you will only receive an empty result.

  1. To import tsv file as MAF file, please use readMAF function:

for example: mutation.dat <- readMAF(myfile.tsv, gene.symbol.col = "Hugo_Symbol", variant.class.col = "Variant_Classification", protein.change.col = "amino_acid_change", sep = "\t")

Notice "sep=" part. If you are using a tsv file, sep="\t". Moreover, sep="," if it is a csv file.

Hope the answer solves your question and have fun exploring your data with the updated G3viz package.

Best, Rener