kundajelab / phantompeakqualtools

This package computes informative enrichment and quality measures for ChIP-seq/DNase-seq/FAIRE-seq/MNase-seq data. It can also be used to obtain robust estimates of the predominant fragment length or characteristic tag shift values in these assays.
BSD 3-Clause "New" or "Revised" License
55 stars 17 forks source link

cannot find runmean function #9

Closed bioinfouser closed 4 years ago

bioinfouser commented 6 years ago

In this line: c$y <- runmean(cc$y,sbw,alg="fast")

in newer R version(atleast, 3.4.4), runmean is not found. Instead, library(caTools) should be called, then runmean can be used.

Ivana-G-Sh commented 5 years ago

I have the same problem with my R version3.5.1.

Note: I am a wet-lab biologist and I just want to analyze my ChIP-seq. Also please note, this is my first post so have mercy..

I have MacOS Mojave v 10.14 so I have used conda to install phantompeakqualtools since I cannot install it from this webpage because I do not have Linux.

First I have created a new conda environment called peaks and then installed:

conda install -c bioconda samtools conda install -c bioconda phantompeakqualtools conda install -c conda-forge ncurses conda install -c anaconda gawk conda install r-spp conda install -c r r-catools conda install -c r r-bitops

However, for already 2 days when I try to run phantopeakqualtools I get the same error message: Error in runmean(cc$y, sbw, alg = "fast") : could not find function "runmean" Execution halted

Here is how it looks like in my Terminal: (peaks) MAC202969:ivana$ run_spp.R -c=4_S44_L008_R1_001.fastq.sam.bam.sorted.bam -i=2_S42_L008_R1_001.fastq.sam.bam.sorted.bam -savp -out=Control_IP_rep1 -savp=Control_IP_rep1 ################ ChIP data: 4_S44_L008_R1_001.fastq.sam.bam.sorted.bam Control data: 2_S42_L008_R1_001.fastq.sam.bam.sorted.bam strandshift(min): -500 strandshift(step): 5 strandshift(max) 1500 user-defined peak shift NA exclusion(min): 10 exclusion(max): NaN num parallel nodes: NA FDR threshold: 0.01 NumPeaks Threshold: NA Output Directory: . narrowPeak output file name: NA regionPeak output file name: NA Rdata filename: NA plot pdf filename: Control_IP_rep1 result filename: Control_IP_rep1 Overwrite files?: FALSE

[1] TRUE [1] TRUE Loading required package: Rcpp Reading ChIP tagAlign/BAM file 4_S44_L008_R1_001.fastq.sam.bam.sorted.bam opened /var/folders/d4/984vl4kd32s7nhmqwqv44hmw0000gn/T//RtmpWkqAhN/4_S44_L008_R1_001.fastq.sam.tagAlign.sorted.bam109ab48a1d2dc done. read 28396322 fragments ChIP data read length 51 [1] TRUE Reading Control tagAlign/BAM file 2_S42_L008_R1_001.fastq.sam.bam.sorted.bam opened /var/folders/d4/984vl4kd32s7nhmqwqv44hmw0000gn/T//RtmpWkqAhN/2_S42_L008_R1_001.fastq.sam.tagAlign.sorted.bam109ab781a8ec4 done. read 25332203 fragments Control data read length 51 Calculating peak characteristics Minimum cross-correlation value 0.2694849 Minimum cross-correlation shift 1500 Error in runmean(cc$y, sbw, alg = "fast") : could not find function "runmean" Execution halted

I have checked multiple times and installed multiple times r-catools: (peaks) MAC202969:ivana$ conda search r-catools Loading channels: done

Name Version Build Channel

r-catools 1.17.1 r3.2.1_2 r
r-catools 1.17.1 r3.2.1_2 pkgs/r
r-catools 1.17.1 r3.2.1_2a r
r-catools 1.17.1 r3.2.1_2a pkgs/r
r-catools 1.17.1 r3.2.2_0 bioconda
r-catools 1.17.1 r3.2.2_2 r
r-catools 1.17.1 r3.2.2_2 pkgs/r
r-catools 1.17.1 r3.2.2_2a r
r-catools 1.17.1 r3.2.2_2a pkgs/r
r-catools 1.17.1 r3.3.1_0 bioconda
r-catools 1.17.1 r3.3.1_1 bioconda
r-catools 1.17.1 r3.3.1_2 r
r-catools 1.17.1 r3.3.1_2 pkgs/r
r-catools 1.17.1 r3.3.2_0 conda-forge
r-catools 1.17.1 r3.3.2_1 bioconda
r-catools 1.17.1 r3.3.2_2 r
r-catools 1.17.1 r3.3.2_2 pkgs/r
r-catools 1.17.1 r3.4.1_0 conda-forge
r-catools 1.17.1 r3.4.1_2 r
r-catools 1.17.1 r3.4.1_2 pkgs/r
r-catools 1.17.1 r342hb039934_4 r
r-catools 1.17.1 r342hb039934_4 pkgs/r
r-catools 1.17.1 r342hd75695f_2 r
r-catools 1.17.1 r342hd75695f_2 pkgs/r
r-catools 1.17.1 r343he124285_4 r
r-catools 1.17.1 r343he124285_4 pkgs/r
r-catools 1.17.1 r350h1104f25_4 r
r-catools 1.17.1 r350h1104f25_4 pkgs/r
r-catools 1.17.1.1 r341_0 conda-forge
r-catools 1.17.1.1 r341h9d2a408_1 conda-forge
r-catools 1.17.1.1 r341h9d2a408_2 conda-forge
r-catools 1.17.1.1 r341hfc679d8_1 conda-forge
r-catools 1.17.1.1 r351h32998d9_0 r
r-catools 1.17.1.1 r351h32998d9_0 pkgs/r
r-catools 1.17.1.1 r351h466af19_1002 conda-forge
r-catools 1.17.1.1 r351h9d2a408_2 conda-forge

these are all packages in my environment:

Name Version Build Channel

_r-mutex 1.0.0 anacondar_1
bioconductor-biocgenerics 0.26.0 r351_0 bioconda bioconductor-biocparallel 1.14.2 r351h26a2512_0 bioconda bioconductor-biostrings 2.48.0 r351h470a237_0 bioconda bioconductor-genomeinfodb 1.16.0 r351_0 bioconda bioconductor-genomeinfodbdata 1.1.0 r351_0 bioconda bioconductor-genomicranges 1.32.7 r351h470a237_0 bioconda bioconductor-iranges 2.14.12 r351h470a237_0 bioconda bioconductor-rsamtools 1.32.3 r351hfc679d8_0 bioconda bioconductor-s4vectors 0.18.3 r351h470a237_0 bioconda bioconductor-xvector 0.20.0 r351h470a237_0 bioconda bioconductor-zlibbioc 1.26.0 r351h470a237_0 bioconda boost 1.63.0 py36_5 conda-forge boost-cpp 1.63.0 2 conda-forge bwidget 1.9.11 1
bzip2 1.0.6 h1de35cc_1002 conda-forge ca-certificates 2018.11.29 ha4d7672_0 conda-forge cairo 1.14.12 h9d4d9ac_1005 conda-forge certifi 2018.11.29 py36_1000 conda-forge curl 7.63.0 heae2a1f_1000 conda-forge fontconfig 2.13.1 h1e4e890_1000 conda-forge freetype 2.9.1 h5a5313f_1004 conda-forge gettext 0.19.8.1 hcca000d_1001 conda-forge glib 2.56.2 h67dad55_1001 conda-forge graphite2 1.3.13 h2098e52_1000 conda-forge gsl 2.2.1 h002c638_3
harfbuzz 1.9.0 h9889186_1001 conda-forge icu 58.2 h0a44026_1000 conda-forge jpeg 9c h1de35cc_1001 conda-forge krb5 1.16.3 h24a3359_1000 conda-forge libcurl 7.63.0 h76de61e_1000 conda-forge libcxx 7.0.0 h2d50403_2 conda-forge libdeflate 1.0 h470a237_0 bioconda libedit 3.1.20170329 hcfe32e1_1001 conda-forge libffi 3.2.1 h0a44026_1005 conda-forge libgfortran 3.0.0 1001 conda-forge libiconv 1.15 h1de35cc_1004 conda-forge libpng 1.6.36 ha441bb4_1000 conda-forge libssh2 1.8.0 hf30b1f0_1003 conda-forge libtiff 4.0.10 h79f4b77_1001 conda-forge libxml2 2.9.8 hf14e9c8_1005 conda-forge llvm-meta 7.0.0 0 conda-forge llvm-openmp 4.0.1 hcfea43d_1
make 4.2.1 h1de35cc_2004 conda-forge ncurses 6.1 h0a44026_1002 conda-forge openssl 1.0.2p h1de35cc_1002 conda-forge pango 1.40.14 h57a785b_1003 conda-forge pcre 8.41 h0a44026_1003 conda-forge phantompeakqualtools 1.2 0 bioconda pip 18.1 py36_1000 conda-forge pixman 0.34.0 h1de35cc_1003 conda-forge python 3.6.7 h4a56312_1001 conda-forge r-base 3.5.1 h4864ece_5 conda-forge r-bh 1.66.0_1 r351_2001 conda-forge r-bitops 1.0_6 r351h6402f54_4 r r-catools 1.17.1.1 r351h466af19_1002 conda-forge r-formatr 1.5 r351h6115d3f_1001 conda-forge r-futile.logger 1.4.3 r351h6115d3f_1001 conda-forge r-futile.options 1.0.1 r351h6115d3f_1000 conda-forge r-lambda.r 1.2.3 r351h6115d3f_1000 conda-forge r-rcpp 1.0.0 r351h466af19_1000 conda-forge r-rcurl 1.95_4.11 r351h46e59ec_1003 conda-forge r-snow 0.4_3 r351h6115d3f_1000 conda-forge r-snowfall 1.84_6.1 r351h6115d3f_1001 conda-forge r-spp 1.15.5 r351h9d2a408_0 bioconda readline 7.0 hcfe32e1_1001 conda-forge samtools 1.9 h8ee4bcc_1 bioconda setuptools 40.6.3 py36_0 conda-forge sqlite 3.26.0 h1765d9f_1000 conda-forge tk 8.6.9 ha441bb4_1000 conda-forge tktable 2.10 h1de35cc_0
wget 1.19.5 hf30b1f0_0
wheel 0.32.3 py36_0 conda-forge xz 5.2.4 h1de35cc_1001 conda-forge zlib 1.2.11 h1de35cc_1004 conda-forge

THANK YOU!!!!!

akundaje commented 5 years ago

Please use the new pipeline specified here https://github.com/ENCODE-DCC/chip-seq-pipeline2

On Thu, Jan 17, 2019, 7:26 AM Ivana-G-Sh <notifications@github.com wrote:

I have the same problem with my R version3.5.1.

Note: I am a wet-lab biologist and I just want to analyze my ChIP-seq. Also please note, this is my first post so have mercy..

I have MacOS Mojave v 10.14 so I have used conda to install phantompeakqualtools since I cannot install it from this webpage because I do not have Linux.

First I have created a new conda environment called peaks and then installed:

conda install -c bioconda samtools conda install -c bioconda phantompeakqualtools conda install -c conda-forge ncurses conda install -c anaconda gawk conda install r-spp conda install -c r r-catools conda install -c r r-bitops

However, for already 2 days when I try to run phantopeakqualtools I get the same error message: Error in runmean(cc$y, sbw, alg = "fast") : could not find function "runmean" Execution halted

Here is how it looks like in my Terminal: (peaks) MAC202969:ivana$ run_spp.R -c=4_S44_L008_R1_001.fastq.sam.bam.sorted.bam -i=2_S42_L008_R1_001.fastq.sam.bam.sorted.bam -savp -out=Control_IP_rep1 -savp=Control_IP_rep1 ################ ChIP data: 4_S44_L008_R1_001.fastq.sam.bam.sorted.bam Control data: 2_S42_L008_R1_001.fastq.sam.bam.sorted.bam strandshift(min): -500 strandshift(step): 5 strandshift(max) 1500 user-defined peak shift NA exclusion(min): 10 exclusion(max): NaN num parallel nodes: NA FDR threshold: 0.01 NumPeaks Threshold: NA Output Directory: . narrowPeak output file name: NA regionPeak output file name: NA Rdata filename: NA plot pdf filename: Control_IP_rep1 result filename: Control_IP_rep1 Overwrite files?: FALSE

[1] TRUE [1] TRUE Loading required package: Rcpp Reading ChIP tagAlign/BAM file 4_S44_L008_R1_001.fastq.sam.bam.sorted.bam opened /var/folders/d4/984vl4kd32s7nhmqwqv44hmw0000gn/T//RtmpWkqAhN/4_S44_L008_R1_001.fastq.sam.tagAlign.sorted.bam109ab48a1d2dc done. read 28396322 fragments ChIP data read length 51 [1] TRUE Reading Control tagAlign/BAM file 2_S42_L008_R1_001.fastq.sam.bam.sorted.bam opened /var/folders/d4/984vl4kd32s7nhmqwqv44hmw0000gn/T//RtmpWkqAhN/2_S42_L008_R1_001.fastq.sam.tagAlign.sorted.bam109ab781a8ec4 done. read 25332203 fragments Control data read length 51 Calculating peak characteristics Minimum cross-correlation value 0.2694849 Minimum cross-correlation shift 1500 Error in runmean(cc$y, sbw, alg = "fast") : could not find function "runmean" Execution halted

I have checked multiple times and installed multiple times r-catools: (peaks) MAC202969:ivana$ conda search r-catools Loading channels: done Name Version Build Channel

r-catools 1.17.1 r3.2.1_2 r r-catools 1.17.1 r3.2.1_2 pkgs/r r-catools 1.17.1 r3.2.1_2a r r-catools 1.17.1 r3.2.1_2a pkgs/r r-catools 1.17.1 r3.2.2_0 bioconda r-catools 1.17.1 r3.2.2_2 r r-catools 1.17.1 r3.2.2_2 pkgs/r r-catools 1.17.1 r3.2.2_2a r r-catools 1.17.1 r3.2.2_2a pkgs/r r-catools 1.17.1 r3.3.1_0 bioconda r-catools 1.17.1 r3.3.1_1 bioconda r-catools 1.17.1 r3.3.1_2 r r-catools 1.17.1 r3.3.1_2 pkgs/r r-catools 1.17.1 r3.3.2_0 conda-forge r-catools 1.17.1 r3.3.2_1 bioconda r-catools 1.17.1 r3.3.2_2 r r-catools 1.17.1 r3.3.2_2 pkgs/r r-catools 1.17.1 r3.4.1_0 conda-forge r-catools 1.17.1 r3.4.1_2 r r-catools 1.17.1 r3.4.1_2 pkgs/r r-catools 1.17.1 r342hb039934_4 r r-catools 1.17.1 r342hb039934_4 pkgs/r r-catools 1.17.1 r342hd75695f_2 r r-catools 1.17.1 r342hd75695f_2 pkgs/r r-catools 1.17.1 r343he124285_4 r r-catools 1.17.1 r343he124285_4 pkgs/r r-catools 1.17.1 r350h1104f25_4 r r-catools 1.17.1 r350h1104f25_4 pkgs/r r-catools 1.17.1.1 r341_0 conda-forge r-catools 1.17.1.1 r341h9d2a408_1 conda-forge r-catools 1.17.1.1 r341h9d2a408_2 conda-forge r-catools 1.17.1.1 r341hfc679d8_1 conda-forge r-catools 1.17.1.1 r351h32998d9_0 r r-catools 1.17.1.1 r351h32998d9_0 pkgs/r r-catools 1.17.1.1 r351h466af19_1002 conda-forge r-catools 1.17.1.1 r351h9d2a408_2 conda-forge

these are all packages in my environment: Name Version Build Channel

_r-mutex 1.0.0 anacondar_1 bioconductor-biocgenerics 0.26.0 r351_0 bioconda bioconductor-biocparallel 1.14.2 r351h26a2512_0 bioconda bioconductor-biostrings 2.48.0 r351h470a237_0 bioconda bioconductor-genomeinfodb 1.16.0 r351_0 bioconda bioconductor-genomeinfodbdata 1.1.0 r351_0 bioconda bioconductor-genomicranges 1.32.7 r351h470a237_0 bioconda bioconductor-iranges 2.14.12 r351h470a237_0 bioconda bioconductor-rsamtools 1.32.3 r351hfc679d8_0 bioconda bioconductor-s4vectors 0.18.3 r351h470a237_0 bioconda bioconductor-xvector 0.20.0 r351h470a237_0 bioconda bioconductor-zlibbioc 1.26.0 r351h470a237_0 bioconda boost 1.63.0 py36_5 conda-forge boost-cpp 1.63.0 2 conda-forge bwidget 1.9.11 1 bzip2 1.0.6 h1de35cc_1002 conda-forge ca-certificates 2018.11.29 ha4d7672_0 conda-forge cairo 1.14.12 h9d4d9ac_1005 conda-forge certifi 2018.11.29 py36_1000 conda-forge curl 7.63.0 heae2a1f_1000 conda-forge fontconfig 2.13.1 h1e4e890_1000 conda-forge freetype 2.9.1 h5a5313f_1004 conda-forge gettext 0.19.8.1 hcca000d_1001 conda-forge glib 2.56.2 h67dad55_1001 conda-forge graphite2 1.3.13 h2098e52_1000 conda-forge gsl 2.2.1 h002c638_3 harfbuzz 1.9.0 h9889186_1001 conda-forge icu 58.2 h0a44026_1000 conda-forge jpeg 9c h1de35cc_1001 conda-forge krb5 1.16.3 h24a3359_1000 conda-forge libcurl 7.63.0 h76de61e_1000 conda-forge libcxx 7.0.0 h2d50403_2 conda-forge libdeflate 1.0 h470a237_0 bioconda libedit 3.1.20170329 hcfe32e1_1001 conda-forge libffi 3.2.1 h0a44026_1005 conda-forge libgfortran 3.0.0 1001 conda-forge libiconv 1.15 h1de35cc_1004 conda-forge libpng 1.6.36 ha441bb4_1000 conda-forge libssh2 1.8.0 hf30b1f0_1003 conda-forge libtiff 4.0.10 h79f4b77_1001 conda-forge libxml2 2.9.8 hf14e9c8_1005 conda-forge llvm-meta 7.0.0 0 conda-forge llvm-openmp 4.0.1 hcfea43d_1 make 4.2.1 h1de35cc_2004 conda-forge ncurses 6.1 h0a44026_1002 conda-forge openssl 1.0.2p h1de35cc_1002 conda-forge pango 1.40.14 h57a785b_1003 conda-forge pcre 8.41 h0a44026_1003 conda-forge phantompeakqualtools 1.2 0 bioconda pip 18.1 py36_1000 conda-forge pixman 0.34.0 h1de35cc_1003 conda-forge python 3.6.7 h4a56312_1001 conda-forge r-base 3.5.1 h4864ece_5 conda-forge r-bh 1.66.0_1 r351_2001 conda-forge r-bitops 1.0_6 r351h6402f54_4 r r-catools 1.17.1.1 r351h466af19_1002 conda-forge r-formatr 1.5 r351h6115d3f_1001 conda-forge r-futile.logger 1.4.3 r351h6115d3f_1001 conda-forge r-futile.options 1.0.1 r351h6115d3f_1000 conda-forge r-lambda.r 1.2.3 r351h6115d3f_1000 conda-forge r-rcpp 1.0.0 r351h466af19_1000 conda-forge r-rcurl 1.95_4.11 r351h46e59ec_1003 conda-forge r-snow 0.4_3 r351h6115d3f_1000 conda-forge r-snowfall 1.84_6.1 r351h6115d3f_1001 conda-forge r-spp 1.15.5 r351h9d2a408_0 bioconda readline 7.0 hcfe32e1_1001 conda-forge samtools 1.9 h8ee4bcc_1 bioconda setuptools 40.6.3 py36_0 conda-forge sqlite 3.26.0 h1765d9f_1000 conda-forge tk 8.6.9 ha441bb4_1000 conda-forge tktable 2.10 h1de35cc_0 wget 1.19.5 hf30b1f0_0 wheel 0.32.3 py36_0 conda-forge xz 5.2.4 h1de35cc_1001 conda-forge zlib 1.2.11 h1de35cc_1004 conda-forge

THANK YOU!!!!!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kundajelab/phantompeakqualtools/issues/9#issuecomment-455211770, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI7EaFSdCbv3uYa4AzkFejc1Rz2eFw8ks5vEJYdgaJpZM4VIIpK .

leepc12 commented 5 years ago

Please try with a Conda environment in our ChIP-Seq pipeline.

To install a Conda env for phantompeakqualtools, follow an instruction (item 2, 5 and 6) on https://github.com/ENCODE-DCC/chip-seq-pipeline2/blob/master/docs/tutorial_local_conda.md.

$ source activate encode-chip-seq-pipeline
$ Rscript run_spp ...
Ivana-G-Sh commented 5 years ago

Thank you, I will!!

cwarden45 commented 5 years ago

When I encountered the issue, it could be fixed by add library(caTools) into the code (above the c$y <- runmean(cc$y,sbw,alg="fast") line ), as described in the question.

Since I overlooked that solution when I first read through the answers, I thought I should mention this.

Likewise, as mentioned, I didn't previously have this issue, until I updated by version of R. So, I think this is only an issue if using R 3.4 or later.

Ivana-G-Sh commented 5 years ago

Hello! Thank you very much for the reply. We have installed the pipeline and it works awsome! Best Ivana

On Mon, Mar 25, 2019, 16:22 Charles Warden notifications@github.com wrote:

When I encountered the issue, it could be fixed by add library(caTools) into the code (above the c$y <- runmean(cc$y,sbw,alg="fast") line ), as described in the question.

Since I didn't see that solution when I first read through the answers, I thought I should mention this.

Likewise, as mentioned, I didn't previously have this issue, until I updated by version of R. So, I think this is only an issue if using R 3.4 or later.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kundajelab/phantompeakqualtools/issues/9#issuecomment-476362035, or mute the thread https://github.com/notifications/unsubscribe-auth/AsnsVHLHypHYi35jcteAlGixig1uQsudks5vaTAKgaJpZM4VIIpK .

russHyde commented 5 years ago

Added a pull request to fix this: https://github.com/kundajelab/phantompeakqualtools/pull/12

annashcherbina commented 4 years ago

library(caTools) has been added to run_spp.R