[Bioc-sig-seq] what is

Harris A. Jaffee hj at jhu.edu
Tue Sep 27 22:10:10 CEST 2011


matchPattern does not support your non-integral setting  
max.mismatch=0.2.
The help page is very clear about that with the phrase "number of ...":

	max.mismatch, min.mismatch: The maximum and minimum number of
           mismatching letters allowed

Your 0.2 is converted to 0L by as.integer(max.mismatch), as here:

 > Biostrings:::normargMaxMismatch(0.2)
[1] 0

I think the following call gives what you want:

 > matchPattern(pattern1, subject1, max.mismatch=1, with.indels=TRUE)
   Views on a 81-letter BString subject
subject:  
ATCGAGATCGGAAGAGCGGTTCAGCAGGAATGCC...TATGCCGTCTTCTGCTTGAAAAAAAAAAAATATT
views:
     start end width
[1]     1  65    65  
[ATCGAGATCGGAAGAGCGGTTCAGCAGG...CCGATCTCGTATGCCGTCTTCTGCTTG]

However, the trimLRPatterns call you wrote is suspicious because you  
don't
mention any 'subject' (only *subject1*):

>> trimLRPatterns(Lpattern = pattern1, subject = subject,
> max.Lmismatch=0,with.Lindels=TRUE)

But, if we use subject1 instead there, we get

 > trimLRPatterns(Lpattern = pattern1, subject = subject1,  
max.Lmismatch=0,
	with.Lindels=TRUE)
[1] "AAAAAAAAAAAATATT"

And this happens because of:

 > pattern_suffix = substr(pattern1, start=2, stop=nchar(pattern1))
 > neditAt(at=1, pattern_suffix, subject1, with.indels=TRUE)
[1] 0

On Sep 27, 2011, at 3:23 PM, wang peter wrote:
> hello every one,
>
> i have such coding
>
>> subject1 =
> "ATCGAGATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCGATCTCGTATGCCGTCTTCTGCTTGAAAA 
> AAAAAAAATATT"
>
>> pattern1 =
> "AATCGAGATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCGATCTCGTATGCCGTCTTCTGCTTG"
>> matchPattern(pattern1, subject1, max.mismatch=0.2, min.mismatch=0,
> with.indels=TRUE)
>   Views on a 81-letter BString subject
> subject:
> ATCGAGATCGGAAGAGCGGTTCAGCAGGAATGCCGAGACCGATCTCGTATGCCGTCTTCTGCTTGAAAAA 
> AAAAAAATATT
> views: NONE
>> trimLRPatterns(Lpattern = pattern1, subject = subject,
> max.Lmismatch=0,with.Lindels=TRUE)
> [1] "AAAAAAAAAAAATATT"
>>
>
> i already allow the indels,but why matchPattern cannot find the  
> pattern in
> subject
> what does with.indels mean?
> i am confused
> thx
> shan gao
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> 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