资源预览内容
第1页 / 共76页
第2页 / 共76页
第3页 / 共76页
第4页 / 共76页
第5页 / 共76页
第6页 / 共76页
第7页 / 共76页
第8页 / 共76页
第9页 / 共76页
第10页 / 共76页
亲,该文档总共76页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
烟草核酸数据库管理系统源程序云南省烟草科学研究所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, SeqLength 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-pended 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 declaration 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 = Color.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 Roman, 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 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() 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 fileData() 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 Integer, 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 Double 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 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), 2 * x, transmute(C(x), imageHeight, scale), _ 2 * (x + 1), transmute(C(x + 1), imageHei
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号