> DBdata <-dba(sampleSheet = samples) Error: object of type 'closure' is not subsettable
1
0
Entering edit mode
@jasonwilliams-21306
Last seen 4.0 years ago

Hi, I am using this vignette to guide me through differential ChIPSeq analysis - https://bioinformatics-core-shared-training.github.io/cruk-summer-school-2018/ChIP/Practicals/Practical4differentialBindingDB.html

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)
samples
# 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,

Jason

DiffBind R R Studio • 958 views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 4 hours ago
United States

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 COMMENT

Login before adding your answer.

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