LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
M H M H is offline
external usenet poster
 
Posts: 28
Default A function of reverse complement


I've written an excel function aim to change a RNA sequence to its
reverse complement (e.g. from "ACGUUGUA" to "UACAACGU") as:

Function ReverseComplement(Rcell As Range, Optional IsText As Boolean)

Dim i As Integer
Dim strReverseSeq As String
Dim strSenseSeq As String

strSenseSeq = Trim(Rcell)

For i = 1 To Len(strSenseSeq)
strReverseSeq = Mid(strSenseSeq, i, 1) & _ strReverseSeq
Next i

If IsText = False Then
ReverseComplement = CLng(strReverseSeq)
Else
ReverseComplement = strReverseSeq
End If

strSeqA1 = Replace(strReverseSeq, "A", "1")
strSeqC2 = Replace(strSeqA1, "C", "2")
strSeqG3 = Replace(strSeqC2, "G", "3")
strSeqT4 = Replace(strSeqG3, "U", "4")
strSeq1T = Replace(strSeqT4, "1", "U")
strSeq2G = Replace(strSeq1T, "2", "G")
strSeq3C = Replace(strSeq2G, "3", "C")
strSeq4A = Replace(strSeq3C, "4", "A")

End Function

The first half works fine, which reverse the sequence, but the second
part doesn't work, which cannot make the comoplements Please help for
debug. Much thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
typing a complement (i.e. notA) character in Excel jheby Excel Discussion (Misc queries) 6 September 6th 06 12:30 AM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
How do I solve for complement rule of P(X > or = 4.0) in excel? OKONITA New Users to Excel 1 June 15th 05 11:09 AM
Reverse MATCH Function BillCPA Excel Discussion (Misc queries) 2 March 9th 05 02:32 AM
Reverse of Chr Function ExcelMonkey[_150_] Excel Programming 3 June 15th 04 09:25 PM


All times are GMT +1. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"