Search
Question: Error: could not find function "dba"
0
20 months ago by
mmarins0
mmarins0 wrote:

I have tried the tutorial of diffbind after installing and re-stalling the Rstudio, bioconductor and diffbind...but the dba function doesn´t go...it always come Error: could not find function "dba". I am an idiot with line command, so pelase, can somone tell me what to do? All I want is to compare two data sets, controll and treatment for differential peaks....

Thanks...

modified 20 months ago • written 20 months ago by mmarins0
0
20 months ago by
Rory Stark2.5k
CRUK, Cambridge, UK
Rory Stark2.5k wrote:

Have you loaded the package first? Try this script:

> library(DiffBind)
> data(tamoxifen_peaks)
> tamoxifen <- dba(tamoxifen)

Cheers-

Rory

0
20 months ago by
mmarins0
mmarins0 wrote:

Hi Rory,

Sorry with such simple things but I installed Diffbind and got this:

package ‘DiffBind’ successfully unpacked and MD5 sums checked

Then I typed

> library(DiffBind)

and got this
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘ShortRead’
Error: package or namespace load failed for ‘DiffBind’

Best, MOzart

0
20 months ago by
Rory Stark2.5k
CRUK, Cambridge, UK
Rory Stark2.5k wrote:

Hmmn, I'm assuming you installed DiffBind using biocLite:

> source("https://bioconductor.org/biocLite.R")
> biocLite("DiffBind")

If so, I'm not sure why the dependancies aren;t also being installed automatically. You can try to install them manually:

> biocLite("ShortRead")
> library(DiffBind)

I suspect that if you do this, you'll see another "there is no package called 'xxxx'" message, in which case you have to install that package as well.

Regards-

Rory

0
20 months ago by
mmarins0
mmarins0 wrote:
Dear Rory, Thanks. The dba function is now there after the manual instalation. But now I got the second basic step. I have a control file (control.bed) and test experiment (test.bed) which I got from Macs2. I don't understand how to build that samplesheetfile or proceed to a differential analysis with them after following the diffbind tutorial for tamoxifen. Any tips besides getting a course? This one will probably get to the top of your patience! Sorry. Mozart
0
20 months ago by
mmarins0
mmarins0 wrote:

Hi Rory,

I have set up a csv file with the colums

 SampleID Tissue Factor Condition Replicate bamReads bamControl Peaks PeakCaller p53CTRL U2OS p53 1control 1 p53ctrl.bam input.bam p53ctrlpeaks.bed MACS2 p53TCHAL U2OS p53 2treatment 1 p53tchal.bam input.bam p53TCHALpeaks.bed MACS2

Then when I call it I get

p53CTRL;U2OS;p53;1control;1;p53ctrl.bam;input.bam;p53ctrlpeaks.bed     NA raw
Error in if is.na(peaks)) { : argument is of length zero

Any hope for me?

Best, Mozart

0
20 months ago by
Rory Stark2.5k
CRUK, Cambridge, UK
Rory Stark2.5k wrote:

The peak caller name MACS2 is not recognized, it defaults to raw, which looks for the peak score in the fourth column (chromosome, start, end, score). I'm not sure what the format of your Peaks files. If it is really BED format, it should have five columns: chromosome, start, end, name, score (score in the fifth column). In this case, you can enter bed instead of MACS2 in the PeakCaller column. Alternatively, you can add another column, ScoreCol, and include the column number with the scores (5).

Another option is to use the .xls files from MACS2 instead of the bed files, and set the PeakCaller to macs.

If you're still having a problem, post the first two or three lines from one of the peak files here and I'll help sort it out.

Cheers-

Rory

0
20 months ago by
mmarins0
mmarins0 wrote:

Hi Rory,

Files look like this

 chromosome start end name score chr1 28088 30326 MACS_peak_1 1610.56 chr1 51499 52148 MACS_peak_2 63.34 chr1 441771 442612 MACS_peak_3 117.63 chr1 540241 541202 MACS_peak_4 157.57

Cheers

This is BED format. Either set the PeakCaller values to bed, or add a PeakFormat column and set those values to bed.

0
20 months ago by
mmarins0
mmarins0 wrote:

Dear Rory,

Would it be that my Score column should have values between 1 and 1000? But actually I have values above that?

Best, Mozart

The MACS scores are set to −10*log10(Pvalue) so they can get above 1000 for very low p-values.

1

Officially BED scores should be integers between 0 and 1000 (according to the UCSC genome browser site) but DiffBind will happily tolerate higher (and fractional) scores.

Internally, DiffBind converts these scores to a 0..1 scale, and in this case will invert them as well.

0
20 months ago by
mmarins0
mmarins0 wrote:

Hi Rory,

I fixed the last error by taking the tamoxifen sample sheet and opening it in Excell. When I open it, all the data is in one column (A1) separated by comma. When I did my samplesheet I have put each data in one column and saved as a CSV file. Now, I did exactly as in the tamoxifen samplesheet and now I get this error

U2OS U2OS p53 not-treated DMSO 1 raw
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :
line 26 did not have 3 elements
1: In readLines(fn, n = 1) : line 1 appears to contain an embedded nul
2: In readLines(file, skip) : line 1 appears to contain an embedded nul

Best, Mozart

0
20 months ago by
mmarins0
mmarins0 wrote:

Hi Rory,

Solved the one before but now I get

U2OS U2OS p53 not-treated DMSO 1 raw
Error in Summary.factor(c(1L, 9875L, 10986L, 12097L, 13208L, 14319L, 15430L,  :
‘max’ not meaningful for factors

Best, MOzart

0
20 months ago by
Rory Stark2.5k
CRUK, Cambridge, UK
Rory Stark2.5k wrote:

I'm not sure what you're doing here, but the bed file output by MACS2 should be read in properly as-is if the PeakCaller or PeakFormat fields are set to bed. I can see the format is still being set to raw, probably because you have the PeakCaller set to MACS2 which is unrecognized and don't have a PeakFormat field present to indicate that the format is actually bed.

Alternatively, you can specify the peak format when you load the sample sheet:

> myDBA <- dba(sampleSheet="samplesheet.csv", peakFormat="bed")

-Rory

0
20 months ago by
mmarins0
mmarins0 wrote:

Dear Rory,

Thanks...I got it. It loaded. Wrong labelling from a stupid beginner with line commands in R. I used

peakFormat="bed" and it worked. Then I went once again to see what was wrong and I got it...PeaksCaller instead of PeakCaller...in the computers grammar world, they do (up to now) what you tell them to do!!!

Thank you for your patience and help. Let´s see what the next error will be.

Best, Mozart