GenomicRanges countOverlaps error
1
0
Entering edit mode
Suraj Menon ▴ 20
@suraj-menon-4244
Last seen 9.6 years ago
Hi all I've been trying to use the GenomicRanges countOverlaps function. When I was using the release version of GenomicRanges, countOverlaps worked fine for coordinates from chromosomes 1-9, but gave me an error for the others. I switched to using the development version of GenomicRanges. The function now works for all chromosomes other than X and Y. Does anyone know a way around this? (see code below) > aligns <- readBamGappedAlignments(testFile) > rname(aligns) 'factor' Rle of length 29420299 with 75 runs Lengths: 520361 542488 405709 384155 391181 ... 143664 2162 587871 40505 Values : chr1 chr2 chr3 chr4 chr5 ... chr22 chrM chrX chrY Levels(49): chr1 chr10 chr10_random chr11 ... chrM chrX chrX_random chrY > yst <- seq(1, 1000, by=100) > ywd <- rep(100, length(yst)) > ## chr1 > gr <- GRanges(seqnames = Rle("chr1", length(yst)), + ranges = IRanges(yst, width = ywd)) > counts <- countOverlaps(gr, aligns) > counts [1] 0 14 11 1 8 12 2 0 0 0 > > ## chr18 > gr <- GRanges(seqnames = Rle("chr18", length(yst)), + ranges = IRanges(yst, width = ywd)) > counts <- countOverlaps(gr, aligns) > counts [1] 2 31 1 4 4 4 8 5 6 3 > > ## chrX > gr <- GRanges(seqnames = Rle("chrX", length(yst)), + ranges = IRanges(yst, width = ywd)) > counts <- countOverlaps(gr, aligns) Warning message: In .local(query, subject, maxgap, minoverlap, type, select, ...) : 'query' and 'subject' do not use a similiar naming convention for seqnames > > ## chrY > gr <- GRanges(seqnames = Rle("chrY", length(yst)), + ranges = IRanges(yst, width = ywd)) > counts <- countOverlaps(gr, aligns) Warning message: In .local(query, subject, maxgap, minoverlap, type, select, ...) : 'query' and 'subject' do not use a similiar naming convention for seqnames > > sessionInfo() R version 2.11.1 (2010-05-31) x86_64-unknown-linux-gnu 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] Rsamtools_1.0.8 Biostrings_2.17.26 GenomicRanges_1.1.25 [4] IRanges_1.7.32 loaded via a namespace (and not attached): [1] Biobase_2.8.0 tools_2.11.1 Cheers -Suraj This communication is from Cancer Research UK. Our website is at www.cancerresearchuk.org. We are a registered charity in England and Wales (1089464) and in Scotland (SC041666) and a company limited by guarantee registered in England and Wales under number 4325234. Our registered address is 61 Lincoln's Inn Fields, London WC2A 3PX. Our central telephone number is 020 7242 0200. >From 1 October 2010 our registered address will be Angel Building, 407 St John Street, London, EC1V 4AD. This communication and any attachments contain information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender and delete the email and destroy any copies of it. E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. We do not accept liability for any such matters or their consequences. Anyone who communicates with us by e-mail is taken to accept the risks in doing so.
Cancer GenomicRanges Cancer GenomicRanges • 1.2k views
ADD COMMENT
0
Entering edit mode
@steve-lianoglou-2771
Last seen 13 months ago
United States
Hi Suraj, On Tue, Sep 7, 2010 at 7:01 AM, Suraj Menon <suraj.menon at="" cancer.org.uk=""> wrote: > Hi all > > I've been trying to use the GenomicRanges countOverlaps function. When I was using the release version of GenomicRanges, countOverlaps worked fine for coordinates from chromosomes 1-9, but gave me an error for the others. > > I switched to using the development version of GenomicRanges. The function now works for all chromosomes other than X and Y. > Does anyone know a way around this? I'm sorry, but I don't see what you're trying to get around? Is it where you are querying with GRange from chrX and chrY here? <snip> >> ## chrX >> gr <- GRanges(seqnames = Rle("chrX", length(yst)), > + ? ? ?ranges = IRanges(yst, width = ywd)) >> counts <- countOverlaps(gr, aligns) > Warning message: > In .local(query, subject, maxgap, minoverlap, type, select, ...) : > ?'query' and 'subject' do not use a similiar naming convention for seqnames </snip> The call to countOverlaps is simply (now) drawing your attention to the fact that the seqnames of your query and subject GRanges aren't exactly similar (via a "warning") -- the function call itself should be working and return a result to you, no? This thread actually drew attention to the problem. Originally we were getting an error in these situation, but Herve has now switched this to a warning: http://thread.gmane.org/gmane.science.biology.informatics.conductor/30 491 Perhaps reading through that might shed more light on your issue, if this is what you were asking about(?) If not, could you be a bit more specific about the error/problem you are referring to? Hope that helped, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
ADD COMMENT
0
Entering edit mode
Hi Steve Thanks very much for your response. Yes I was indeed getting an error previously. However, I then updated the GenomicRanges devel version just before writing to the mailing list, and hadn't noticed that I was now getting just a warning instead of an error. Cheers -Suraj -----Original Message----- From: Steve Lianoglou [mailto:mailinglist.honeypot@gmail.com] Sent: 07 September 2010 21:32 To: Suraj Menon Cc: bioconductor at stat.math.ethz.ch Subject: Re: [BioC] GenomicRanges countOverlaps error Hi Suraj, On Tue, Sep 7, 2010 at 7:01 AM, Suraj Menon <suraj.menon at="" cancer.org.uk=""> wrote: > Hi all > > I've been trying to use the GenomicRanges countOverlaps function. When I was using the release version of GenomicRanges, countOverlaps worked fine for coordinates from chromosomes 1-9, but gave me an error for the others. > > I switched to using the development version of GenomicRanges. The function now works for all chromosomes other than X and Y. > Does anyone know a way around this? I'm sorry, but I don't see what you're trying to get around? Is it where you are querying with GRange from chrX and chrY here? <snip> >> ## chrX >> gr <- GRanges(seqnames = Rle("chrX", length(yst)), > + ? ? ?ranges = IRanges(yst, width = ywd)) >> counts <- countOverlaps(gr, aligns) > Warning message: > In .local(query, subject, maxgap, minoverlap, type, select, ...) : > ?'query' and 'subject' do not use a similiar naming convention for seqnames </snip> The call to countOverlaps is simply (now) drawing your attention to the fact that the seqnames of your query and subject GRanges aren't exactly similar (via a "warning") -- the function call itself should be working and return a result to you, no? This thread actually drew attention to the problem. Originally we were getting an error in these situation, but Herve has now switched this to a warning: http://thread.gmane.org/gmane.science.biology.informatics.conductor/30 491 Perhaps reading through that might shed more light on your issue, if this is what you were asking about(?) If not, could you be a bit more specific about the error/problem you are referring to? Hope that helped, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology ?| Memorial Sloan-Kettering Cancer Center ?| Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact This communication is from Cancer Research UK. Our website is at www.cancerresearchuk.org. We are a registered charity in England and Wales (1089464) and in Scotland (SC041666) and a company limited by guarantee registered in England and Wales under number 4325234. Our registered address is 61 Lincoln's Inn Fields, London WC2A 3PX. Our central telephone number is 020 7242 0200. >From 1 October 2010 our registered address will be Angel Building, 407 St John Street, London, EC1V 4AD. This communication and any attachments contain information which is confidential and may also be privileged. It is for the exclusive use of the intended recipient(s). If you are not the intended recipient(s) please note that any form of disclosure, distribution, copying or use of this communication or the information in it or in any attachments is strictly prohibited and may be unlawful. If you have received this communication in error, please notify the sender and delete the email and destroy any copies of it. E-mail communications cannot be guaranteed to be secure or error free, as information could be intercepted, corrupted, amended, lost, destroyed, arrive late or incomplete, or contain viruses. We do not accept liability for any such matters or their consequences. Anyone who communicates with us by e-mail is taken to accept the risks in doing so.
ADD REPLY

Login before adding your answer.

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