Question: error in readPeakFile {chipseeker}
gravatar for theodore.georgomanolis
6 months ago by

Hi all, So I got several bed files as created by MACS2. I am loading them as list with the following:

peaks <- as.list(c("K002000291_97925.narrowPeak",
[1] "K002000291_97925.narrowPeak"

[1] "K002000299_99400.narrowPeak"

this are the same structure as the provided sample files, but not gziped:

[1] "R/x86_64-pc-linux-gnu-library/3.6/ChIPseeker/extdata/GEO_sample_data/GSM1174480_ARmo_0M_peaks.bed.gz"

[1] "R/x86_64-pc-linux-gnu-library/3.6/ChIPseeker/extdata/GEO_sample_data/GSM1174481_ARmo_1nM_peaks.bed.gz"

but when I convert them to the GRanges I got the following error:

Error in read.table(file = file, header = header, sep = sep, quote = quote,  : 
  'file' must be a character string or connection

If I use only one part of the list, all is good:

GRanges object with 34719 ranges and 7 metadata columns:
          seqnames            ranges strand |     MACS_peak_1      X111        .  X7.32948 X14.79510 X11.12669
             <Rle>         <IRanges>  <Rle> |        <factor> <integer> <factor> <numeric> <numeric> <numeric>
      [1]     chr1       11329-11448      * |     MACS_peak_2        25        .   3.76954   5.24804   2.56086
      [2]     chr1       28998-29387      * |     MACS_peak_3       152        .  10.23664  19.19137  15.22631
      [3]     chr1     714087-714492      * |    MACS_peak_10        27        .   4.34309   5.50985   2.78392

but then I am getting another error as also seen in the

covplot(peak = peak, weightCol="V5")
Error in .normarg_shift_or_weight(weight, "weight", x) : 
  'weight' must be a numeric vector, a single string, or a list-like object

any help would be appreciated.

chipseeker readpeakfile • 257 views
ADD COMMENTlink modified 6 months ago • written 6 months ago by theodore.georgomanolis0

Looks like the readPeakFile only takes one file at a time? I wrote a for loop to read all the files into Granges format.

Yu also provided a link to use GRangesList instead, which will solve the problem

ADD REPLYlink modified 4 months ago • written 4 months ago by 200dumplings0
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: 352 users visited in the last hour