Question: How to give directory path in DESeq2
0
gravatar for Ambika
2.8 years ago by
Ambika30
United States
Ambika30 wrote:

Hello everyone,

I did my transcripts count using Htseq and now I am trying to use DESeq2 package in R to see differential expression of genes around samples.In order to make the input table for Deseq2 I am using following line of codes:

directory <- C:/Users/hp/Desktop/RNA.seq.data
sampleFiles <- c('count.1','count.2','count.3','count.4','count.6','count.7','count.8')
sampleCondition<- c('R1control','R1time1','R1time2','R1time4','R2control','R2time1','R2time2','R2time4')
sampleTable<- data.frame(sampleName = sampleFiles, fileName = sampleFiles, condition = sampleCondition)
ddsHTSeq<- DESeqDataSetFromHTSeqCount(sampleTable = sampleTable,
                                       directory = directory,
                                       design= ~ condition)
ddsHTSeq

In the first line of code where I specify path to directory containing count files I always get syntax error. I tried everything like setting working directory and specifying path all that but this is not working. The R version I am using is 3.4.2.

Please Help.

Thank you,

Ambika

rna-seq • 1.0k views
ADD COMMENTlink modified 2.8 years ago by Yuyayuya120 • written 2.8 years ago by Ambika30
1
gravatar for Kevin Blighe
2.8 years ago by
Kevin Blighe63k
Kevin Blighe63k wrote:

Try either of these:

directory <- "C:\\Users\\hp\\Desktop\\RNA.seq.data\\"

directory <- "C:/Users\\hp/Desktop/RNA.seq.data/"

Ensure that you include the quotation marks

ADD COMMENTlink written 2.8 years ago by Kevin Blighe63k

Thank you Kevin,

That worked and now I got another error in command

sampleTable<- data.frame(sampleName = sampleFiles, fileName = sampleFiles, condition = sampleCondition)
Error in data.frame(sampleName = sampleFiles, fileName = sampleFiles, : arguments imply differing number of rows: 7, 8

Am I wrong somewhere?

ADD REPLYlink modified 2.8 years ago by RamRS28k • written 2.8 years ago by Ambika30
1

Yes, I believe that you are missing a 'count.5' in your vector sampleFiles(?).

sampleFiles = 7 elements

sampleCondition = 8 elements

These have to be the same length and the order should match

ADD REPLYlink modified 2.8 years ago • written 2.8 years ago by Kevin Blighe63k
1

Thank you so much Kevin.

ADD REPLYlink written 2.8 years ago by Ambika30

Absolutely no problem my friend. Good luck

ADD REPLYlink written 2.8 years ago by Kevin Blighe63k
1
gravatar for Yuyayuya
2.8 years ago by
Yuyayuya120
USA
Yuyayuya120 wrote:

I always set the directory while reading the data file.

For example:

dat = read.csv( file = "/Users/zzzz/Desktop/matrix.csv", header = T, row.names=1)
ADD COMMENTlink written 2.8 years ago by Yuyayuya120
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: 1315 users visited in the last hour