Hello.
I imported a BAM file (MNase-seq) in R with the nucleR package.
Now I want to get the nucleosome peaks from this BAM file. I did it the way it says in the documentary.
Now I always get the following error message:
Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘peakDetection’ for signature ‘"character"’
Whole function:
bam <- system.file("extdata", "ENCFF653KEU.bam", package="nucleR")
reads <- readBAM(bam, type="paired")
reading file /usr/local/lib/R/site-library/nucleR/extdata/ENCFF653KEU.bam
processing flags
processing strand +
processing strand -
head(reads)
GRanges object with 6 ranges and 0 metadata columns:
seqnames ranges strand
<Rle> <IRanges> <Rle>
[1] chr1 10019-10124 *
[2] chr1 10022-10129 *
[3] chr1 10025-10137 *
[4] chr1 10028-10129 *
[5] chr1 10028-10142 *
[6] chr1 10035-10148 *
seqinfo: 25 sequences from an unspecified genome; no seqlengths
peaks <- peakDetection(bam, threshold="25%", score=TRUE)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘peakDetection’ for signature ‘"character"’
Has anybody an idea what the problem is?
Okay, but why there is the function to import bam files if I can't get the nuclesome positionings from that file?
This is why I am urging you to read the vignette. The first step is to read in the data from a bam file, then get the coverage, then do a Fourier transform to smooth the coverage values, and then call nucleosomes from the processed data.
What you did was read the data in, then try to call nucleosomes directly from the bamfile, ignoring the data that you already read in using
readBAM
!. That isn't how it works. I am not sure why you think that having a function to read in bam files means thatpeakDetection
should be able to read a bam file as well?okay thank you!!!
I think I did it now.
But now I get another error, shown at the bottom... Is it because I havenot enough RAM?
seqinfo: 25 sequences from an unspecified genome; no seqlengths
$chr2 numeric-Rle of length 243188437 with 4320187 runs Lengths: 10511 97 ... 167 Values : 0 0.0726215885101028 ... 0.0363107942550514
$chr3 numeric-Rle of length 197928009 with 3582096 runs Lengths: 60070 216 ... 103 Values : 0 0.0363107942550514 ... 0.0363107942550514
$chr4 numeric-Rle of length 191044273 with 2993584 runs Lengths: 10119 11 ... 38 Values : 0 0.0363107942550514 ... 0.0363107942550514
$chr5 numeric-Rle of length 180904852 with 3030234 runs Lengths: 11482 8 ... 12 Values : 0 0.0363107942550514 ... 0.0363107942550514
... <1 more element>
$chr2 numeric-Rle of length 243188437 with 4320187 runs Lengths: 10511 97 ... 167 Values : 0 0.0726215885101028 ... 0.0363107942550514
$chr3 numeric-Rle of length 197928009 with 3582096 runs Lengths: 60070 216 ... 103 Values : 0 0.0363107942550514 ... 0.0363107942550514
$chr4 numeric-Rle of length 191044273 with 2993584 runs Lengths: 10119 11 ... 38 Values : 0 0.0363107942550514 ... 0.0363107942550514
$chr5 numeric-Rle of length 180904852 with 3030234 runs Lengths: 11482 8 ... 12 Values : 0 0.0363107942550514 ... 0.0363107942550514
... <20 more elements>
seqinfo: 25 sequences from an unspecified genome; no seqlengths
Error: cannot allocate vector of size 878.2 Mb