Question: > DBdata <-dba(sampleSheet = samples) Error: object of type 'closure' is not subsettable
gravatar for jason.williams
5 months ago by
jason.williams0 wrote:

Hi, I am using this vignette to guide me through differential ChIPSeq analysis -

Using this sample sheet in a .csv file

    SampleID    Tissue  Factor  Condition   Treatment   Replicate   bamreads    Control ID  bamControl  Peaks   PeakCaller
1   C0011   PBMC_Cancer H3K4Me3 Resistant   Extreme_Phenotype   1   1_059D_00OLSwansea_CS001_H3K27Ac_hs_i85_trim_bowtie2UP(copy 1).bam  C0011c  3_059S_00OLSwansea_Input_hs_i87_trim_bowtie2UP.bam  CS_H3K27Ac_summits.bed  bed
2   C0012   PBMC_Cancer H3K4Me4 Resistant   Extreme_Phenotype   2   1_059D_00OLSwansea_CS001_H3K27Ac_hs_i85_trim_bowtie2UP.bam  C0011c  3_059S_00OLSwansea_Input_hs_i87_trim_bowtie2UP (copy 1).bam CS_H3K27Ac_summits(copy 1).bed  bed
3   Con0011 PBMC_Normal H3K4Me5 Normal  Non-extreme_Phenotype   1   C_ENCFF350ISY_H3K27Ac.bam   Con0011c    C_ENCFF380MFX_inp.bam   Con_H3K27Ac_summits.bed bed
4   Con0012 PBMC_Normal H3K4Me6 Normal  Non-extreme_Phenotype   2   C_ENCFF350ISY_H3K27Ac(copy 1).bam   Con0011c    C_ENCFF380MFX_inp(copy 1).bam   Con_H3K27Ac_summits(copy 1).bed bed

I followed the vignette using the following script:

# read csv of sample sheet into dataframe
samples <-read.csv(Extreme_Phenotype_H3K27Ac.csv)
# Load and read the sample sheet
DBdata <-dba(sampleSheet = samples)

I get the following error in the console:

 DBdata <-dba(sampleSheet = samples)
Error: object of type 'closure' is not subsettable

I am new to using R so I apologise if I am making a silly mistake.

Thanks in advance,


diffbind R r studio • 123 views
ADD COMMENTlink modified 5 months ago by James W. MacDonald52k • written 5 months ago by jason.williams0
Answer: > DBdata <-dba(sampleSheet = samples) Error: object of type 'closure' is not sub
gravatar for James W. MacDonald
5 months ago by
United States
James W. MacDonald52k wrote:

The error you see is what you get when you try to subset a function:

> read.csv[1:3]
Error in read.csv[1:3] : object of type 'closure' is not subsettable

Which makes me think that your 'samples' object is actually a pointer to a function? I don't know, but do note that read.csv expects the first argument to be a quoted file name, and you are passing an R object (since it's unquoted). You can hypothetically do that sort of thing, like

Extreme_Phenotype_H3K27Ac.csv <- "Extreme_Phenotype_H3K27Ac.csv"
samples <- read.csv(Extreme_Phenotype_H3K27Ac.csv)

Which would work, but why would you do that? My best guess is that your samples object isn't a data.frame but is instead a function, and you need to fix something somewhere.

ADD COMMENTlink written 5 months ago by James W. MacDonald52k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 230 users visited in the last hour