Question: ballgown error: Error in file(file, "rt") : invalid 'description' argument Calls: ballgown -> read.table -> file
0
gravatar for RNAseqer
7 weeks ago by
RNAseqer 40
RNAseqer 40 wrote:

I have been running through the bioconductor introduction to ballgown and hit a snag in loading up the .ctab files using the method described therin.

https://www.bioconductor.org/packages/devel/bioc/vignettes/ballgown/inst/doc/ballgown.html

The instructions suggest that if you store your data in a file structure like so:

Ballgowndata
         sample1_folder
                e2t.ctab
                e_data.ctab
                i2t.ctab
                i_data.ctab
                t_data.ctab
         sample2_folder
                e2t.ctab
                e_data.ctab
                i2t.ctab
                i_data.ctab
                t_data.ctab
    etc...

you should be able to load it using the dataDir function and a regular expression by which it matches your sample folders: Specifically it suggests creating a file Load.r

library(ballgown)
        data_directory = system.file('extdata', package='ballgown') 
        bg = ballgown(dataDir=data_directory, samplePattern='sample', meas='all')
        save(bg, file='bg.rda')

and then using this script through the command line

R CMD BATCH load.R

I have done this very thing for the sample data provided with ballgown and it works, but when i try to use this method with my own data, which is stored in a folder with the following path

/Users/mylapple/Desktop/test_reads_folder_output/ballgown_inputs/sample_SRR446038.bam/

and structure:

   ballgown_inputs
           sample_SRR446038.bam
                e2t.ctab
                e_data.ctab
                i2t.ctab
                i_data.ctab
                t_data.ctab
           sample_SRR446039.bam
                e2t.ctab
                e_data.ctab
                i2t.ctab
                i_data.ctab
                t_data.ctab
           sample_SRR446040.bam
                e2t.ctab
                e_data.ctab
                i2t.ctab
                i_data.ctab
                t_data.ctab

Etc...

It gives me an error output:

> library(ballgown)

Attaching package: ‘ballgown’

The following object is masked from ‘package:base’:

    structure

    > data_directory = system.file('ballgown_inputs', package='ballgown') 
    > bg = ballgown(dataDir=data_directory, samplePattern='sample', meas='all')
    Mon Mar  4 16:45:48 2019
    Mon Mar  4 16:45:48 2019: Reading linking tables
    Error in file(file, "rt") : invalid 'description' argument
    Calls: ballgown -> read.table -> file
    Execution halted

From what little I've been able to find on the web this error seems to pretain to the inability to find the right path to the data. But I am unsure why that would be. It was my understanding that this dataDir function would search for the correct files, and it certainly worked with the toy dataset ballgown comes with. So why wont it work with mine?

Id greatly appreciate any light you could shed on this matter.

rna-seq stringtie ballgown • 168 views
ADD COMMENTlink modified 7 weeks ago • written 7 weeks ago by RNAseqer 40

data_directory = system.file('ballgown_inputs', package='ballgown') is only valid for the example files. You have to specify the path to the directory with the ballgown folders.

ADD REPLYlink modified 6 weeks ago • written 6 weeks ago by ATpoint15k

data_directory = system.file(Users/mylapple/Desktop/test_reads_folder_output/ballgown_inputs, package = 'ballgown') ??

ADD REPLYlink written 6 weeks ago by RNAseqer 40

No, you need list.dirs. Please spend some quality time on R basics. system.file() is only used to load dummy data from packages, which is why you specify the package=xxx parameter. list.dirs("/path/to/the/folder/that/contains/the/ballgowns")

ADD REPLYlink written 6 weeks ago by ATpoint15k

Good advice. I will be sure to do so.

ADD REPLYlink written 6 weeks ago by RNAseqer 40
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: 1394 users visited in the last hour