[Bioc-sig-seq] trimLRPatterns: can someone clarify the effects of the "ranges" argument?
Martin Morgan
mtmorgan at fhcrc.org
Sat Dec 4 06:18:04 CET 2010
On 12/03/2010 03:23 PM, Harris A. Jaffee wrote:
> You are correct. Your setting of 'ranges' is being ignored by the
> ShortRead
> method, as we clearly see from
>
> showMethods("trimLRPatterns", includeDefs=TRUE)
>
> It sounds like a bug to me unless there is documentation for it, which I
> don't
> find, but maybe I don't know where to look.
>
> The workaround for you right now, to get an IRanges value, would be to send
> trimLRPatterns the sread slot of your ShortRead object, as in
>
> trimLRPatterns(subject=sread(your_ShortRead_object), ranges=T, other
> params)
>
> But perhaps Martin knows better.
Hi Harris, Lionel,
that the ranges argument is ignored is documented on ?
?"trimLRPatterns,ShortRead-method", but I've changed this to be
consistent with the behavior of ?trimLRPatterns in ShortRead v. 1.9.8 to
appear in the Devel branch.
Martin
>
> -Harris
>
> On Dec 3, 2010, at 10:16 AM, Lionel (Lee) Brooks 3rd wrote:
>> Hello all,
>>
>> I am using trimLRPatterns to trim adapter sequences from my short read
>> fastq file. I followed the excellent tutorial at UCRiverside and
>> everything works swimmingly. My issue is that I do not understand the
>> distinction between objects created with
>> trimLRPatterns(...,ranges=TRUE) and those created with
>> trimLRPatterns(...,ranges=FALSE).
>>
>> I create my ShortRead object in the following manner:
>>
>> reads <- readFastq("/path/to/seqandqualities.fastq")
>> seqs <- sread(reads) # get sequence list
>> qual <- quality(reads) # get quality score list
>> qual <- quality(qual) # strip quality score type
>> adapter3pr <- "TCGTATGCCGTCTTCTGCTTG"
>> adapter5pr <- "CGACAGGTTCAGAGTTCTACAGTCCGACGATC"
>> # This is the adapter sequence to be trimmed from the ends of your
>> reads
>> trimCoords <- trimLRPatterns(Rpattern=adapter3pr, Lpattern=adapter5pr,
>> subject=seqs, ranges=T)
>> # Trim sequences looking for a right end and left end pattern
>> # Gets IRanges object with trimmed coordinates
>> seqs <- DNAStringSet(seqs, start=start(trimCoords), end=end(trimCoords))
>> qual <- BStringSet(qual, start=start(trimCoords), end=end(trimCoords))
>> # Use IRanges coordinates to trim sequences and quality scores
>> qual <- SFastqQuality(qual) # reapply quality score type
>> trimmed <- ShortReadQ(sread=seqs, quality=qual, id=id(reads))
>>
>> Now...my confusion arose when I used the same code EXCEPT I used
>> ranges=F in the trimLRPatterns call. Like this:
>>
>> trimCoords <- trimLRPatterns(Rpattern=adapter3pr, Lpattern=adapter5pr,
>> subject=seqs, ranges=F)
>>
>> but upon examing the resulting object:
>>
>> atrributes(trimCoords)
>>
>> I can see no difference between the object that I created when
>> ranges=T. Can anyone tell me what is happening here? I wish to
>> extract the match coordinates from the trimCoords object.
>>
>> Please Note I adapted this code from:
>> http://manuals.bioinformatics.ucr.edu/home/ht-seq#TOC-SmallRNA-Profiling
>>
>> Appreciatively,
>> Lee Brooks
>>
>> _______________________________________________
>> Bioc-sig-sequencing mailing list
>> Bioc-sig-sequencing at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
>
> _______________________________________________
> Bioc-sig-sequencing mailing list
> Bioc-sig-sequencing at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing
--
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109
Location: M1-B861
Telephone: 206 667-2793
More information about the Bioc-sig-sequencing
mailing list