This is a test version of Biostars. For the public version, visit https://www.biostars.org.
R Programming for Differential Gene Expression Analysis

I am using a ballgown to create objects. I have only three samples (b73,f1, and mo17). These three samples are present in this path (Ballgwon>samples>b73,f1,mo17>all CTAB files). I want to do a Differential gene expression analysis.

I am trying to run this command: (bg = ballgown(dataDir= "samples", samplePattern = "ERR", pData=pheno_data).

Error: Tue May 25 17:34:22 2021 Tue May 25 17:34:22 2021: Reading linking tables Error in file(file, "rt") : invalid 'description' argument

I have tried multiple ways but all failed. Can anybody help me. I am not lazy to do it by myself but I am trying it for 4 days. Thanks for understanding!

ballgown rna-seq programming r deg

To start with, brackets are not closed. Do not know if it is copy/paste problem or code error. Try posting tree of the datadir ('samples") here.

That could have been an editing error when I fixed the format. If so my bad. Muhammad Haroon : Please confirm and fix as needed by editing original post.

I did not start with brackets, it was just written to show here..

Can you please run this first? Go to wherever samples directory is and from there execute:

bg = ballgown(dataDir= "samples", samplePattern = "ERR", meas="all"). 

If that fails, can you print tree of samples directory?

$ cd samples
$ tree . -L 1 

and if possible

 $ tree . -P "*.ctab"

bg = ballgown(dataDir= "samples", samplePattern = "ERR", meas="all")

I tried the above command as you suggested but it's not working. Same error!

Please print output from getwd() and > list.dirs() say. Confirm if your samples are b73,f1,mo17 as posted in OP.

getwd() [1] "C:/Users/MALIK UMAIR ALI/Desktop/Ballgown/samples"

Please post the screenshot of outcome from list.dirs() here.

In these directories, I have .ctab files for each sample like b73, f1, and mo17.

well, your sample pattern furnished in ballgown function, is incorrect. Could you please post output from phenodata[,1] ?

$ sample_path <- paste( "C:/Users/MALIK UMAIR ALI/Desktop/Ballgown/samples",pheno_data[,1], sep = '/') $ bg = ballgown(samples=as.vector(sample_path),pData=pheno_data)

Thanks! Both of these commands worked. Would you like to explain what was the reason? I will be obliged to you..

2 answers

try this and post the output:

$ bg = ballgown(dataDir= ".", samplePattern = "ERR", meas="all")

Please check your sample names and pattern. From what you posted as your samples, sample pattern is not matching.

Try also this:

$ sample_path <- paste( "C:/Users/MALIK UMAIR ALI/Desktop/Ballgown/samples",pheno_data[,1], sep = '/')
$ bg = ballgown(samples=as.vector(sample_path),pData=pheno_data)

This also may throw error as there are spaces in id. If so, please escape the space in your id.

brother. Thank you so much. These both command worked. Would like to describe what was the problem as these two commands worked very well..

I think you have created ballgown object now. Proceed with rest of the workflow.

Hi, I am running a Ballgown package of R to find DEGs in my samples. I have three samples (b73,f1, and mo17). I have run all the initial commands successfully. I have given the very right paths and I am sure about that. But for a specific command like in below, I am facing difficulty. I have a separate file by the name of CSV file which is usually edited by the author byself because it contains the information of samples and their characteristics.

Command;

results_transcripts <- stattest(bg_filt, feature="transcript", covariate="sex", adjustvars = c("population"), getFC=TRUE, meas="FPKM")

Output:

*Error in stattest(bg_filt, feature = "transcript", covariate = "sex", :

There must be at least two replicates per group. Make sure covariate is categorical; if continuous, consider the timecourse option, or specify your own models with mod and mod0.*

reading and running the vignette of ballgown will be helpful to you.

it seems you gave the wrong dataDir parameter (relative path and absolute path?). Probably the wrong samplePattern parameter as well.

From the manual: dataDir : file path to top-level directory containing sample-specific folders with ballgown data in them. Only used if samples is NULL.

samplePattern : regular expression identifying the subdirectories of\ dataDir containing data to be loaded into the ballgown object (and only those subdirectories). Only used if samples is NULL.

Actually all the data files are present in ballgown directory as you can see in the above picture. While CSV files was created by myself in which I have put the names of all samples like b73, f1 and mo17.

Log in to answer this question.