烟草核酸管理系统源程序共76页.doc
《烟草核酸管理系统源程序共76页.doc》由会员分享,可在线阅读,更多相关《烟草核酸管理系统源程序共76页.doc(76页珍藏版)》请在三一文库上搜索。
1、精选优质文档-倾情为你奉上烟草核酸数据库管理系统源程序云南省烟草科学研究所2006-12-18源程序的前10页Imports SystemImports System.ioImports System.TextPublic Class Abitracer 解析一个abi文件 /the next three lines are the important persistent data Private sequence As String Private A(), G(), C(), T(), Basecalls() As Integer Private TraceLength, SeqLeng
2、th As Integer /This is the actual file data. Private TraceData() As Byte Private maximum As Integer = 0 /the next four declaration lines comprise the file index information Private MacJunk As Integer = 0 /sometimes when macintosh files are /FTPed in binary form, they have 128 bytes /of crap pre-pend
3、ed to them. This constant /allows ABITrace to handle that in a way that /is invisible to the user. Private Shared AbsIndexBase As Integer = 26 /The file location of the Index pointer Private IndexBase, PLOC As Integer Private ATraceStart, CTraceStart, GTraceStart, TTraceStart As Integer /the next de
4、claration is for the actual file pointers Private DATA9, DATA10, DATA11, DATA12, PBAS2, FWO As Integer Private stremtempfile As String = stream Dim Basecalls() As Integer Dim acolor As Color = Color.DarkGreen Dim ccolor As Color = Color.Blue Dim gcolor As Color = Color.Black Dim tcolor As Color = Co
5、lor.Red Dim ncolor As Color = Color.Pink Dim abrush As Brush = Brushes.Blue Dim cbrush As Brush = Brushes.Red Dim gbrush As Brush = Brushes.DarkGreen Dim tbrush As Brush = Brushes.Black Dim nbrush As Brush = Brushes.Pink Dim backcolor As Color = Color.White Dim dffont As Font = New Font(Times New Ro
6、man, 10) Private myRund, mydate, myDYEP, myMACH, myMODL, myBCAL As String Public lable As String Private errstring Public Function ABITrace(ByVal ABIFile() As Byte) As Boolean initData(ABIFile) If errstring Then Return False Else Return True End If End Function Public Function ABITrace(ByVal ABIFile
7、 As String) As Boolean If ABIFile = Then errstring = 请输入文件! Return False Exit Function End If Dim bytes() As Byte Dim fs As FileStream Dim reader As BinaryReader Try fs = New FileStream(ABIFile, FileMode.Open) reader = New BinaryReader(fs) bytes = reader.ReadBytes(fs.Length) reader.Close() fs.Close(
8、) fs = Nothing Catch ex As Exception errstring = ex.ToString Return False Exit Function End Try If IsNothing(bytes) Then errstring = 无效文件! Return False Exit Function End If errstring = initData(bytes) If errstring Then Return False Else Return True End If End Function Private Sub initData(ByVal file
9、Data() As Byte) TraceData = fileData If isABI() Then setIndex() setBasecalls() setSeq() setTraces() End If End Sub Public Sub getImage(ByRef out As PictureBox, ByVal widthScale As Integer) out.Image = CType(getImage(out.Height, widthScale), Image) End Sub Public Function getImage(ByVal height As Int
10、eger, ByVal widthScale As Double) As Bitmap Dim out As Bitmap out = New Bitmap(CInt(TraceLength * 2 * widthScale), height) out.Width out.Width = TraceLength * widthScale Dim imageHeight As Integer = out.Height out.Height = imageHeight Dim gd As System.Drawing.Graphics Dim mypen As Pen Dim scale As D
11、ouble scale = calculateScale(out.Height) Dim bc() As Integer = Basecalls bc可能是定义nt所在的坐标位置 Dim seq() As Char Dim dfcolor As Color = Color.Black Dim dfbrush = Brushes.Black Dim aa As Brush seq = sequence.ToCharArray gd = Graphics.FromImage(out) gd.Clear(backcolor) Dim here, basenum As Integer here = 0
12、 basenum = 0 For q As Integer = 1 To 5 For x As Integer = 0 To 2 * TraceLength - 2 If q = 1 Then 画A的轨迹 g.setColor(acolor) gd.DrawLine(New Pen(acolor), 2 * x, transmute(A(x), imageHeight, scale), _ 2 * (x + 1), transmute(A(x + 1), imageHeight, scale) End If If q = 2 Then gd.DrawLine(New Pen(ccolor),
13、2 * x, transmute(C(x), imageHeight, scale), _ 2 * (x + 1), transmute(C(x + 1), imageHeight, scale) End If If q = 3 Then gd.DrawLine(New Pen(tcolor), 2 * x, transmute(T(x), imageHeight, scale), _ 2 * (x + 1), transmute(T(x + 1), imageHeight, scale) End If If q = 4 Then gd.DrawLine(New Pen(gcolor), 2
14、 x, transmute(G(x), imageHeight, scale), _ 2 * (x + 1), transmute(G(x + 1), imageHeight, scale) End If If q = 5 Then 画其他内容的 If (here bc.Length - 1) Or (basenum seq.Length - 1) Then Exit For If x Mod 30 = 0 Then gd.DrawString(2 * x, dffont, Brushes.Black, _ (2 * x - 3), transmute(-27, imageHeight, 1
15、0) End If If (bc(here) = x) Then gd.DrawLine(New Pen(dfcolor), 2 * x, transmute(-2, imageHeight, 1.0), _ 2 * x, transmute(-7, imageHeight, 1.0) If (basenum + 1) Mod 10 = 0) Then /if the basecount is divisible by ten /add a number gd.DrawLine(New Pen(dfcolor), 2 * x, transmute(-20, imageHeight, 1.0)
16、 _ 2 * x, transmute(-25, imageHeight, 1.0) gd.DrawString(basenum + 1, dffont, Brushes.Black, _ (2 * x - 3), transmute(-36, imageHeight, 1.0) End If Select Case seq(basenum) Case A, a dfbrush = abrush Case C, c dfbrush = cbrush Case G, g dfbrush = gbrush Case T, t dfbrush = tbrush Case Else dfbrush
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 烟草 核酸 管理 系统 源程序 76
