ballgown error: Rows of pData did not seem to be in the same order as the columns of the expression data.
1
1
Entering edit mode
5.6 years ago
jolin0701-dy ▴ 100

I'm using ballgown to analyze the data and got an error.

pheno_data <- read.table(pheno_data_file, sep="\t", header=T)

pheno_data

Samples Group

Sample_male_1 Group1

Sample_male_2 Group1

Sample_male_3 Group1

Sample_female_1 Group2

Sample_female_2 Group2

Sample_female_3 Group2

bg <- ballgown(dataDir = "ballgown", samplePattern="Sample", pData=pheno_data)

Wed Dec 21 10:36:10 2016

Wed Dec 21 10:36:10 2016: Reading linking tables

Wed Dec 21 10:36:15 2016: Reading intron data files

Wed Dec 21 10:36:32 2016: Merging intron data

Wed Dec 21 10:36:37 2016: Reading exon data files

Wed Dec 21 10:37:17 2016: Merging exon data

Wed Dec 21 10:37:24 2016: Reading transcript data files

Wed Dec 21 10:37:41 2016: Merging transcript data

Error in ballgown(dataDir = "ballgown", samplePattern = "Sample", pData = pheno_data) : first column of pData does not match the names of the folders containing the ballgown data.

In addition: Warning message:

In ballgown(dataDir = "ballgown", samplePattern = "Sample", pData = pheno_data) : Rows of pData did not seem to be in the same order as the columns of the expression data. Attempting to rearrange pData...

Execution halted

It seems that the order in phone_data should be exactly the same in the folder of ballgown.

Any help would be greatly appreciated..

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

Looks fine. Can you confirm that the data directory name and location is accurate? You can try samplePattern="" without pData = pheno_data.

Best

ADD REPLY
0
Entering edit mode

Hi, I think you can reorganize the pheno_data. You can first test :

all(pheno_data$ids == list.files("./Ballgown"))  If you got FALSE, then you can re-order your rows: row_order <- (list.files("./Ballgown")) pheno_data2 <- pheno_data[row_order,]  This will reorder your pheno_data dataset, then you can test again: all(pheno_data2$ids == list.files("./Ballgown"))


Hope this works.

ADD REPLY
0
Entering edit mode

This should have been a comment on the 3 year old answer, as you're adding code that does exactly what that answer says. Please do not add answers unless you're recommending a new approach. If you're adding value to someone else's answer, add a comment instead. I'm moving this to a comment on the top-level post, but feel free to add a comment to the existing answer and delete this post.

ADD REPLY
1
Entering edit mode
5.1 years ago
584839733 ▴ 10

hi I recently got the same err.through reading the protocal,I find a solution: To make sure that the file names match the IDs in the phenotype file, run the following R command:

all(pheno_data\$ids == list. files("ballgown"))

I guess your pheno_data's order maybe not match the sample file order. You can reorder your pheno_data_file's Samples as list. files("ballgown")) to solve this problem.

Best

ADD COMMENT

Login before adding your answer.

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