Hi Michael and Janet, I think that the reduce bug still persists in the devel branch. I updated all my Bioconductor packages yesterday and yet, following her steps I get
> reduce(myregions_RD) Error in endoapply(x[, by], FUN) : 'FUN' did not produce an endomorphism I hope the sessionInfo() helps. Thank you, Ivan > sessionInfo() R version 2.13.0 Under development (unstable) (2010-12-02 r53747) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C [3] LC_TIME=en_US.utf8 LC_COLLATE=en_US.utf8 [5] LC_MONETARY=C LC_MESSAGES=en_US.utf8 [7] LC_PAPER=en_US.utf8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] ChIPpeakAnno_1.7.0 limma_3.7.23 [3] org.Hs.eg.db_2.4.6 GO.db_2.4.5 [5] RSQLite_0.9-4 DBI_0.2-5 [7] AnnotationDbi_1.13.13 BSgenome.Ecoli.NCBI.20080805_1.3.17 [9] multtest_2.7.1 Biobase_2.11.8 [11] biomaRt_2.7.1 BSgenome.Mmusculus.UCSC.mm9_1.3.17 [13] BSgenome_1.19.3 Biostrings_2.19.9 [15] GenomicRanges_1.3.18 IRanges_1.9.22 loaded via a namespace (and not attached): [1] MASS_7.3-11 RCurl_1.5-0 splines_2.13.0 survival_2.36-5 [5] XML_3.2-0 Ivan Gregoretti, PhD National Institute of Diabetes and Digestive and Kidney Diseases National Institutes of Health 5 Memorial Dr, Building 5, Room 205. Bethesda, MD 20892. USA. Phone: 1-301-496-1016 and 1-301-496-1592 Fax: 1-301-496-9878 On Thu, Feb 24, 2011 at 9:46 AM, Michael Lawrence <[email protected]> wrote: > Thanks. Seems to be fixed already in devel. > > On Wed, Feb 23, 2011 at 12:15 PM, Janet Young <[email protected]> wrote: > >> Hi again, >> >> I noticed that "reduce" gives an error on RangedData objects if there are >> space names that contain no ranges: >> Error in endoapply(x[, by], FUN) : 'FUN' did not produce an >> endomorphism >> >> I can work around it, but it'd great not to need to do that. All the >> details are below. >> >> thanks very much, >> >> Janet >> >> ------------------------------------------------------------------- >> >> Dr. Janet Young (Trask lab) >> >> Fred Hutchinson Cancer Research Center >> 1100 Fairview Avenue N., C3-168, >> P.O. Box 19024, Seattle, WA 98109-1024, USA. >> >> tel: (206) 667 1471 fax: (206) 667 6524 >> email: jayoung ...at... fhcrc.org >> >> http://www.fhcrc.org/labs/trask/ >> >> ------------------------------------------------------------------- >> >> >> >> > library(IRanges,warn.conflicts=F) >> >> > myregions_RD <- >> RangedData(IRanges(start=c(101L,201L,101L,101L),end=c(250L,300L,220L,501L)),space=c("chr1","chr1","chr1","chr2"),strand=c("+","+","+","+") >> ) >> >> > #### this works >> > reduce(myregions_RD) >> RangedData with 2 rows and 1 value column across 2 spaces >> space ranges | strand >> <character> <IRanges> | <character> >> 1 chr1 [101, 300] | + >> 2 chr2 [101, 501] | + >> >> > ### drop regions that are bigger than 300bp (now there's nothing left on >> chr2) >> > myregions_RD <- myregions_RD[which(width(myregions_RD)<=300),] >> >> > ### this doesn't work - reduce doesn't like a space without any elements >> > reduce(myregions_RD) >> Error in endoapply(x[, by], FUN) : 'FUN' did not produce an endomorphism >> >> > ### workaround - drop the unused space names >> > myregions_RD <- >> RangedData(IRanges(start=start(myregions_RD),end=end(myregions_RD)),space=as.character(space(myregions_RD)),strand=myregions_RD$strand >> ) >> >> > ### now it works >> > reduce(myregions_RD) >> RangedData with 1 row and 1 value column across 1 space >> space ranges | strand >> <character> <IRanges> | <character> >> 1 chr1 [101, 300] | + >> >> > sessionInfo() >> R version 2.12.1 (2010-12-16) >> Platform: i386-apple-darwin9.8.0/i386 (32-bit) >> >> locale: >> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods base >> >> other attached packages: >> [1] IRanges_1.8.9 >> >> _______________________________________________ >> Bioc-sig-sequencing mailing list >> [email protected] >> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing >> > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioc-sig-sequencing mailing list > [email protected] > https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing > _______________________________________________ Bioc-sig-sequencing mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
