error in bayespeak function
1
0
Entering edit mode
@andreia-fonseca-3796
Last seen 7.8 years ago
Dear all, I am analyzing chipseq data and I am trying to use bayespeak package for peak detection. The code that I am using is #call libraries library(GenomicRanges) Library(BayesPeak) library(ShortRead) library(chipseq) library(ChIPpeakAnno) library(multicore) library(GenomicFeatures) #read sample JKA JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_unique _forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_fil tered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA<-readBamGappedAlignments(JKA) IRanges_JKA<-ranges(Granges_JKA) #read Input JKA JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_fil tered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA_I<-readBamGappedAlignments(JKA_I) IRanges_JKA_I<-ranges(Granges_JKA_I) #Peak Calling with BayesPeak raw.output <- bayespeak(treatment=JKA, control=JKA_I,use.multicore = TRUE, mc.cores = 4) after the last command I am getting the forllowing error: Error in substring(temp[1], 1, 5) : invalid multibyte string at '<ed>' I also tried to remove the use of parallelization but the error remains the same, can someone tell me what I am doing wrong ? thanks for the help, Andreia bellow is the information concerning sessionInfo sessionInfo() R version 2.13.1 (2011-07-08) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] BayesPeak_1.4.0 GenomicFeatures_1.4.3 [3] multicore_0.1-5 ChIPpeakAnno_1.8.0 [5] limma_3.8.2 org.Hs.eg.db_2.5.0 [7] GO.db_2.4.1 RSQLite_0.9-1 [9] DBI_0.2-5 AnnotationDbi_1.14.1 [11] BSgenome.Ecoli.NCBI.20080805_1.3.17 multtest_2.8.0 [13] Biobase_2.12.2 biomaRt_2.8.1 [15] chipseq_1.2.0 BSgenome_1.20.0 [17] ShortRead_1.10.4 Rsamtools_1.4.2 [19] lattice_0.19-30 Biostrings_2.20.1 [21] GenomicRanges_1.4.6 IRanges_1.10.4 loaded via a namespace (and not attached): [1] grid_2.13.1 hwriter_1.2 MASS_7.3-13 RCurl_1.4-2 [5] rtracklayer_1.12.4 splines_2.13.1 survival_2.36-9 tools_2.13.1 [9] XML_3.1-0 -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral@fm.ul.pt ; andreiaamaral@fc.ul.pt [[alternative HTML version deleted]]
ChIPSeq GO BSgenome BSgenome chipseq BayesPeak ChIPSeq GO BSgenome BSgenome chipseq • 2.1k views
ADD COMMENT
0
Entering edit mode
@jonathan-cairns-4111
Last seen 10.2 years ago
Hi Andreia, On the line "IRanges_JKA<-ranges(Granges_JKA)", you are converting a genomicRanges object to an IRanges object. BayesPeak accepts a RangedData object, as opposed to an IRanges object (in order to retain chromosome information). Replace IRanges_JKA<-ranges(Granges_JKA) with IRanges_JKA<-as(Granges_JKA, "RangedData") and it should run properly. Hope this helps, Jonathan P.S. additionally, the line Library(BayesPeak) should be library(BayesPeak) - you obviously know this, else you wouldn't be getting the correct sessionInfo(), but I point this out in case anybody else tries to run the code... ________________________________________ From: Andreia Fonseca [andreia.fonseca@gmail.com] Sent: 20 July 2011 15:24 To: Jonathan Cairns; bioconductor Subject: error in bayespeak function Dear all, I am analyzing chipseq data and I am trying to use bayespeak package for peak detection. The code that I am using is #call libraries library(GenomicRanges) Library(BayesPeak) library(ShortRead) library(chipseq) library(ChIPpeakAnno) library(multicore) library(GenomicFeatures) #read sample JKA JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_unique _forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2_s eq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA<-readBamGappedAlignments(JKA) IRanges_JKA<-ranges(Granges_JKA) #read Input JKA JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2 _seq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA_I<-readBamGappedAlignments(JKA_I) IRanges_JKA_I<-ranges(Granges_JKA_I) #Peak Calling with BayesPeak raw.output <- bayespeak(treatment=JKA, control=JKA_I,use.multicore = TRUE, mc.cores = 4) after the last command I am getting the forllowing error: Error in substring(temp[1], 1, 5) : invalid multibyte string at '<ed>' I also tried to remove the use of parallelization but the error remains the same, can someone tell me what I am doing wrong ? thanks for the help, Andreia bellow is the information concerning sessionInfo sessionInfo() R version 2.13.1 (2011-07-08) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] BayesPeak_1.4.0 GenomicFeatures_1.4.3 [3] multicore_0.1-5 ChIPpeakAnno_1.8.0 [5] limma_3.8.2 org.Hs.eg.db_2.5.0 [7] GO.db_2.4.1 RSQLite_0.9-1 [9] DBI_0.2-5 AnnotationDbi_1.14.1 [11] BSgenome.Ecoli.NCBI.20080805_1.3.17 multtest_2.8.0 [13] Biobase_2.12.2 biomaRt_2.8.1 [15] chipseq_1.2.0 BSgenome_1.20.0 [17] ShortRead_1.10.4 Rsamtools_1.4.2 [19] lattice_0.19-30 Biostrings_2.20.1 [21] GenomicRanges_1.4.6 IRanges_1.10.4 loaded via a namespace (and not attached): [1] grid_2.13.1 hwriter_1.2 MASS_7.3-13 RCurl_1.4-2 [5] rtracklayer_1.12.4 splines_2.13.1 survival_2.36-9 tools_2.13.1 [9] XML_3.1-0 -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral at fm.ul.pt<mailto:email%3aandreiaamaral at="" fm.ul.pt=""> ; andreiaamaral at fc.ul.pt<mailto:andreiaamaral at="" fc.ul.pt=""> NOTICE AND DISCLAIMER This e-mail (including any attachments) is intended for ...{{dropped:16}}
ADD COMMENT
0
Entering edit mode
Hi Jonathan, thanks for the help, I have another error now! I have changed the code as you suggested and I also spotted that in bayespeak I was calling the bam object instead of the IRanges object, still the IRanges object is not proper as you mentioned. I manage to create a RangeData object but : #call libraries library(GenomicRanges) library(BayesPeak) library(ShortRead) library(chipseq) library(ChIPpeakAnno) library(multicore) library(GenomicFeatures) #read sample JKA JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_unique _forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_fil tered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA<-readBamGappedAlignments(JKA) GIRanges_JKA<-as(Granges_JKA, "GRanges") IRanges_JKA<-as(GIRanges_JKA, "RangedData") #read Input JKA JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_fil tered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA_I<-readBamGappedAlignments(JKA_I) GIRanges_JKA_I<-as(Granges_JKA_I, "GRanges") IRanges_JKA_I<-as(GIRanges_JKA_I, "RangedData") #Peak Calling with BayesPeak raw.output <- bayespeak(treatment=IRanges_JKA, control=IRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) error message Error in `[.default`(space(bed), sel) : invalid subscript type 'S4' any idea? thanks On Wed, Jul 20, 2011 at 3:38 PM, Jonathan Cairns < Jonathan.Cairns@cancer.org.uk> wrote: > Hi Andreia, > > On the line "IRanges_JKA<-ranges(Granges_JKA)", you are converting a > genomicRanges object to an IRanges object. BayesPeak accepts a RangedData > object, as opposed to an IRanges object (in order to retain chromosome > information). Replace > > IRanges_JKA<-ranges(Granges_JKA) > > with > > IRanges_JKA<-as(Granges_JKA, "RangedData") > > and it should run properly. > > Hope this helps, > > Jonathan > > > P.S. additionally, the line Library(BayesPeak) should be library(BayesPeak) > - you obviously know this, else you wouldn't be getting the correct > sessionInfo(), but I point this out in case anybody else tries to run the > code... > > ________________________________________ > From: Andreia Fonseca [andreia.fonseca@gmail.com] > Sent: 20 July 2011 15:24 > To: Jonathan Cairns; bioconductor > Subject: error in bayespeak function > > Dear all, > > I am analyzing chipseq data and I am trying to use bayespeak package for > peak detection. > The code that I am using is > > #call libraries > library(GenomicRanges) > Library(BayesPeak) > library(ShortRead) > library(chipseq) > library(ChIPpeakAnno) > library(multicore) > library(GenomicFeatures) > > #read sample JKA > JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", > overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_f iltered.txt_unique_forfastq.fastq_SAM_BAM") > Granges_JKA<-readBamGappedAlignments(JKA) > IRanges_JKA<-ranges(Granges_JKA) > > #read Input JKA > JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_un ique_forfastq.fastq_SAM", > overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_f iltered.txt_unique_forfastq.fastq_SAM_BAM") > Granges_JKA_I<-readBamGappedAlignments(JKA_I) > IRanges_JKA_I<-ranges(Granges_JKA_I) > > #Peak Calling with BayesPeak > raw.output <- bayespeak(treatment=JKA, control=JKA_I,use.multicore = TRUE, > mc.cores = 4) > > after the last command I am getting the forllowing error: > Error in substring(temp[1], 1, 5) : invalid multibyte string at '<ed>' > > I also tried to remove the use of parallelization but the error remains the > same, can someone tell me what I am doing wrong ? > thanks for the help, > Andreia > > bellow is the information concerning sessionInfo > > sessionInfo() > R version 2.13.1 (2011-07-08) > Platform: x86_64-unknown-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 > [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=en_US.UTF-8 LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] BayesPeak_1.4.0 GenomicFeatures_1.4.3 > [3] multicore_0.1-5 ChIPpeakAnno_1.8.0 > [5] limma_3.8.2 org.Hs.eg.db_2.5.0 > [7] GO.db_2.4.1 RSQLite_0.9-1 > [9] DBI_0.2-5 AnnotationDbi_1.14.1 > [11] BSgenome.Ecoli.NCBI.20080805_1.3.17 multtest_2.8.0 > [13] Biobase_2.12.2 biomaRt_2.8.1 > [15] chipseq_1.2.0 BSgenome_1.20.0 > [17] ShortRead_1.10.4 Rsamtools_1.4.2 > [19] lattice_0.19-30 Biostrings_2.20.1 > [21] GenomicRanges_1.4.6 IRanges_1.10.4 > > loaded via a namespace (and not attached): > [1] grid_2.13.1 hwriter_1.2 MASS_7.3-13 RCurl_1.4-2 > [5] rtracklayer_1.12.4 splines_2.13.1 survival_2.36-9 tools_2.13.1 > [9] XML_3.1-0 > > > -- > > -------------------------------------------------------------------- ------------------------- > Andreia J. Amaral, PhD > BioFIG - Center for Biodiversity, Functional and Integrative Genomics > Instituto de Medicina Molecular > University of Lisbon > Tel: +352 217500000 (ext. office: 28253) > email:andreiaamaral@fm.ul.pt<mailto:email%3aandreiaamaral@fm.ul.pt> ; > andreiaamaral@fc.ul.pt<mailto:andreiaamaral@fc.ul.pt> > > > NOTICE AND DISCLAIMER > This e-mail (including any attachments) is intended fo...{{dropped:31}}
ADD REPLY
0
Entering edit mode
Dear Jonathan, Maybe it helps to see that my both sample and input information are now effectively RangedData objects IRanges_JKA RangedData with 3850192 rows and 1 value column across 25 spaces space ranges | strand <factor> <iranges> | <rle> 1 chr1 [10071, 10120] | + 2 chr1 [10074, 10123] | + 3 chr1 [10075, 10124] | + 4 chr1 [10075, 10124] | - 5 chr1 [10106, 10155] | - 6 chr1 [10147, 10196] | - 7 chr1 [10148, 10197] | + 8 chr1 [10149, 10198] | + 9 chr1 [10150, 10199] | + ... ... ... ... ... 3850184 chrM [16491, 16540] | - 3850185 chrM [16496, 16545] | - 3850186 chrM [16499, 16548] | + 3850187 chrM [16502, 16551] | + 3850188 chrM [16506, 16555] | - 3850189 chrM [16507, 16556] | + 3850190 chrM [16515, 16564] | - 3850191 chrM [16516, 16565] | - 3850192 chrM [16521, 16570] | + IRanges_JKA_I RangedData with 6443227 rows and 1 value column across 25 spaces space ranges | strand <factor> <iranges> | <rle> 1 chr1 [10073, 10122] | - 2 chr1 [10165, 10214] | + 3 chr1 [10445, 10494] | + 4 chr1 [13064, 13113] | + 5 chr1 [16060, 16109] | + 6 chr1 [16416, 16465] | - 7 chr1 [20103, 20152] | + 8 chr1 [20103, 20152] | + 9 chr1 [51428, 51477] | - ... ... ... ... ... 6443219 chrM [16509, 16558] | + 6443220 chrM [16511, 16560] | - 6443221 chrM [16512, 16561] | + 6443222 chrM [16513, 16562] | - 6443223 chrM [16516, 16565] | + 6443224 chrM [16516, 16565] | - 6443225 chrM [16517, 16566] | + 6443226 chrM [16518, 16567] | - 6443227 chrM [16520, 16569] | - On Wed, Jul 20, 2011 at 4:00 PM, Andreia Fonseca <andreia.fonseca@gmail.com>wrote: > Hi Jonathan, > > thanks for the help, I have another error now! I have changed the code as > you suggested and I also spotted that in bayespeak I was calling the bam > object instead of the IRanges object, still the IRanges object is not proper > as you mentioned. I manage to create a RangeData object but : > > > #call libraries > library(GenomicRanges) > library(BayesPeak) > library(ShortRead) > library(chipseq) > library(ChIPpeakAnno) > library(multicore) > library(GenomicFeatures) > > #read sample JKA > JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", > overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_f iltered.txt_unique_forfastq.fastq_SAM_BAM") > Granges_JKA<-readBamGappedAlignments(JKA) > GIRanges_JKA<-as(Granges_JKA, "GRanges") > IRanges_JKA<-as(GIRanges_JKA, "RangedData") > > > #read Input JKA > JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_un ique_forfastq.fastq_SAM", > overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_f iltered.txt_unique_forfastq.fastq_SAM_BAM") > Granges_JKA_I<-readBamGappedAlignments(JKA_I) > GIRanges_JKA_I<-as(Granges_JKA_I, "GRanges") > IRanges_JKA_I<-as(GIRanges_JKA_I, "RangedData") > > > #Peak Calling with BayesPeak > raw.output <- bayespeak(treatment=IRanges_JKA, > control=IRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) > > error message > > Error in `[.default`(space(bed), sel) : invalid subscript type 'S4' > > any idea? > thanks > > > > > On Wed, Jul 20, 2011 at 3:38 PM, Jonathan Cairns < > Jonathan.Cairns@cancer.org.uk> wrote: > >> Hi Andreia, >> >> On the line "IRanges_JKA<-ranges(Granges_JKA)", you are converting a >> genomicRanges object to an IRanges object. BayesPeak accepts a RangedData >> object, as opposed to an IRanges object (in order to retain chromosome >> information). Replace >> >> IRanges_JKA<-ranges(Granges_JKA) >> >> with >> >> IRanges_JKA<-as(Granges_JKA, "RangedData") >> >> and it should run properly. >> >> Hope this helps, >> >> Jonathan >> >> >> P.S. additionally, the line Library(BayesPeak) should be >> library(BayesPeak) - you obviously know this, else you wouldn't be getting >> the correct sessionInfo(), but I point this out in case anybody else tries >> to run the code... >> >> ________________________________________ >> From: Andreia Fonseca [andreia.fonseca@gmail.com] >> Sent: 20 July 2011 15:24 >> To: Jonathan Cairns; bioconductor >> Subject: error in bayespeak function >> >> Dear all, >> >> I am analyzing chipseq data and I am trying to use bayespeak package for >> peak detection. >> The code that I am using is >> >> #call libraries >> library(GenomicRanges) >> Library(BayesPeak) >> library(ShortRead) >> library(chipseq) >> library(ChIPpeakAnno) >> library(multicore) >> library(GenomicFeatures) >> >> #read sample JKA >> JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_uni que_forfastq.fastq_SAM", >> overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_ filtered.txt_unique_forfastq.fastq_SAM_BAM") >> Granges_JKA<-readBamGappedAlignments(JKA) >> IRanges_JKA<-ranges(Granges_JKA) >> >> #read Input JKA >> JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_u nique_forfastq.fastq_SAM", >> overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_ filtered.txt_unique_forfastq.fastq_SAM_BAM") >> Granges_JKA_I<-readBamGappedAlignments(JKA_I) >> IRanges_JKA_I<-ranges(Granges_JKA_I) >> >> #Peak Calling with BayesPeak >> raw.output <- bayespeak(treatment=JKA, control=JKA_I,use.multicore = TRUE, >> mc.cores = 4) >> >> after the last command I am getting the forllowing error: >> Error in substring(temp[1], 1, 5) : invalid multibyte string at '<ed>' >> >> I also tried to remove the use of parallelization but the error remains >> the same, can someone tell me what I am doing wrong ? >> thanks for the help, >> Andreia >> >> bellow is the information concerning sessionInfo >> >> sessionInfo() >> R version 2.13.1 (2011-07-08) >> Platform: x86_64-unknown-linux-gnu (64-bit) >> >> locale: >> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C >> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 >> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 >> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C >> [9] LC_ADDRESS=C LC_TELEPHONE=C >> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods base >> >> other attached packages: >> [1] BayesPeak_1.4.0 GenomicFeatures_1.4.3 >> [3] multicore_0.1-5 ChIPpeakAnno_1.8.0 >> [5] limma_3.8.2 org.Hs.eg.db_2.5.0 >> [7] GO.db_2.4.1 RSQLite_0.9-1 >> [9] DBI_0.2-5 AnnotationDbi_1.14.1 >> [11] BSgenome.Ecoli.NCBI.20080805_1.3.17 multtest_2.8.0 >> [13] Biobase_2.12.2 biomaRt_2.8.1 >> [15] chipseq_1.2.0 BSgenome_1.20.0 >> [17] ShortRead_1.10.4 Rsamtools_1.4.2 >> [19] lattice_0.19-30 Biostrings_2.20.1 >> [21] GenomicRanges_1.4.6 IRanges_1.10.4 >> >> loaded via a namespace (and not attached): >> [1] grid_2.13.1 hwriter_1.2 MASS_7.3-13 RCurl_1.4-2 >> [5] rtracklayer_1.12.4 splines_2.13.1 survival_2.36-9 tools_2.13.1 >> [9] XML_3.1-0 >> >> >> -- >> >> ------------------------------------------------------------------- -------------------------- >> Andreia J. Amaral, PhD >> BioFIG - Center for Biodiversity, Functional and Integrative Genomics >> Instituto de Medicina Molecular >> University of Lisbon >> Tel: +352 217500000 (ext. office: 28253) >> email:andreiaamaral@fm.ul.pt<mailto:email%3aandreiaamaral@fm.ul.pt> ; >> andreiaamaral@fc.ul.pt<mailto:andreiaamaral@fc.ul.pt> >> >> >> NOTICE AND DISCLAIMER >> This e-mail (including any attachments) is intended for the above- named >> person(s). If you are not the intended recipient, notify the sender >> immediately, delete this email from your system and do not disclose or use >> for any purpose. >> >> We may monitor all incoming and outgoing emails in line with current >> legislation. We have taken steps to ensure that this email and attachments >> are free from any virus, but it remains your responsibility to ensure that >> viruses do not adversely affect you. >> Cancer Research UK >> Registered in England and Wales >> Company Registered Number: 4325234. >> Registered Charity Number: 1089464 and Scotland SC041666 >> Registered Office Address: Angel Building, 407 St John Street, London EC1V >> 4AD. >> > > > > -- > > -------------------------------------------------------------------- ------------------------- > Andreia J. Amaral, PhD > BioFIG - Center for Biodiversity, Functional and Integrative Genomics > Instituto de Medicina Molecular > University of Lisbon > Tel: +352 217500000 (ext. office: 28253) > email:andreiaamaral@fm.ul.pt ; andreiaamaral@fc.ul.pt > > -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral@fm.ul.pt ; andreiaamaral@fc.ul.pt [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Andreia, That's very strange. What happens when you do: str(space(GIRanges_JKA)) str(space(GIRanges_JKA_I)) Do either of these result in an error? You could try attaching the package rtracklayer at the start; I find that this sometimes fixes odd IRanges behaviour. Jonathan ________________________________________ From: Andreia Fonseca [andreia.fonseca@gmail.com] Sent: 20 July 2011 17:11 To: Jonathan Cairns Cc: bioconductor Subject: Re: error in bayespeak function Dear Jonathan, Maybe it helps to see that my both sample and input information are now effectively RangedData objects IRanges_JKA RangedData with 3850192 rows and 1 value column across 25 spaces space ranges | strand <factor> <iranges> | <rle> 1 chr1 [10071, 10120] | + 2 chr1 [10074, 10123] | + 3 chr1 [10075, 10124] | + 4 chr1 [10075, 10124] | - 5 chr1 [10106, 10155] | - 6 chr1 [10147, 10196] | - 7 chr1 [10148, 10197] | + 8 chr1 [10149, 10198] | + 9 chr1 [10150, 10199] | + ... ... ... ... ... 3850184 chrM [16491, 16540] | - 3850185 chrM [16496, 16545] | - 3850186 chrM [16499, 16548] | + 3850187 chrM [16502, 16551] | + 3850188 chrM [16506, 16555] | - 3850189 chrM [16507, 16556] | + 3850190 chrM [16515, 16564] | - 3850191 chrM [16516, 16565] | - 3850192 chrM [16521, 16570] | + IRanges_JKA_I RangedData with 6443227 rows and 1 value column across 25 spaces space ranges | strand <factor> <iranges> | <rle> 1 chr1 [10073, 10122] | - 2 chr1 [10165, 10214] | + 3 chr1 [10445, 10494] | + 4 chr1 [13064, 13113] | + 5 chr1 [16060, 16109] | + 6 chr1 [16416, 16465] | - 7 chr1 [20103, 20152] | + 8 chr1 [20103, 20152] | + 9 chr1 [51428, 51477] | - ... ... ... ... ... 6443219 chrM [16509, 16558] | + 6443220 chrM [16511, 16560] | - 6443221 chrM [16512, 16561] | + 6443222 chrM [16513, 16562] | - 6443223 chrM [16516, 16565] | + 6443224 chrM [16516, 16565] | - 6443225 chrM [16517, 16566] | + 6443226 chrM [16518, 16567] | - 6443227 chrM [16520, 16569] | - On Wed, Jul 20, 2011 at 4:00 PM, Andreia Fonseca <andreia.fonseca at="" gmail.com<mailto:andreia.fonseca="" at="" gmail.com="">> wrote: Hi Jonathan, thanks for the help, I have another error now! I have changed the code as you suggested and I also spotted that in bayespeak I was calling the bam object instead of the IRanges object, still the IRanges object is not proper as you mentioned. I manage to create a RangeData object but : #call libraries library(GenomicRanges) library(BayesPeak) library(ShortRead) library(chipseq) library(ChIPpeakAnno) library(multicore) library(GenomicFeatures) #read sample JKA JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_unique _forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2_s eq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA<-readBamGappedAlignments(JKA) GIRanges_JKA<-as(Granges_JKA, "GRanges") IRanges_JKA<-as(GIRanges_JKA, "RangedData") #read Input JKA JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2 _seq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA_I<-readBamGappedAlignments(JKA_I) GIRanges_JKA_I<-as(Granges_JKA_I, "GRanges") IRanges_JKA_I<-as(GIRanges_JKA_I, "RangedData") #Peak Calling with BayesPeak raw.output <- bayespeak(treatment=IRanges_JKA, control=IRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) error message Error in `[.default`(space(bed), sel) : invalid subscript type 'S4' any idea? thanks On Wed, Jul 20, 2011 at 3:38 PM, Jonathan Cairns <jonathan.cairns at="" cancer.org.uk<mailto:jonathan.cairns="" at="" cancer.org.uk="">> wrote: Hi Andreia, On the line "IRanges_JKA<-ranges(Granges_JKA)", you are converting a genomicRanges object to an IRanges object. BayesPeak accepts a RangedData object, as opposed to an IRanges object (in order to retain chromosome information). Replace IRanges_JKA<-ranges(Granges_JKA) with IRanges_JKA<-as(Granges_JKA, "RangedData") and it should run properly. Hope this helps, Jonathan P.S. additionally, the line Library(BayesPeak) should be library(BayesPeak) - you obviously know this, else you wouldn't be getting the correct sessionInfo(), but I point this out in case anybody else tries to run the code... ________________________________________ From: Andreia Fonseca [andreia.fonseca@gmail.com<mailto:andreia.fonseca@gmail.com>] Sent: 20 July 2011 15:24 To: Jonathan Cairns; bioconductor Subject: error in bayespeak function Dear all, I am analyzing chipseq data and I am trying to use bayespeak package for peak detection. The code that I am using is #call libraries library(GenomicRanges) Library(BayesPeak) library(ShortRead) library(chipseq) library(ChIPpeakAnno) library(multicore) library(GenomicFeatures) #read sample JKA JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_unique _forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2_s eq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA<-readBamGappedAlignments(JKA) IRanges_JKA<-ranges(Granges_JKA) #read Input JKA JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2 _seq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA_I<-readBamGappedAlignments(JKA_I) IRanges_JKA_I<-ranges(Granges_JKA_I) #Peak Calling with BayesPeak raw.output <- bayespeak(treatment=JKA, control=JKA_I,use.multicore = TRUE, mc.cores = 4) after the last command I am getting the forllowing error: Error in substring(temp[1], 1, 5) : invalid multibyte string at '<ed>' I also tried to remove the use of parallelization but the error remains the same, can someone tell me what I am doing wrong ? thanks for the help, Andreia bellow is the information concerning sessionInfo sessionInfo() R version 2.13.1 (2011-07-08) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] BayesPeak_1.4.0 GenomicFeatures_1.4.3 [3] multicore_0.1-5 ChIPpeakAnno_1.8.0 [5] limma_3.8.2 org.Hs.eg.db_2.5.0 [7] GO.db_2.4.1 RSQLite_0.9-1 [9] DBI_0.2-5 AnnotationDbi_1.14.1 [11] BSgenome.Ecoli.NCBI.20080805_1.3.17 multtest_2.8.0 [13] Biobase_2.12.2 biomaRt_2.8.1 [15] chipseq_1.2.0 BSgenome_1.20.0 [17] ShortRead_1.10.4 Rsamtools_1.4.2 [19] lattice_0.19-30 Biostrings_2.20.1 [21] GenomicRanges_1.4.6 IRanges_1.10.4 loaded via a namespace (and not attached): [1] grid_2.13.1 hwriter_1.2 MASS_7.3-13 RCurl_1.4-2 [5] rtracklayer_1.12.4 splines_2.13.1 survival_2.36-9 tools_2.13.1 [9] XML_3.1-0 -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral at fm.ul.pt<mailto:email%3aandreiaamaral at="" fm.ul.pt=""><mailto:email%3aandreiaamaral at="" fm.ul.pt<mailto:email%253aandreiaamaral="" at="" fm.ul.pt="">> ; andreiaamaral at fc.ul.pt<mailto:andreiaamaral at="" fc.ul.pt=""><mailto:andreiaamaral at="" fc.ul.pt<mailto:andreiaamaral="" at="" fc.ul.pt="">> NOTICE AND DISCLAIMER This e-mail (including any attachments) is intended for the above- named person(s). If you are not the intended recipient, notify the sender immediately, delete this email from your system and do not disclose or use for any purpose. We may monitor all incoming and outgoing emails in line with current legislation. We have taken steps to ensure that this email and attachments are free from any virus, but it remains your responsibility to ensure that viruses do not adversely affect you. Cancer Research UK Registered in England and Wales Company Registered Number: 4325234. Registered Charity Number: 1089464 and Scotland SC041666 Registered Office Address: Angel Building, 407 St John Street, London EC1V 4AD. -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral at fm.ul.pt<mailto:email%3aandreiaamaral at="" fm.ul.pt=""> ; andreiaamaral at fc.ul.pt<mailto:andreiaamaral at="" fc.ul.pt=""> -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral at fm.ul.pt<mailto:email%3aandreiaamaral at="" fm.ul.pt=""> ; andreiaamaral at fc.ul.pt<mailto:andreiaamaral at="" fc.ul.pt=""> NOTICE AND DISCLAIMER This e-mail (including any attachments) is intended for the above- named person(s). If you are not the intended recipient, notify the sender immediately, delete this email from your system and do not disclose or use for any purpose. We may monitor all incoming and outgoing emails in line with current legislation. We have taken steps to ensure that this email and attachments are free from any virus, but it remains your responsibility to ensure that viruses do not adversely affect you. Cancer Research UK Registered in England and Wales Company Registered Number: 4325234. Registered Charity Number: 1089464 and Scotland SC041666 Registered Office Address: Angel Building, 407 St John Street, London EC1V 4AD.
ADD REPLY
0
Entering edit mode
Hi Jonathan, after doing str(space(GIRanges_JKA)) and str(space(GIRanges_JKA_I)) it results in the following error: Error in function (classes, fdef, mtable) : unable to find an inherited method for function "space", for signature "GRanges" I have attached rtracklayer as you suggested and run the code again and now the error meassage has changed, it seems is not being able to find the strand information raw.output <- bayespeak(treatment=GIRanges_JKA, control=GIRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) Error in bed$strand : $ operator not defined for this S4 class one other thing that I did was to use the example data that you provide sig <- read.table("H3K4me3-chr16.bed", skip=1, colClasses=c("character", "numeric")[c(1,2,2,1,1,1,1,1,1)]) bgr <- read.table("Input-chr16.bed", colClasses=c("character", "numeric")[c(1,2,2,1,1,1,1,1,1)]) sig <- RangedData(space=sig[,1], IRanges(start=sig[,2], end=sig[,3]), strand=sig[,6]) bgr <- RangedData(space=bgr[,1], IRanges(start=bgr[,2], end=bgr[,3]), strand=bgr[,6])> bgr <- read.table("Input-chr16.bed", colClasses=c("character", "numeric") and then I do not get an error when running bayespeak... On Wed, Jul 20, 2011 at 5:49 PM, Jonathan Cairns < Jonathan.Cairns@cancer.org.uk> wrote: > Andreia, > > That's very strange. What happens when you do: > > str(space(GIRanges_JKA)) > str(space(GIRanges_JKA_I)) > > Do either of these result in an error? > > You could try attaching the package rtracklayer at the start; I find that > this sometimes fixes odd IRanges behaviour. > > Jonathan > ________________________________________ > From: Andreia Fonseca [andreia.fonseca@gmail.com] > Sent: 20 July 2011 17:11 > To: Jonathan Cairns > Cc: bioconductor > Subject: Re: error in bayespeak function > > Dear Jonathan, > > Maybe it helps to see that my both sample and input information are now > effectively RangedData objects > > IRanges_JKA > RangedData with 3850192 rows and 1 value column across 25 spaces > space ranges | strand > <factor> <iranges> | <rle> > 1 chr1 [10071, 10120] | + > 2 chr1 [10074, 10123] | + > 3 chr1 [10075, 10124] | + > 4 chr1 [10075, 10124] | - > 5 chr1 [10106, 10155] | - > 6 chr1 [10147, 10196] | - > 7 chr1 [10148, 10197] | + > 8 chr1 [10149, 10198] | + > 9 chr1 [10150, 10199] | + > ... ... ... ... ... > 3850184 chrM [16491, 16540] | - > 3850185 chrM [16496, 16545] | - > 3850186 chrM [16499, 16548] | + > 3850187 chrM [16502, 16551] | + > 3850188 chrM [16506, 16555] | - > 3850189 chrM [16507, 16556] | + > 3850190 chrM [16515, 16564] | - > 3850191 chrM [16516, 16565] | - > 3850192 chrM [16521, 16570] | + > > IRanges_JKA_I > RangedData with 6443227 rows and 1 value column across 25 spaces > space ranges | strand > <factor> <iranges> | <rle> > 1 chr1 [10073, 10122] | - > 2 chr1 [10165, 10214] | + > 3 chr1 [10445, 10494] | + > 4 chr1 [13064, 13113] | + > 5 chr1 [16060, 16109] | + > 6 chr1 [16416, 16465] | - > 7 chr1 [20103, 20152] | + > 8 chr1 [20103, 20152] | + > 9 chr1 [51428, 51477] | - > ... ... ... ... ... > 6443219 chrM [16509, 16558] | + > 6443220 chrM [16511, 16560] | - > 6443221 chrM [16512, 16561] | + > 6443222 chrM [16513, 16562] | - > 6443223 chrM [16516, 16565] | + > 6443224 chrM [16516, 16565] | - > 6443225 chrM [16517, 16566] | + > 6443226 chrM [16518, 16567] | - > 6443227 chrM [16520, 16569] | - > > > On Wed, Jul 20, 2011 at 4:00 PM, Andreia Fonseca < > andreia.fonseca@gmail.com<mailto:andreia.fonseca@gmail.com>> wrote: > Hi Jonathan, > > thanks for the help, I have another error now! I have changed the code as > you suggested and I also spotted that in bayespeak I was calling the bam > object instead of the IRanges object, still the IRanges object is not proper > as you mentioned. I manage to create a RangeData object but : > > > #call libraries > library(GenomicRanges) > library(BayesPeak) > library(ShortRead) > library(chipseq) > library(ChIPpeakAnno) > library(multicore) > library(GenomicFeatures) > > #read sample JKA > JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", > overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_f iltered.txt_unique_forfastq.fastq_SAM_BAM") > Granges_JKA<-readBamGappedAlignments(JKA) > GIRanges_JKA<-as(Granges_JKA, "GRanges") > IRanges_JKA<-as(GIRanges_JKA, "RangedData") > > > #read Input JKA > JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_un ique_forfastq.fastq_SAM", > overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_f iltered.txt_unique_forfastq.fastq_SAM_BAM") > Granges_JKA_I<-readBamGappedAlignments(JKA_I) > GIRanges_JKA_I<-as(Granges_JKA_I, "GRanges") > IRanges_JKA_I<-as(GIRanges_JKA_I, "RangedData") > > > #Peak Calling with BayesPeak > raw.output <- bayespeak(treatment=IRanges_JKA, > control=IRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) > > error message > > Error in `[.default`(space(bed), sel) : invalid subscript type 'S4' > > any idea? > thanks > > > > > On Wed, Jul 20, 2011 at 3:38 PM, Jonathan Cairns < > Jonathan.Cairns@cancer.org.uk<mailto:jonathan.cairns@cancer.org.uk>> > wrote: > Hi Andreia, > > On the line "IRanges_JKA<-ranges(Granges_JKA)", you are converting a > genomicRanges object to an IRanges object. BayesPeak accepts a RangedData > object, as opposed to an IRanges object (in order to retain chromosome > information). Replace > > IRanges_JKA<-ranges(Granges_JKA) > > with > > IRanges_JKA<-as(Granges_JKA, "RangedData") > > and it should run properly. > > Hope this helps, > > Jonathan > > > P.S. additionally, the line Library(BayesPeak) should be library(BayesPeak) > - you obviously know this, else you wouldn't be getting the correct > sessionInfo(), but I point this out in case anybody else tries to run the > code... > > ________________________________________ > From: Andreia Fonseca [andreia.fonseca@gmail.com<mailto:> andreia.fonseca@gmail.com>] > Sent: 20 July 2011 15:24 > To: Jonathan Cairns; bioconductor > Subject: error in bayespeak function > > Dear all, > > I am analyzing chipseq data and I am trying to use bayespeak package for > peak detection. > The code that I am using is > > #call libraries > library(GenomicRanges) > Library(BayesPeak) > library(ShortRead) > library(chipseq) > library(ChIPpeakAnno) > library(multicore) > library(GenomicFeatures) > > #read sample JKA > JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", > overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_f iltered.txt_unique_forfastq.fastq_SAM_BAM") > Granges_JKA<-readBamGappedAlignments(JKA) > IRanges_JKA<-ranges(Granges_JKA) > > #read Input JKA > JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_un ique_forfastq.fastq_SAM", > overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_f iltered.txt_unique_forfastq.fastq_SAM_BAM") > Granges_JKA_I<-readBamGappedAlignments(JKA_I) > IRanges_JKA_I<-ranges(Granges_JKA_I) > > #Peak Calling with BayesPeak > raw.output <- bayespeak(treatment=JKA, control=JKA_I,use.multicore = TRUE, > mc.cores = 4) > > after the last command I am getting the forllowing error: > Error in substring(temp[1], 1, 5) : invalid multibyte string at '<ed>' > > I also tried to remove the use of parallelization but the error remains the > same, can someone tell me what I am doing wrong ? > thanks for the help, > Andreia > > bellow is the information concerning sessionInfo > > sessionInfo() > R version 2.13.1 (2011-07-08) > Platform: x86_64-unknown-linux-gnu (64-bit) > > locale: > [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C > [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 > [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 > [7] LC_PAPER=en_US.UTF-8 LC_NAME=C > [9] LC_ADDRESS=C LC_TELEPHONE=C > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] BayesPeak_1.4.0 GenomicFeatures_1.4.3 > [3] multicore_0.1-5 ChIPpeakAnno_1.8.0 > [5] limma_3.8.2 org.Hs.eg.db_2.5.0 > [7] GO.db_2.4.1 RSQLite_0.9-1 > [9] DBI_0.2-5 AnnotationDbi_1.14.1 > [11] BSgenome.Ecoli.NCBI.20080805_1.3.17 multtest_2.8.0 > [13] Biobase_2.12.2 biomaRt_2.8.1 > [15] chipseq_1.2.0 BSgenome_1.20.0 > [17] ShortRead_1.10.4 Rsamtools_1.4.2 > [19] lattice_0.19-30 Biostrings_2.20.1 > [21] GenomicRanges_1.4.6 IRanges_1.10.4 > > loaded via a namespace (and not attached): > [1] grid_2.13.1 hwriter_1.2 MASS_7.3-13 RCurl_1.4-2 > [5] rtracklayer_1.12.4 splines_2.13.1 survival_2.36-9 tools_2.13.1 > [9] XML_3.1-0 > > > -- > > -------------------------------------------------------------------- ------------------------- > Andreia J. Amaral, PhD > BioFIG - Center for Biodiversity, Functional and Integrative Genomics > Instituto de Medicina Molecular > University of Lisbon > Tel: +352 217500000 (ext. office: 28253) > email:andreiaamaral@fm.ul.pt<mailto:email%3aandreiaamaral@fm.ul.pt> ><mailto:email%3aandreiaamaral@fm.ul.pt<mailto:> email%253Aandreiaamaral@fm.ul.pt>> ; andreiaamaral@fc.ul.pt<mailto:> andreiaamaral@fc.ul.pt><mailto:andreiaamaral@fc.ul.pt<mailto:> andreiaamaral@fc.ul.pt>> > > > NOTICE AND DISCLAIMER > This e-mail (including any attachments) is intended for the above- named > person(s). If you are not the intended recipient, notify the sender > immediately, delete this email from your system and do not disclose or use > for any purpose. > > We may monitor all incoming and outgoing emails in line with current > legislation. We have taken steps to ensure that this email and attachments > are free from any virus, but it remains your responsibility to ensure that > viruses do not adversely affect you. > Cancer Research UK > Registered in England and Wales > Company Registered Number: 4325234. > Registered Charity Number: 1089464 and Scotland SC041666 > Registered Office Address: Angel Building, 407 St John Street, London EC1V > 4AD. > > > > -- > > -------------------------------------------------------------------- ------------------------- > Andreia J. Amaral, PhD > BioFIG - Center for Biodiversity, Functional and Integrative Genomics > Instituto de Medicina Molecular > University of Lisbon > Tel: +352 217500000 (ext. office: 28253) > email:andreiaamaral@fm.ul.pt<mailto:email%3aandreiaamaral@fm.ul.pt> ; > andreiaamaral@fc.ul.pt<mailto:andreiaamaral@fc.ul.pt> > > > > > -- > > -------------------------------------------------------------------- ------------------------- > Andreia J. Amaral, PhD > BioFIG - Center for Biodiversity, Functional and Integrative Genomics > Instituto de Medicina Molecular > University of Lisbon > Tel: +352 217500000 (ext. office: 28253) > email:andreiaamaral@fm.ul.pt<mailto:email%3aandreiaamaral@fm.ul.pt> ; > andreiaamaral@fc.ul.pt<mailto:andreiaamaral@fc.ul.pt> > > > NOTICE AND DISCLAIMER > This e-mail (including any attachments) is intended for the above- named > person(s). If you are not the intended recipient, notify the sender > immediately, delete this email from your system and do not disclose or use > for any purpose. > > We may monitor all incoming and outgoing emails in line with current > legislation. We have taken steps to ensure that this email and attachments > are free from any virus, but it remains your responsibility to ensure that > viruses do not adversely affect you. > Cancer Research UK > Registered in England and Wales > Company Registered Number: 4325234. > Registered Charity Number: 1089464 and Scotland SC041666 > Registered Office Address: Angel Building, 407 St John Street, London EC1V > 4AD. > -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral@fm.ul.pt ; andreiaamaral@fc.ul.pt [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
sorry, please disregard my last email. The RangedData is the object IRanges_JKA_I and IRanges_JKA, the error remains the same, it does not cahnge after attaching rtracklayer raw.output <- bayespeak(treatment=IRanges_JKA, control=IRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) Error in `[.default`(space(bed), sel) : invalid subscript type 'S4' after making str(space(IRanges_JKA_I)) Factor w/ 25 levels "chr1","chr2",..: 1 1 1 1 1 1 1 1 1 1 ... str(space(IRanges_JKA)) Factor w/ 25 levels "chr1","chr2",..: 1 1 1 1 1 1 1 1 1 1 ... On Wed, Jul 20, 2011 at 6:06 PM, Andreia Fonseca <andreia.fonseca@gmail.com>wrote: > Hi Jonathan, > > after doing str(space(GIRanges_JKA)) and str(space(GIRanges_JKA_I)) > it results in the following error: > > Error in function (classes, fdef, mtable) : > unable to find an inherited method for function "space", for signature > "GRanges" > > I have attached rtracklayer as you suggested and run the code again and now > the error meassage has changed, it seems is not being able to find the > strand information > > raw.output <- bayespeak(treatment=GIRanges_JKA, > control=GIRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) > Error in bed$strand : $ operator not defined for this S4 class > > one other thing that I did was to use the example data that you provide > sig <- read.table("H3K4me3-chr16.bed", skip=1, colClasses=c("character", > "numeric")[c(1,2,2,1,1,1,1,1,1)]) > bgr <- read.table("Input-chr16.bed", colClasses=c("character", > "numeric")[c(1,2,2,1,1,1,1,1,1)]) > sig <- RangedData(space=sig[,1], IRanges(start=sig[,2], end=sig[,3]), > strand=sig[,6]) > bgr <- RangedData(space=bgr[,1], IRanges(start=bgr[,2], end=bgr[,3]), > strand=bgr[,6])> bgr <- read.table("Input-chr16.bed", > colClasses=c("character", "numeric") > > and then I do not get an error when running bayespeak... > > > > On Wed, Jul 20, 2011 at 5:49 PM, Jonathan Cairns < > Jonathan.Cairns@cancer.org.uk> wrote: > >> Andreia, >> >> That's very strange. What happens when you do: >> >> str(space(GIRanges_JKA)) >> str(space(GIRanges_JKA_I)) >> >> Do either of these result in an error? >> >> You could try attaching the package rtracklayer at the start; I find that >> this sometimes fixes odd IRanges behaviour. >> >> Jonathan >> ________________________________________ >> From: Andreia Fonseca [andreia.fonseca@gmail.com] >> Sent: 20 July 2011 17:11 >> To: Jonathan Cairns >> Cc: bioconductor >> Subject: Re: error in bayespeak function >> >> Dear Jonathan, >> >> Maybe it helps to see that my both sample and input information are now >> effectively RangedData objects >> >> IRanges_JKA >> RangedData with 3850192 rows and 1 value column across 25 spaces >> space ranges | strand >> <factor> <iranges> | <rle> >> 1 chr1 [10071, 10120] | + >> 2 chr1 [10074, 10123] | + >> 3 chr1 [10075, 10124] | + >> 4 chr1 [10075, 10124] | - >> 5 chr1 [10106, 10155] | - >> 6 chr1 [10147, 10196] | - >> 7 chr1 [10148, 10197] | + >> 8 chr1 [10149, 10198] | + >> 9 chr1 [10150, 10199] | + >> ... ... ... ... ... >> 3850184 chrM [16491, 16540] | - >> 3850185 chrM [16496, 16545] | - >> 3850186 chrM [16499, 16548] | + >> 3850187 chrM [16502, 16551] | + >> 3850188 chrM [16506, 16555] | - >> 3850189 chrM [16507, 16556] | + >> 3850190 chrM [16515, 16564] | - >> 3850191 chrM [16516, 16565] | - >> 3850192 chrM [16521, 16570] | + >> >> IRanges_JKA_I >> RangedData with 6443227 rows and 1 value column across 25 spaces >> space ranges | strand >> <factor> <iranges> | <rle> >> 1 chr1 [10073, 10122] | - >> 2 chr1 [10165, 10214] | + >> 3 chr1 [10445, 10494] | + >> 4 chr1 [13064, 13113] | + >> 5 chr1 [16060, 16109] | + >> 6 chr1 [16416, 16465] | - >> 7 chr1 [20103, 20152] | + >> 8 chr1 [20103, 20152] | + >> 9 chr1 [51428, 51477] | - >> ... ... ... ... ... >> 6443219 chrM [16509, 16558] | + >> 6443220 chrM [16511, 16560] | - >> 6443221 chrM [16512, 16561] | + >> 6443222 chrM [16513, 16562] | - >> 6443223 chrM [16516, 16565] | + >> 6443224 chrM [16516, 16565] | - >> 6443225 chrM [16517, 16566] | + >> 6443226 chrM [16518, 16567] | - >> 6443227 chrM [16520, 16569] | - >> >> >> On Wed, Jul 20, 2011 at 4:00 PM, Andreia Fonseca < >> andreia.fonseca@gmail.com<mailto:andreia.fonseca@gmail.com>> wrote: >> Hi Jonathan, >> >> thanks for the help, I have another error now! I have changed the code as >> you suggested and I also spotted that in bayespeak I was calling the bam >> object instead of the IRanges object, still the IRanges object is not proper >> as you mentioned. I manage to create a RangeData object but : >> >> >> #call libraries >> library(GenomicRanges) >> library(BayesPeak) >> library(ShortRead) >> library(chipseq) >> library(ChIPpeakAnno) >> library(multicore) >> library(GenomicFeatures) >> >> #read sample JKA >> JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_uni que_forfastq.fastq_SAM", >> overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_ filtered.txt_unique_forfastq.fastq_SAM_BAM") >> Granges_JKA<-readBamGappedAlignments(JKA) >> GIRanges_JKA<-as(Granges_JKA, "GRanges") >> IRanges_JKA<-as(GIRanges_JKA, "RangedData") >> >> >> #read Input JKA >> JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_u nique_forfastq.fastq_SAM", >> overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_ filtered.txt_unique_forfastq.fastq_SAM_BAM") >> Granges_JKA_I<-readBamGappedAlignments(JKA_I) >> GIRanges_JKA_I<-as(Granges_JKA_I, "GRanges") >> IRanges_JKA_I<-as(GIRanges_JKA_I, "RangedData") >> >> >> #Peak Calling with BayesPeak >> raw.output <- bayespeak(treatment=IRanges_JKA, >> control=IRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) >> >> error message >> >> Error in `[.default`(space(bed), sel) : invalid subscript type 'S4' >> >> any idea? >> thanks >> >> >> >> >> On Wed, Jul 20, 2011 at 3:38 PM, Jonathan Cairns < >> Jonathan.Cairns@cancer.org.uk<mailto:jonathan.cairns@cancer.org.uk>> >> wrote: >> Hi Andreia, >> >> On the line "IRanges_JKA<-ranges(Granges_JKA)", you are converting a >> genomicRanges object to an IRanges object. BayesPeak accepts a RangedData >> object, as opposed to an IRanges object (in order to retain chromosome >> information). Replace >> >> IRanges_JKA<-ranges(Granges_JKA) >> >> with >> >> IRanges_JKA<-as(Granges_JKA, "RangedData") >> >> and it should run properly. >> >> Hope this helps, >> >> Jonathan >> >> >> P.S. additionally, the line Library(BayesPeak) should be >> library(BayesPeak) - you obviously know this, else you wouldn't be getting >> the correct sessionInfo(), but I point this out in case anybody else tries >> to run the code... >> >> ________________________________________ >> From: Andreia Fonseca [andreia.fonseca@gmail.com<mailto:>> andreia.fonseca@gmail.com>] >> Sent: 20 July 2011 15:24 >> To: Jonathan Cairns; bioconductor >> Subject: error in bayespeak function >> >> Dear all, >> >> I am analyzing chipseq data and I am trying to use bayespeak package for >> peak detection. >> The code that I am using is >> >> #call libraries >> library(GenomicRanges) >> Library(BayesPeak) >> library(ShortRead) >> library(chipseq) >> library(ChIPpeakAnno) >> library(multicore) >> library(GenomicFeatures) >> >> #read sample JKA >> JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_uni que_forfastq.fastq_SAM", >> overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_ filtered.txt_unique_forfastq.fastq_SAM_BAM") >> Granges_JKA<-readBamGappedAlignments(JKA) >> IRanges_JKA<-ranges(Granges_JKA) >> >> #read Input JKA >> JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_u nique_forfastq.fastq_SAM", >> overwrite=TRUE,destination="110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_ filtered.txt_unique_forfastq.fastq_SAM_BAM") >> Granges_JKA_I<-readBamGappedAlignments(JKA_I) >> IRanges_JKA_I<-ranges(Granges_JKA_I) >> >> #Peak Calling with BayesPeak >> raw.output <- bayespeak(treatment=JKA, control=JKA_I,use.multicore = TRUE, >> mc.cores = 4) >> >> after the last command I am getting the forllowing error: >> Error in substring(temp[1], 1, 5) : invalid multibyte string at '<ed>' >> >> I also tried to remove the use of parallelization but the error remains >> the same, can someone tell me what I am doing wrong ? >> thanks for the help, >> Andreia >> >> bellow is the information concerning sessionInfo >> >> sessionInfo() >> R version 2.13.1 (2011-07-08) >> Platform: x86_64-unknown-linux-gnu (64-bit) >> >> locale: >> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C >> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 >> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 >> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C >> [9] LC_ADDRESS=C LC_TELEPHONE=C >> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods base >> >> other attached packages: >> [1] BayesPeak_1.4.0 GenomicFeatures_1.4.3 >> [3] multicore_0.1-5 ChIPpeakAnno_1.8.0 >> [5] limma_3.8.2 org.Hs.eg.db_2.5.0 >> [7] GO.db_2.4.1 RSQLite_0.9-1 >> [9] DBI_0.2-5 AnnotationDbi_1.14.1 >> [11] BSgenome.Ecoli.NCBI.20080805_1.3.17 multtest_2.8.0 >> [13] Biobase_2.12.2 biomaRt_2.8.1 >> [15] chipseq_1.2.0 BSgenome_1.20.0 >> [17] ShortRead_1.10.4 Rsamtools_1.4.2 >> [19] lattice_0.19-30 Biostrings_2.20.1 >> [21] GenomicRanges_1.4.6 IRanges_1.10.4 >> >> loaded via a namespace (and not attached): >> [1] grid_2.13.1 hwriter_1.2 MASS_7.3-13 RCurl_1.4-2 >> [5] rtracklayer_1.12.4 splines_2.13.1 survival_2.36-9 tools_2.13.1 >> [9] XML_3.1-0 >> >> >> -- >> >> ------------------------------------------------------------------- -------------------------- >> Andreia J. Amaral, PhD >> BioFIG - Center for Biodiversity, Functional and Integrative Genomics >> Instituto de Medicina Molecular >> University of Lisbon >> Tel: +352 217500000 (ext. office: 28253) >> email:andreiaamaral@fm.ul.pt<mailto:email%3aandreiaamaral@fm.ul.pt>> ><mailto:email%3aandreiaamaral@fm.ul.pt<mailto:>> email%253Aandreiaamaral@fm.ul.pt>> ; andreiaamaral@fc.ul.pt<mailto:>> andreiaamaral@fc.ul.pt><mailto:andreiaamaral@fc.ul.pt<mailto:>> andreiaamaral@fc.ul.pt>> >> >> >> NOTICE AND DISCLAIMER >> This e-mail (including any attachments) is intended for the above- named >> person(s). If you are not the intended recipient, notify the sender >> immediately, delete this email from your system and do not disclose or use >> for any purpose. >> >> We may monitor all incoming and outgoing emails in line with current >> legislation. We have taken steps to ensure that this email and attachments >> are free from any virus, but it remains your responsibility to ensure that >> viruses do not adversely affect you. >> Cancer Research UK >> Registered in England and Wales >> Company Registered Number: 4325234. >> Registered Charity Number: 1089464 and Scotland SC041666 >> Registered Office Address: Angel Building, 407 St John Street, London EC1V >> 4AD. >> >> >> >> -- >> >> ------------------------------------------------------------------- -------------------------- >> Andreia J. Amaral, PhD >> BioFIG - Center for Biodiversity, Functional and Integrative Genomics >> Instituto de Medicina Molecular >> University of Lisbon >> Tel: +352 217500000 (ext. office: 28253) >> email:andreiaamaral@fm.ul.pt<mailto:email%3aandreiaamaral@fm.ul.pt> ; >> andreiaamaral@fc.ul.pt<mailto:andreiaamaral@fc.ul.pt> >> >> >> >> >> -- >> >> ------------------------------------------------------------------- -------------------------- >> Andreia J. Amaral, PhD >> BioFIG - Center for Biodiversity, Functional and Integrative Genomics >> Instituto de Medicina Molecular >> University of Lisbon >> Tel: +352 217500000 (ext. office: 28253) >> email:andreiaamaral@fm.ul.pt<mailto:email%3aandreiaamaral@fm.ul.pt> ; >> andreiaamaral@fc.ul.pt<mailto:andreiaamaral@fc.ul.pt> >> >> >> NOTICE AND DISCLAIMER >> This e-mail (including any attachments) is intended for the above- named >> person(s). If you are not the intended recipient, notify the sender >> immediately, delete this email from your system and do not disclose or use >> for any purpose. >> >> We may monitor all incoming and outgoing emails in line with current >> legislation. We have taken steps to ensure that this email and attachments >> are free from any virus, but it remains your responsibility to ensure that >> viruses do not adversely affect you. >> Cancer Research UK >> Registered in England and Wales >> Company Registered Number: 4325234. >> Registered Charity Number: 1089464 and Scotland SC041666 >> Registered Office Address: Angel Building, 407 St John Street, London EC1V >> 4AD. >> > > > > -- > > -------------------------------------------------------------------- ------------------------- > Andreia J. Amaral, PhD > BioFIG - Center for Biodiversity, Functional and Integrative Genomics > Instituto de Medicina Molecular > University of Lisbon > Tel: +352 217500000 (ext. office: 28253) > email:andreiaamaral@fm.ul.pt ; andreiaamaral@fc.ul.pt > > -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral@fm.ul.pt ; andreiaamaral@fc.ul.pt [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Hi Andreia, OK - I was able to reproduce this error with a toy example. I have a fix for it, which I have committed it to the repository, and so it should be fine in BayesPeak 1.4.1 and onwards. Let me know if this solves the problem for you! --- For the record, the problem is to do what I feel is a slightly counter-intuitive behaviour of IRanges: In the subroutine strand.split(), IRanges_JKA undergoes what is effectively: bed <- IRanges_JKA sel <- bed$strand == "+" start(bed)[sel] ##error When IRanges_JKA is constructed as in the code below, bed$strand comes out as an Rle object instead of a factor. Therefore, sel is also an Rle object, and it appears that you cannot subset with an Rle logical object. I got round it by coercing it to a factor. At first I wondered if this problem could be fixed by using a more canonical accessor function: bed <- IRanges_JKA sel <- strand(bed) == "+" start(bed)[sel] ##no error Whereas bed$strand is an Rle object, strand(bed) is a normal factor, and things can proceed. Unfortunately, when bed$strand is not an Rle object, as in the package examples, attempting to use this accessor function now returns a "function does not exist" error, which is why I went with the coercion approach. Is this behaviour intentional? Thanks, Jonathan ________________________________________ From: Andreia Fonseca [andreia.fonseca@gmail.com] Sent: 20 July 2011 18:12 To: Jonathan Cairns Cc: bioconductor Subject: Re: error in bayespeak function sorry, please disregard my last email. The RangedData is the object IRanges_JKA_I and IRanges_JKA, the error remains the same, it does not cahnge after attaching rtracklayer raw.output <- bayespeak(treatment=IRanges_JKA, control=IRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) Error in `[.default`(space(bed), sel) : invalid subscript type 'S4' after making str(space(IRanges_JKA_I)) Factor w/ 25 levels "chr1","chr2",..: 1 1 1 1 1 1 1 1 1 1 ... str(space(IRanges_JKA)) Factor w/ 25 levels "chr1","chr2",..: 1 1 1 1 1 1 1 1 1 1 ... On Wed, Jul 20, 2011 at 6:06 PM, Andreia Fonseca <andreia.fonseca at="" gmail.com<mailto:andreia.fonseca="" at="" gmail.com="">> wrote: Hi Jonathan, after doing str(space(GIRanges_JKA)) and str(space(GIRanges_JKA_I)) it results in the following error: Error in function (classes, fdef, mtable) : unable to find an inherited method for function "space", for signature "GRanges" I have attached rtracklayer as you suggested and run the code again and now the error meassage has changed, it seems is not being able to find the strand information raw.output <- bayespeak(treatment=GIRanges_JKA, control=GIRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) Error in bed$strand : $ operator not defined for this S4 class one other thing that I did was to use the example data that you provide sig <- read.table("H3K4me3-chr16.bed", skip=1, colClasses=c("character", "numeric")[c(1,2,2,1,1,1,1,1,1)]) bgr <- read.table("Input-chr16.bed", colClasses=c("character", "numeric")[c(1,2,2,1,1,1,1,1,1)]) sig <- RangedData(space=sig[,1], IRanges(start=sig[,2], end=sig[,3]), strand=sig[,6]) bgr <- RangedData(space=bgr[,1], IRanges(start=bgr[,2], end=bgr[,3]), strand=bgr[,6])> bgr <- read.table("Input-chr16.bed", colClasses=c("character", "numeric") and then I do not get an error when running bayespeak... On Wed, Jul 20, 2011 at 5:49 PM, Jonathan Cairns <jonathan.cairns at="" cancer.org.uk<mailto:jonathan.cairns="" at="" cancer.org.uk="">> wrote: Andreia, That's very strange. What happens when you do: str(space(GIRanges_JKA)) str(space(GIRanges_JKA_I)) Do either of these result in an error? You could try attaching the package rtracklayer at the start; I find that this sometimes fixes odd IRanges behaviour. Jonathan ________________________________________ From: Andreia Fonseca [andreia.fonseca@gmail.com<mailto:andreia.fonseca@gmail.com>] Sent: 20 July 2011 17:11 To: Jonathan Cairns Cc: bioconductor Subject: Re: error in bayespeak function Dear Jonathan, Maybe it helps to see that my both sample and input information are now effectively RangedData objects IRanges_JKA RangedData with 3850192 rows and 1 value column across 25 spaces space ranges | strand <factor> <iranges> | <rle> 1 chr1 [10071, 10120] | + 2 chr1 [10074, 10123] | + 3 chr1 [10075, 10124] | + 4 chr1 [10075, 10124] | - 5 chr1 [10106, 10155] | - 6 chr1 [10147, 10196] | - 7 chr1 [10148, 10197] | + 8 chr1 [10149, 10198] | + 9 chr1 [10150, 10199] | + ... ... ... ... ... 3850184 chrM [16491, 16540] | - 3850185 chrM [16496, 16545] | - 3850186 chrM [16499, 16548] | + 3850187 chrM [16502, 16551] | + 3850188 chrM [16506, 16555] | - 3850189 chrM [16507, 16556] | + 3850190 chrM [16515, 16564] | - 3850191 chrM [16516, 16565] | - 3850192 chrM [16521, 16570] | + IRanges_JKA_I RangedData with 6443227 rows and 1 value column across 25 spaces space ranges | strand <factor> <iranges> | <rle> 1 chr1 [10073, 10122] | - 2 chr1 [10165, 10214] | + 3 chr1 [10445, 10494] | + 4 chr1 [13064, 13113] | + 5 chr1 [16060, 16109] | + 6 chr1 [16416, 16465] | - 7 chr1 [20103, 20152] | + 8 chr1 [20103, 20152] | + 9 chr1 [51428, 51477] | - ... ... ... ... ... 6443219 chrM [16509, 16558] | + 6443220 chrM [16511, 16560] | - 6443221 chrM [16512, 16561] | + 6443222 chrM [16513, 16562] | - 6443223 chrM [16516, 16565] | + 6443224 chrM [16516, 16565] | - 6443225 chrM [16517, 16566] | + 6443226 chrM [16518, 16567] | - 6443227 chrM [16520, 16569] | - On Wed, Jul 20, 2011 at 4:00 PM, Andreia Fonseca <andreia.fonseca at="" gmail.com<mailto:andreia.fonseca="" at="" gmail.com=""><mailto:andreia.fonseca at="" gmail.com<mailto:andreia.fonseca="" at="" gmail.com="">>> wrote: Hi Jonathan, thanks for the help, I have another error now! I have changed the code as you suggested and I also spotted that in bayespeak I was calling the bam object instead of the IRanges object, still the IRanges object is not proper as you mentioned. I manage to create a RangeData object but : #call libraries library(GenomicRanges) library(BayesPeak) library(ShortRead) library(chipseq) library(ChIPpeakAnno) library(multicore) library(GenomicFeatures) #read sample JKA JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_unique _forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2_s eq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA<-readBamGappedAlignments(JKA) GIRanges_JKA<-as(Granges_JKA, "GRanges") IRanges_JKA<-as(GIRanges_JKA, "RangedData") #read Input JKA JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2 _seq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA_I<-readBamGappedAlignments(JKA_I) GIRanges_JKA_I<-as(Granges_JKA_I, "GRanges") IRanges_JKA_I<-as(GIRanges_JKA_I, "RangedData") #Peak Calling with BayesPeak raw.output <- bayespeak(treatment=IRanges_JKA, control=IRanges_JKA_I,use.multicore = TRUE, mc.cores = 4) error message Error in `[.default`(space(bed), sel) : invalid subscript type 'S4' any idea? thanks On Wed, Jul 20, 2011 at 3:38 PM, Jonathan Cairns <jonathan.cairns at="" cancer.org.uk<mailto:jonathan.cairns="" at="" cancer.org.uk=""><mailto:jonathan.cairns at="" cancer.org.uk<mailto:jonathan.cairns="" at="" cancer.org.uk="">>> wrote: Hi Andreia, On the line "IRanges_JKA<-ranges(Granges_JKA)", you are converting a genomicRanges object to an IRanges object. BayesPeak accepts a RangedData object, as opposed to an IRanges object (in order to retain chromosome information). Replace IRanges_JKA<-ranges(Granges_JKA) with IRanges_JKA<-as(Granges_JKA, "RangedData") and it should run properly. Hope this helps, Jonathan P.S. additionally, the line Library(BayesPeak) should be library(BayesPeak) - you obviously know this, else you wouldn't be getting the correct sessionInfo(), but I point this out in case anybody else tries to run the code... ________________________________________ From: Andreia Fonseca [andreia.fonseca@gmail.com<mailto:andreia.fonsec a@gmail.com=""><mailto:andreia.fonseca@gmail.com<mailto:andreia.fonseca@g mail.com="">>] Sent: 20 July 2011 15:24 To: Jonathan Cairns; bioconductor Subject: error in bayespeak function Dear all, I am analyzing chipseq data and I am trying to use bayespeak package for peak detection. The code that I am using is #call libraries library(GenomicRanges) Library(BayesPeak) library(ShortRead) library(chipseq) library(ChIPpeakAnno) library(multicore) library(GenomicFeatures) #read sample JKA JKA<-asBam("110402_SN365_B_s_2_seq_GQG-1.txt_TABLE_filtered.txt_unique _forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2_s eq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA<-readBamGappedAlignments(JKA) IRanges_JKA<-ranges(Granges_JKA) #read Input JKA JKA_I<-asBam("110402_SN365_B_s_2_seq_GQG-2.txt_TABLE_filtered.txt_uniq ue_forfastq.fastq_SAM", overwrite=TRUE,destination="110402_SN365_B_s_2 _seq_GQG-1.txt_TABLE_filtered.txt_unique_forfastq.fastq_SAM_BAM") Granges_JKA_I<-readBamGappedAlignments(JKA_I) IRanges_JKA_I<-ranges(Granges_JKA_I) #Peak Calling with BayesPeak raw.output <- bayespeak(treatment=JKA, control=JKA_I,use.multicore = TRUE, mc.cores = 4) after the last command I am getting the forllowing error: Error in substring(temp[1], 1, 5) : invalid multibyte string at '<ed>' I also tried to remove the use of parallelization but the error remains the same, can someone tell me what I am doing wrong ? thanks for the help, Andreia bellow is the information concerning sessionInfo sessionInfo() R version 2.13.1 (2011-07-08) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] BayesPeak_1.4.0 GenomicFeatures_1.4.3 [3] multicore_0.1-5 ChIPpeakAnno_1.8.0 [5] limma_3.8.2 org.Hs.eg.db_2.5.0 [7] GO.db_2.4.1 RSQLite_0.9-1 [9] DBI_0.2-5 AnnotationDbi_1.14.1 [11] BSgenome.Ecoli.NCBI.20080805_1.3.17 multtest_2.8.0 [13] Biobase_2.12.2 biomaRt_2.8.1 [15] chipseq_1.2.0 BSgenome_1.20.0 [17] ShortRead_1.10.4 Rsamtools_1.4.2 [19] lattice_0.19-30 Biostrings_2.20.1 [21] GenomicRanges_1.4.6 IRanges_1.10.4 loaded via a namespace (and not attached): [1] grid_2.13.1 hwriter_1.2 MASS_7.3-13 RCurl_1.4-2 [5] rtracklayer_1.12.4 splines_2.13.1 survival_2.36-9 tools_2.13.1 [9] XML_3.1-0 -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral at fm.ul.pt<mailto:email%3aandreiaamaral at="" fm.ul.pt=""><mailto:email%3aandreiaamaral at="" fm.ul.pt<mailto:email%253aandreiaamaral="" at="" fm.ul.pt="">><mailto:email%3aandreiaamaral at="" fm.ul.pt<mailto:email%253aandreiaamaral="" at="" fm.ul.pt=""><mailto:email%253aandreiaamaral at="" fm.ul.pt<mailto:email%25253aandreiaamaral="" at="" fm.ul.pt="">>> ; andreiaamaral at fc.ul.pt<mailto:andreiaamaral at="" fc.ul.pt=""><mailto:andreiaamaral at="" fc.ul.pt<mailto:andreiaamaral="" at="" fc.ul.pt="">><mailto:andreiaamaral at="" fc.ul.pt<mailto:andreiaamaral="" at="" fc.ul.pt=""><mailto:andreiaamaral at="" fc.ul.pt<mailto:andreiaamaral="" at="" fc.ul.pt="">>> NOTICE AND DISCLAIMER This e-mail (including any attachments) is intended for the above- named person(s). If you are not the intended recipient, notify the sender immediately, delete this email from your system and do not disclose or use for any purpose. We may monitor all incoming and outgoing emails in line with current legislation. We have taken steps to ensure that this email and attachments are free from any virus, but it remains your responsibility to ensure that viruses do not adversely affect you. Cancer Research UK Registered in England and Wales Company Registered Number: 4325234. Registered Charity Number: 1089464 and Scotland SC041666 Registered Office Address: Angel Building, 407 St John Street, London EC1V 4AD. -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral at fm.ul.pt<mailto:email%3aandreiaamaral at="" fm.ul.pt=""><mailto:email%3aandreiaamaral at="" fm.ul.pt<mailto:email%253aandreiaamaral="" at="" fm.ul.pt="">> ; andreiaamaral at fc.ul.pt<mailto:andreiaamaral at="" fc.ul.pt=""><mailto:andreiaamaral at="" fc.ul.pt<mailto:andreiaamaral="" at="" fc.ul.pt="">> -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral at fm.ul.pt<mailto:email%3aandreiaamaral at="" fm.ul.pt=""><mailto:email%3aandreiaamaral at="" fm.ul.pt<mailto:email%253aandreiaamaral="" at="" fm.ul.pt="">> ; andreiaamaral at fc.ul.pt<mailto:andreiaamaral at="" fc.ul.pt=""><mailto:andreiaamaral at="" fc.ul.pt<mailto:andreiaamaral="" at="" fc.ul.pt="">> NOTICE AND DISCLAIMER This e-mail (including any attachments) is intended for the above- named person(s). If you are not the intended recipient, notify the sender immediately, delete this email from your system and do not disclose or use for any purpose. We may monitor all incoming and outgoing emails in line with current legislation. We have taken steps to ensure that this email and attachments are free from any virus, but it remains your responsibility to ensure that viruses do not adversely affect you. Cancer Research UK Registered in England and Wales Company Registered Number: 4325234. Registered Charity Number: 1089464 and Scotland SC041666 Registered Office Address: Angel Building, 407 St John Street, London EC1V 4AD. -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral at fm.ul.pt<mailto:email%3aandreiaamaral at="" fm.ul.pt=""> ; andreiaamaral at fc.ul.pt<mailto:andreiaamaral at="" fc.ul.pt=""> -- ---------------------------------------------------------------------- ----------------------- Andreia J. Amaral, PhD BioFIG - Center for Biodiversity, Functional and Integrative Genomics Instituto de Medicina Molecular University of Lisbon Tel: +352 217500000 (ext. office: 28253) email:andreiaamaral at fm.ul.pt<mailto:email%3aandreiaamaral at="" fm.ul.pt=""> ; andreiaamaral at fc.ul.pt<mailto:andreiaamaral at="" fc.ul.pt=""> NOTICE AND DISCLAIMER This e-mail (including any attachments) is intended for the above- named person(s). If you are not the intended recipient, notify the sender immediately, delete this email from your system and do not disclose or use for any purpose. We may monitor all incoming and outgoing emails in line with current legislation. We have taken steps to ensure that this email and attachments are free from any virus, but it remains your responsibility to ensure that viruses do not adversely affect you. Cancer Research UK Registered in England and Wales Company Registered Number: 4325234. Registered Charity Number: 1089464 and Scotland SC041666 Registered Office Address: Angel Building, 407 St John Street, London EC1V 4AD.
ADD REPLY

Login before adding your answer.

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