Good evening R users, I am attempting to carry out DNA methylation analysis on two separate CSV files (LGG and GBM), which I have downloaded onto my R console. To set the path<-"." to be indicative of one or both of the csv files, I utilized the following functions and received the errors shown. How do I set the "." so that I can begin analysis on my files?> the_data <-read.csv(file="LGG_clinical_drug.csv",header=T,sep",")Error: unexpected string constant in "the_data <-read.csv(file="LGG_clinical_drug.csv",header=T,sep",""> the_data<-read.csv(file="GBM_clinical_drug.csv",header=T,sep",")Error: unexpected string constant in "the_data<-read.csv(file="GBM_clinical_drug.csv",header=T,sep","" This is the preliminary portion of the analysis I am trying to run, which I am referring to: 1 library(TCGAbiolinks) 2 3 # Download the DNA methylation data: HumanMethylation450 LGG and GBM. 4 path <? "." 5 6 query.met <? TCGAquery(tumor = c("LGG","GBM"),"HumanMethylation450", level = 3) 7 TCGAdownload(query.met, path = path ) 8 met <? TCGAprepare(query = query.met,dir = path, 9 add.subtype = TRUE, add.clinical = TRUE, 10 summarizedExperiment = TRUE, 11 save = TRUE, filename = "lgg_gbm_met.rda") 12 13 # Download the expression data: IlluminaHiSeq_RNASeqV2 LGG and GBM. 14 query.exp <? TCGAquery(tumor = c("lgg","gbm"), platform = "IlluminaHiSeq_ RNASeqV2",level = 3) 15 16 TCGAdownload(query.exp,path = path, type = "rsem.genes.normalized_ results") 17 18 exp <? TCGAprepare(query = query.exp, dir = path, 19 summarizedExperiment = TRUE, 20 add.subtype = TRUE, add.clinical = TRUE, 21 type = "rsem.genes.normalized_results", 22 save = T,filename = "lgg_gbm_exp.rda") Many thanks, Spencer Brackett [[alternative HTML version deleted]]
Hi, If you had an actual gene analysis question I'd suggest the BioConductor email list, but you have a plain old ordinary typo: the_data <-read.csv(file="LGG_clinical_drug.csv",header=T,sep",") You're missing the = after the argument sep the_data <- read.csv(file = "LGG_clinical_drug.csv", header = TRUE, sep = ",") Using more spaces in your code would make that typo easier to spot. Sarah On Wed, Aug 29, 2018 at 6:06 PM Spencer Brackett <spbrackett20 at saintjosephhs.com> wrote:> > Good evening R users, > > I am attempting to carry out DNA methylation analysis on two separate CSV > files (LGG and GBM), which I have downloaded onto my R console. To set the > path<-"." to be indicative of one or both of the csv files, I utilized the > following functions and received the errors shown. How do I set the "." so > that I can begin analysis on my files? > > > the_data <-read.csv(file="LGG_clinical_drug.csv",header=T,sep",") > Error: unexpected string constant in "the_data > <-read.csv(file="LGG_clinical_drug.csv",header=T,sep","" > > the_data<-read.csv(file="GBM_clinical_drug.csv",header=T,sep",") > Error: unexpected string constant in > "the_data<-read.csv(file="GBM_clinical_drug.csv",header=T,sep","" > > This is the preliminary portion of the analysis I am trying to run, which I > am referring to: > > 1 library(TCGAbiolinks) > 2 > 3 # Download the DNA methylation data: HumanMethylation450 LGG and GBM. > 4 path <? "." > 5 > 6 query.met <? TCGAquery(tumor = c("LGG","GBM"),"HumanMethylation450", > level = 3) > 7 TCGAdownload(query.met, path = path ) > 8 met <? TCGAprepare(query = query.met,dir = path, > 9 add.subtype = TRUE, add.clinical = TRUE, > 10 summarizedExperiment = TRUE, > 11 save = TRUE, filename = "lgg_gbm_met.rda") > 12 > 13 # Download the expression data: IlluminaHiSeq_RNASeqV2 LGG and GBM. > 14 query.exp <? TCGAquery(tumor = c("lgg","gbm"), platform = "IlluminaHiSeq_ > RNASeqV2",level = 3) > 15 > 16 TCGAdownload(query.exp,path = path, type = "rsem.genes.normalized_ > results") > 17 > 18 exp <? TCGAprepare(query = query.exp, dir = path, > 19 summarizedExperiment = TRUE, > 20 add.subtype = TRUE, add.clinical = TRUE, > 21 type = "rsem.genes.normalized_results", > 22 save = T,filename = "lgg_gbm_exp.rda") > > Many thanks, > > Spencer Brackett >-- Sarah Goslee http://www.functionaldiversity.org
Thank you! The line however was still found to be errored after I fixed the mistake. Is there anything else I can do to maybe set the ?.? As an object? Spencer On Wed, Aug 29, 2018 at 6:34 PM Sarah Goslee <sarah.goslee at gmail.com> wrote:> Hi, > > If you had an actual gene analysis question I'd suggest the > BioConductor email list, but you have a plain old ordinary typo: > > the_data <-read.csv(file="LGG_clinical_drug.csv",header=T,sep",") > > You're missing the = after the argument sep > > the_data <- read.csv(file = "LGG_clinical_drug.csv", header = TRUE, sep > ",") > > Using more spaces in your code would make that typo easier to spot. > > Sarah > On Wed, Aug 29, 2018 at 6:06 PM Spencer Brackett > <spbrackett20 at saintjosephhs.com> wrote: > > > > Good evening R users, > > > > I am attempting to carry out DNA methylation analysis on two separate > CSV > > files (LGG and GBM), which I have downloaded onto my R console. To set > the > > path<-"." to be indicative of one or both of the csv files, I utilized > the > > following functions and received the errors shown. How do I set the "." > so > > that I can begin analysis on my files? > > > > > the_data <-read.csv(file="LGG_clinical_drug.csv",header=T,sep",") > > Error: unexpected string constant in "the_data > > <-read.csv(file="LGG_clinical_drug.csv",header=T,sep","" > > > the_data<-read.csv(file="GBM_clinical_drug.csv",header=T,sep",") > > Error: unexpected string constant in > > "the_data<-read.csv(file="GBM_clinical_drug.csv",header=T,sep","" > > > > This is the preliminary portion of the analysis I am trying to run, > which I > > am referring to: > > > > 1 library(TCGAbiolinks) > > 2 > > 3 # Download the DNA methylation data: HumanMethylation450 LGG and GBM. > > 4 path <? "." > > 5 > > 6 query.met <? TCGAquery(tumor = c("LGG","GBM"),"HumanMethylation450", > > level = 3) > > 7 TCGAdownload(query.met, path = path ) > > 8 met <? TCGAprepare(query = query.met,dir = path, > > 9 add.subtype = TRUE, add.clinical = TRUE, > > 10 summarizedExperiment = TRUE, > > 11 save = TRUE, filename = "lgg_gbm_met.rda") > > 12 > > 13 # Download the expression data: IlluminaHiSeq_RNASeqV2 LGG and GBM. > > 14 query.exp <? TCGAquery(tumor = c("lgg","gbm"), platform > "IlluminaHiSeq_ > > RNASeqV2",level = 3) > > 15 > > 16 TCGAdownload(query.exp,path = path, type = "rsem.genes.normalized_ > > results") > > 17 > > 18 exp <? TCGAprepare(query = query.exp, dir = path, > > 19 summarizedExperiment = TRUE, > > 20 add.subtype = TRUE, add.clinical = TRUE, > > 21 type = "rsem.genes.normalized_results", > > 22 save = T,filename = "lgg_gbm_exp.rda") > > > > Many thanks, > > > > Spencer Brackett > > > -- > Sarah Goslee > http://www.functionaldiversity.org >[[alternative HTML version deleted]]
As an aside, the sep = "," can be omitted, as that's the default anyway. In his response to Sarah, the OP gave us only "the line was found to be errored," which of course is useless. Perhaps if he provided explicit information on what the call and the error was... -- Bert On Wed, Aug 29, 2018 at 3:34 PM Sarah Goslee <sarah.goslee at gmail.com> wrote:> Hi, > > If you had an actual gene analysis question I'd suggest the > BioConductor email list, but you have a plain old ordinary typo: > > the_data <-read.csv(file="LGG_clinical_drug.csv",header=T,sep",") > > You're missing the = after the argument sep > > the_data <- read.csv(file = "LGG_clinical_drug.csv", header = TRUE, sep > ",") > > Using more spaces in your code would make that typo easier to spot. > > Sarah > On Wed, Aug 29, 2018 at 6:06 PM Spencer Brackett > <spbrackett20 at saintjosephhs.com> wrote: > > > > Good evening R users, > > > > I am attempting to carry out DNA methylation analysis on two separate > CSV > > files (LGG and GBM), which I have downloaded onto my R console. To set > the > > path<-"." to be indicative of one or both of the csv files, I utilized > the > > following functions and received the errors shown. How do I set the "." > so > > that I can begin analysis on my files? > > > > > the_data <-read.csv(file="LGG_clinical_drug.csv",header=T,sep",") > > Error: unexpected string constant in "the_data > > <-read.csv(file="LGG_clinical_drug.csv",header=T,sep","" > > > the_data<-read.csv(file="GBM_clinical_drug.csv",header=T,sep",") > > Error: unexpected string constant in > > "the_data<-read.csv(file="GBM_clinical_drug.csv",header=T,sep","" > > > > This is the preliminary portion of the analysis I am trying to run, > which I > > am referring to: > > > > 1 library(TCGAbiolinks) > > 2 > > 3 # Download the DNA methylation data: HumanMethylation450 LGG and GBM. > > 4 path <? "." > > 5 > > 6 query.met <? TCGAquery(tumor = c("LGG","GBM"),"HumanMethylation450", > > level = 3) > > 7 TCGAdownload(query.met, path = path ) > > 8 met <? TCGAprepare(query = query.met,dir = path, > > 9 add.subtype = TRUE, add.clinical = TRUE, > > 10 summarizedExperiment = TRUE, > > 11 save = TRUE, filename = "lgg_gbm_met.rda") > > 12 > > 13 # Download the expression data: IlluminaHiSeq_RNASeqV2 LGG and GBM. > > 14 query.exp <? TCGAquery(tumor = c("lgg","gbm"), platform > "IlluminaHiSeq_ > > RNASeqV2",level = 3) > > 15 > > 16 TCGAdownload(query.exp,path = path, type = "rsem.genes.normalized_ > > results") > > 17 > > 18 exp <? TCGAprepare(query = query.exp, dir = path, > > 19 summarizedExperiment = TRUE, > > 20 add.subtype = TRUE, add.clinical = TRUE, > > 21 type = "rsem.genes.normalized_results", > > 22 save = T,filename = "lgg_gbm_exp.rda") > > > > Many thanks, > > > > Spencer Brackett > > > -- > Sarah Goslee > http://www.functionaldiversity.org > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]