Dexseq package: looking for help with function -- newExonCountSet()
1
0
Entering edit mode
capricy gao ▴ 230
@capricy-gao-5298
Last seen 10.3 years ago
I have exon count table, gene ID and exon ID in separate files and read them into R. When I tried to use the newExonCountSet() to generate the ecs object, I got an error: length of 'dimnames' [1] not equal to array extent Could any body help me to fix this problem? Thanks. Here are my codes and some outputs: ------------ >data=read.table("male-exonCountsGenomemodel.3.csv", header=T, sep="\t", row.names=1) >head(data)                MA MA.1 MM MM.1 MP MP.1 MW MW.1 CUFF.10002:001  0    0  0    0  0    0  0    0 CUFF.10002:002  0    0  0    0  9   10  3    0 CUFF.10004:001  0    0  0    0  0    0  0    0 CUFF.10004:002  2    1  0    0  2    0  2    0 CUFF.10004:003  1    0  0    0  1    0  0    0 CUFF.10004:004  3    2  0    0  2    0  4    0 >geneIDs=read.table("exonCountsGenomemodel.geneID.1") >rownames(geneIDs)=rownames(data) >head(geneIDs)                        V1 CUFF.10002:001 CUFF.10002 CUFF.10002:002 CUFF.10002 CUFF.10004:001 CUFF.10004 CUFF.10004:002 CUFF.10004 CUFF.10004:003 CUFF.10004 CUFF.10004:004 CUFF.10004 >exonIDs=read.table("exonCountsGenomemodel.exonID") >rownames(exonIDs)=rownames(data) >head(exonIDs)                  V1 CUFF.10002:001 E001 CUFF.10002:002 E002 CUFF.10004:001 E001 CUFF.10004:002 E002 CUFF.10004:003 E003 CUFF.10004:004 E004 > dim(exonIDs) [1] 151944      1 > dim(geneIDs) [1] 151944      1 > dim(data) [1] 151944      8 > design.m                                                         countFile condition MA   ../ATCACG/genome_mapping/tophat_out/accepted_hits.exonCounts MA MA.1 ../GATCAG/genome_mapping/tophat_out/accepted_hits.exonCounts MA MM   ../CGATGT/genome_mapping/tophat_out/accepted_hits.exonCounts MM MM.1 ../TAGCTT/genome_mapping/tophat_out/accepted_hits.exonCounts MM MP   ../ACAGTG/genome_mapping/tophat_out/accepted_hits.exonCounts MP MP.1 ../TTAGGC/genome_mapping/tophat_out/accepted_hits.exonCounts MP > ecs.tmp=newExonCountSet(countData = data[, 1:6], design=design.m,geneIDs=geneIDs, exonIDs=exonIDs) Error: length of 'dimnames' [1] not equal to array extent ----------- [[alternative HTML version deleted]]
• 989 views
ADD COMMENT
0
Entering edit mode
Alejandro Reyes ★ 1.9k
@alejandro-reyes-5124
Last seen 5 months ago
Novartis Institutes for BioMedical Rese…
Hi Capricy, I think the parameters geneID and exonID that you are providing to the function newExonCountSet are not the right class, these seem to be data frames and they must be character vectors. So, for example, you should do this: exonIDs = read.table( "exonCountsGenomemodel.exonID", stringsAsFactors=FALSE, header=FALSE )$V1 instead of all these: exonIDs=read.table("exonCountsGenomemodel.exonID") rownames(exonIDs)=rownames(data) Best regards, Alejandro > I have exon count table, gene ID and exon ID in separate files and > read them into R. When I tried to use the newExonCountSet() to > generate the ecs object, I got an error: length of 'dimnames' [1] not > equal to array extent > > Could any body help me to fix this problem? Thanks. > > Here are my codes and some outputs: > ------------ > >data=read.table("male-exonCountsGenomemodel.3.csv", header=T, > sep="\t", row.names=1) > >head(data) > MA MA.1 MM MM.1 MP MP.1 MW MW.1 > CUFF.10002:001 0 0 0 0 0 0 0 0 > CUFF.10002:002 0 0 0 0 9 10 3 0 > CUFF.10004:001 0 0 0 0 0 0 0 0 > CUFF.10004:002 2 1 0 0 2 0 2 0 > CUFF.10004:003 1 0 0 0 1 0 0 0 > CUFF.10004:004 3 2 0 0 2 0 4 0 > >geneIDs=read.table("exonCountsGenomemodel.geneID.1") > >rownames(geneIDs)=rownames(data) > >head(geneIDs) > V1 > CUFF.10002:001 CUFF.10002 > CUFF.10002:002 CUFF.10002 > CUFF.10004:001 CUFF.10004 > CUFF.10004:002 CUFF.10004 > CUFF.10004:003 CUFF.10004 > CUFF.10004:004 CUFF.10004 > > >exonIDs=read.table("exonCountsGenomemodel.exonID") > >rownames(exonIDs)=rownames(data) > >head(exonIDs) > V1 > CUFF.10002:001 E001 > CUFF.10002:002 E002 > CUFF.10004:001 E001 > CUFF.10004:002 E002 > CUFF.10004:003 E003 > CUFF.10004:004 E004 > > > dim(exonIDs) > [1] 151944 1 > > dim(geneIDs) > [1] 151944 1 > > dim(data) > [1] 151944 8 > > > design.m > countFile condition > MA ../ATCACG/genome_mapping/tophat_out/accepted_hits.exonCounts MA > MA.1 ../GATCAG/genome_mapping/tophat_out/accepted_hits.exonCounts MA > MM ../CGATGT/genome_mapping/tophat_out/accepted_hits.exonCounts MM > MM.1 ../TAGCTT/genome_mapping/tophat_out/accepted_hits.exonCounts MM > MP ../ACAGTG/genome_mapping/tophat_out/accepted_hits.exonCounts MP > MP.1 ../TTAGGC/genome_mapping/tophat_out/accepted_hits.exonCounts MP > > > ecs.tmp=newExonCountSet(countData = data[, 1:6], > design=design.m,geneIDs=geneIDs, exonIDs=exonIDs) > Error: length of 'dimnames' [1] not equal to array extent > > ----------- > >
ADD COMMENT
0
Entering edit mode
Thanks a lot! On Friday, November 22, 2013 4:23 AM, Alejandro Reyes <alejandro.reyes@embl.de> wrote: Hi Capricy, I think the parameters geneID and exonID that you are providing to the function newExonCountSet are not the right class, these seem to be data frames and they must be character vectors. So, for example, you should do this: exonIDs = read.table( "exonCountsGenomemodel.exonID", stringsAsFactors=FALSE, header=FALSE )$V1 instead of all these: exonIDs=read.table("exonCountsGenomemodel.exonID") rownames(exonIDs)=rownames(data) Best regards, Alejandro > I have exon count table, gene ID and exon ID in separate files and > read them into R. When I tried to use the newExonCountSet() to > generate the ecs object, I got an error: length of 'dimnames' [1] not > equal to array extent > > Could any body help me to fix this problem? Thanks. > > Here are my codes and some outputs: > ------------ > >data=read.table("male-exonCountsGenomemodel.3.csv", header=T, > sep="\t", row.names=1) > >head(data) >                MA MA.1 MM MM.1 MP MP.1 MW MW.1 > CUFF.10002:001  0    0  0    0  0    0  0    0 > CUFF.10002:002  0    0  0    0  9  10  3    0 > CUFF.10004:001  0    0  0    0  0    0  0    0 > CUFF.10004:002  2    1  0    0  2    0  2    0 > CUFF.10004:003  1    0  0    0  1    0  0    0 > CUFF.10004:004  3    2  0    0  2    0  4    0 > >geneIDs=read.table("exonCountsGenomemodel.geneID.1") > >rownames(geneIDs)=rownames(data) > >head(geneIDs) >                        V1 > CUFF.10002:001 CUFF.10002 > CUFF.10002:002 CUFF.10002 > CUFF.10004:001 CUFF.10004 > CUFF.10004:002 CUFF.10004 > CUFF.10004:003 CUFF.10004 > CUFF.10004:004 CUFF.10004 > > >exonIDs=read.table("exonCountsGenomemodel.exonID") > >rownames(exonIDs)=rownames(data) > >head(exonIDs) >                  V1 > CUFF.10002:001 E001 > CUFF.10002:002 E002 > CUFF.10004:001 E001 > CUFF.10004:002 E002 > CUFF.10004:003 E003 > CUFF.10004:004 E004 > > > dim(exonIDs) > [1] 151944      1 > > dim(geneIDs) > [1] 151944      1 > > dim(data) > [1] 151944      8 > > > design.m > countFile condition > MA ../ATCACG/genome_mapping/tophat_out/accepted_hits.exonCounts MA > MA.1 ../GATCAG/genome_mapping/tophat_out/accepted_hits.exonCounts MA > MM ../CGATGT/genome_mapping/tophat_out/accepted_hits.exonCounts MM > MM.1 ../TAGCTT/genome_mapping/tophat_out/accepted_hits.exonCounts MM > MP ../ACAGTG/genome_mapping/tophat_out/accepted_hits.exonCounts MP > MP.1 ../TTAGGC/genome_mapping/tophat_out/accepted_hits.exonCounts MP > > > ecs.tmp=newExonCountSet(countData = data[, 1:6], > design=design.m,geneIDs=geneIDs, exonIDs=exonIDs) > Error: length of 'dimnames' [1] not equal to array extent > > ----------- > > [[alternative HTML version deleted]]
ADD REPLY

Login before adding your answer.

Traffic: 825 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