[Bioc-sig-seq] trimLRPatterns related error

Harris A. Jaffee hj at jhu.edu
Wed Oct 27 03:16:30 CEST 2010


Thanks for the bug report.

At the moment, you will have to patch the result of your 2nd call to  
trimLRPatterns:

	trimCoordsAL<-trimLRPatterns(Lpattern=adapter, subject=seqsART, .....
	
	# correction
	trimCoordsAL[width(trimCoordsAL)==0] <- IRanges(start=1, end=0)
	
	seqsAL <- DNAStringSet(seqsART, start=start(trimCoordsAL), end=end 
(trimCoordsAL))

To be clear, especially if others are reading, your "After trimming  
is done to the three
prime..." (which I think is correct) conflicts with "#after trimming  
from the five prime".

Now, this was essentially a known problem, as follows:

 > trimLRPatterns(subject="", Lpattern="A")
Error in solveSubseqSEW(length(x), start, end, width) :
   Invalid sequence coordinates.
   Please make sure the supplied 'start', 'end' and 'width' arguments
   are defining a region that is within the limits of the sequence.

What you experienced will happen even more simply this way:

 > r <- trimLRPatterns(subject="", Lpattern="A", ranges=TRUE)
 > r
IRanges of length 1
     start end width
[1]     2   1     0
 > narrow("", start=start(r), end=end(r))
Error in solveUserSEW(x_width, start = start, end = end, width =  
width) :
   solving row 1: 'allow.nonnarrowing' is FALSE and the supplied  
start (2) is > refwidth + 1

On the other hand:

 > narrow("", start=1, end=0)
[1] ""

Hopefully more to follow...

On Oct 26, 2010, at 4:51 PM, Kunbin Qu wrote:

> Hi, all,
>
> I am trying to use trimLRPatterns to construct a set of reads after  
> trimming from both ends. After trimming is done to the three prime,  
> some reads are already down to zero. Then when I tried to trim from  
> the five prime, the trimming (trimLRPatterns) did not raise any  
> error, however, the following DNAStringSet construction threw some  
> errors, like the following. Could anybody help me? Thanks a lot!
>
> -Kunbin
>
>> #after trimming from the five prime, read No. 2 now is zero in length
>> seqsART
>   A DNAStringSet instance of length 7
>     width seq
> [1]     5 NGTCA
> [2]     0
> [3]     8 NCGGTGCA
> [4]    24 NGACGGTTCACCCCTCGTGGGCAA
> [5]    49 TATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAAAAAAAAAAAAAAAAA
> [6]    36 TATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAAAA
> [7]    49 TATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAAAAACCTAAACCAGGG
>> trimCoordsAL<-trimLRPatterns(Lpattern=adapter, subject=seqsART,  
>> max.Lmismatch = rep(1,46), ranges=T, with.Lindels=TRUE)
>> adapter<-DNAString("TTTACACGCGTCTCCCGGGCTTATCTCGTATGCCGTCTTCTGCTTG")
>> trimCoordsAL
> IRanges of length 7
>     start end width
> [1]     3   5     3
> [2]     2   1     0
> [3]     2   8     7
> [4]     3  24    22
> [5]    27  49    23
> [6]    27  36    10
> [7]    27  49    23
>> seqsAL <- DNAStringSet(seqsART, start=start(trimCoordsAL), end=end 
>> (trimCoordsAL))
> Error in solveUserSEW(width(x), start = start, end = end, width =  
> width) :
>   solving row 2: 'allow.nonnarrowing' is FALSE and the supplied  
> start (2) is > refwidth + 1
>>
>
> ______________________________________________________________________
> The contents of this electronic message, including any attachments,  
> are intended only for the use of the individual or entity to which  
> they are addressed and may contain confidential information. If you  
> are not the intended recipient, you are hereby notified that any  
> use, dissemination, distribution, or copying of this message or any  
> attachment is strictly prohibited. If you have received this  
> transmission in error, please send an e-mail to  
> postmaster at genomichealth.com and delete this message, along with  
> any attachments, from your computer.
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing



More information about the Bioc-sig-sequencing mailing list