nucleR ERROR unable to find an inherited method for function peakDetection for signature
1
0
Entering edit mode
@annekannengiesser-22547
Last seen 4.3 years ago

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?

nucleosome peaks error Job • 932 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 13 hours ago
United States

Have you read the vignette? What you are doing isn't going to work for several reasons, the least of which is that the first argument to processReads is supposed to be some highly processed coverage data, and you are trying to point to a bam file. These are not the same things!

You say you 'did it in the way it says in the documentary', but what you have shown here isn't remotely similar to what the vignette says to do, so I would recommend going back to the vignette and more closely following the instructions.

ADD COMMENT
0
Entering edit mode

Okay, but why there is the function to import bam files if I can't get the nuclesome positionings from that file?

ADD REPLY
0
Entering edit mode

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 that peakDetection should be able to read a bam file as well?

ADD REPLY
0
Entering edit mode

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?

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

coverdata <- coverage.rpm(reads) head(coverdata) RleList of length 6 $chr1 numeric-Rle of length 249240340 with 4577529 runs Lengths: 10018 3 ... 45 Values : 0 0.0363107942550514 ... 0.0363107942550514

$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>

cover_data RleList of length 25 $chr1 numeric-Rle of length 249240340 with 4577529 runs Lengths: 10018 3 ... 45 Values : 0 0.0363107942550514 ... 0.0363107942550514

$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>

reads GRanges object with 27540020 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 * ... ... ... ... [27540016] chrM 16457-16570 * [27540017] chrM 16460-16563 * [27540018] chrM 16460-16569 * [27540019] chrM 16461-16571 * [27540020] chrM 16467-16568 *


seqinfo: 25 sequences from an unspecified genome; no seqlengths

coverclean <- filterFFT(coverdata, pcKeepComp=0.02, showPowerSpec=TRUE)

Error: cannot allocate vector of size 878.2 Mb

ADD REPLY

Login before adding your answer.

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