how to get the first hit in each sequence from vmatchPattern results
1
0
Entering edit mode
wang peter ★ 2.0k
@wang-peter-4647
Last seen 9.7 years ago
dear ALL See the example, result <- vmatchPattern(currentPattern, sread(currentReads), max.mismatch= max.mismatchs, min.mismatch=0); startIndex(result) [[1]] [1] 1 [[2]] [1] 1 [2] 2 if i want to get only the [1] element from the [[1]] and [[2]] what can i do? thx -- shan gao Room 231(Dr.Fei lab) Boyce Thompson Institute Cornell University Tower Road, Ithaca, NY 14853-1801 Office phone: 1-607-254-1267(day) Official email:sg839 at cornell.edu Facebook:http://www.facebook.com/profile.php?id=100001986532253
• 694 views
ADD COMMENT
0
Entering edit mode
@herve-pages-1542
Last seen 1 day ago
Seattle, WA, United States
On 11/02/2012 10:51 AM, wang peter wrote: > dear ALL > > See the example, > result <- vmatchPattern(currentPattern, sread(currentReads), > max.mismatch= max.mismatchs, min.mismatch=0); > startIndex(result) > [[1]] > [1] 1 > > [[2]] > [1] 1 [2] 2 > > > if i want to get only the [1] element from the [[1]] and [[2]] > > what can i do? Not clear to me whether (1) you know about the existence of sapply, you tried it, and you ran into some performance issues, or (2) you don't know about sapply or how to loop on a list object in general. Can you clarify? Thanks, H. > > thx > -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpages at fhcrc.org Phone: (206) 667-5791 Fax: (206) 667-1319
ADD COMMENT
0
Entering edit mode
dear Dr. Herve: thank you very much for your help. i donot know how to use sapply to pickup the first element for each list object. shan
ADD REPLY
0
Entering edit mode
On 11/02/2012 11:21 AM, wang peter wrote: > dear Dr. Herve: > thank you very much for your help. > i donot know how to use sapply to pickup > the first element for each list object. Then you'll need to do a little bit of homework. ?sapply is a good start. Since lapply/sapply are not Bioconductor specific functions, questions about unclear documentation, bug reports, etc... are better asked on the R-help or R-devel mailing lists. Thanks, H. > > shan > -- Hervé Pagès Program in Computational Biology Division of Public Health Sciences Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N, M1-B514 P.O. Box 19024 Seattle, WA 98109-1024 E-mail: hpages at fhcrc.org Phone: (206) 667-5791 Fax: (206) 667-1319
ADD REPLY

Login before adding your answer.

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