Error in taglist[[i]] : subscript out of bounds
1
0
Entering edit mode
8.6 years ago
Bioblazer ▴ 50

I have the following error when I run the command in R (> s=read.csv("Samples.csv"), > counts=readDGE(s$cf)$counts)

Error in taglist[[i]] : subscript out of bounds. LibraryName Library Layout fastq1 fastq2 condition shortname ATCC26_30 PAIRED AT30.left.fastq AT30.right.fastq Saphrophyte AT_30 ATCC26_37 PAIRED AT37.left.fastq AT37.right.fastq Saphrophyte AT_37 CI1123_30 PAIRED CI30.left.fastq CI30.right.fastq Surgery CI_30 CI1123_37 PAIRED CI37.left.fastq CI37.right.fastq Surgery CI_37 CI1698_30 PAIRED YS30.left.fastq YS30.right.fastq Healed YS_30 CI1698_37 PAIRED YS37.left.fastq YS37.right.fastq Healed YS_37

Can anyone pls tell me the way to rectify the error, or pls send the link if already discussed the relevant post in this forum....

RNA-Seq • 4.4k views
ADD COMMENT
0
Entering edit mode

hi Muthukumar, in order for us to be able to help we need a lil more information. what's in your Sample.csv file? can you do head(s) and see how it looks like? can you give us more info about libraries etc etc... also, can you use the correct formatting for your code? that will make it much easier for users to read

ADD REPLY
0
Entering edit mode

s=read.csv("Samples.csv") counts=readDGE(s$cf)$counts)

Samples.csv

LibraryName - ATCC26_30 ATCC26_37 CI1123_30 CI1123_37 CI1698_30 CI1698_37

Library Layout-PAIRED PAIRED PAIRED PAIRED PAIRED PAIRED

fastq1 AT30.left.fastq AT37.left.fastq CI30.left.fastq CI37.left.fastq YS30.left.fastq YS37.left.fastq

fastq2 AT30.right.fastq AT37.right.fastq CI30.right.fastq CI37.right.fastq YS30.right.fastq YS37.right.fastq

Condition Saphrophyte Saphrophyte Surgery Surgery Healed Healed

shortname AT_30 AT_37 CI_30 CI_37 YS_30 YS_37

cf ATCC26_30.count ATCC26_37.count CI1123_30.count CI1123_37.count CI1698_30.count CI1698_37.count

counts=readDGE(s$cf)$counts Now I am getting different error like this

Error in read.table(file = file, header = header, sep = sep, quote = quote, : no lines available in input

How to solve this issue...

ADD REPLY
0
Entering edit mode
8.6 years ago

Looks to me like you need to transpose your input table, try

counts=readDGE(t(s)$cf)$counts)
ADD COMMENT
0
Entering edit mode

Thanking you for your reply , I have tried but other type of error occured

> library("edgeR")
Loading required package: limma
> counts=readDGE(sample$countf)$counts
Error in read.table(file = file, header = header, sep = sep, quote = quote, : no lines available in input

> sample=t(sample)
> counts=readDGE(sample$countf)$counts
Error in sample$countf : $ operator is invalid for atomic vectors

> counts=readDGE(sample[countf])$counts
Error in is.data.frame(files) : object 'countf' not found

> sample
  LibraryName         Library.Layout          fastq1           fastq2   condition
1   ATCC26_30         PAIRED AT30.left.fastq AT30.right.fastq Saphrophyre
2   ATCC26_37         PAIRED AT37.left.fastq AT37.right.fastq Saphrophyre
3   CI1123_30         PAIRED CI30.left.fastq CI30.right.fastq    Surgery 
4   CI1123_37         PAIRED CI37.left.fastq CI37.right.fastq    Surgery 
5   CI1698_30         PAIRED YS30.left.fastq YS30.right.fastq     Healed 
6   CI1698_37         PAIRED YS37.left.fastq YS37.right.fastq     Healed 
  shortname          countf
1     AT_30 ATCC26_30.count
2     AT_37 ATCC26_37.count
3     CI_30 CI1123_30.count
4     CI_37 CI1123_37.count
5     YS_30 CI1698_30.count
6     YS_37 CI1698_37.count

The above sample file is not transpose one....

ADD REPLY
0
Entering edit mode

Your code is hard to read, please use the 101010 button to properly format it.

ADD REPLY
0
Entering edit mode
> sample=t(sample)
> counts=readDGE(sample$countf)$counts

I got following error, Error in sample$countf : $ operator is invalid for atomic vectors When I googled the error then I got know it can be solved by

counts=readDGE(sample[countf])$counts After running the above command, I got the error as Error in is.data.frame(files) : object 'countf' not found

ADD REPLY
0
Entering edit mode

can you check

names(sample)

to see if the field 'countf' is present?

ADD REPLY
0
Entering edit mode

No I could not able to find countf column in csv file . The following R code paste function have been used to add column in csv file.

s=read.csv("sample.csv")
s$countf=paste(sample$LibraryName,"count",sep=".")

In terminal window I could able to find the countf column but I couldn't when I tried to open csv file directly. Problem must be here , so how to make appear that column in csv file. I tried manually adding the column and executed the names(sample), it showing the countf column. but the error like

counts=readDGE(sample$countf)$counts Error in read.table(file = file, header = header, sep = sep, quote = quote, : no lines available in input

I transposed the csv file and I got error like

sample=t(sample) counts=readDGE(sample$countf)$counts Error in sample$countf : $ operator is invalid for atomic vectors Error progressing, suggest any solution to rectify these errors.

ADD REPLY
0
Entering edit mode

can you also check

class(sample)
ADD REPLY

Login before adding your answer.

Traffic: 2888 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6