烟草核酸管理系统源程序.doc
《烟草核酸管理系统源程序.doc》由会员分享,可在线阅读,更多相关《烟草核酸管理系统源程序.doc(77页珍藏版)》请在三一文库上搜索。
1、烟草核酸数据库管理系统源程序云南省烟草科学研究所2006-12-18源程序的前 10页ImportsSystemImportsSystem.ioImportsSystem.TextPublicClass Abitracer 解析一个 abi 文件/the next three lines are the important persistent dataPrivatesequence AsStringPrivateA(), G(), C(), T(), Basecalls()As IntegerPrivateTraceLength, SeqLengthAs Integer/This is th
2、e actual file data.PrivateTraceData()As BytePrivatemaximum As Integer= 0/the next four declaration lines comprise the file index informationPrivateMacJunk 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 ABITr
3、ace to handle that in a way that /is invisible to the user.PrivateShared AbsIndexBaseAs Integer = 26/The file location of the Index pointerPrivateIndexBase, PLOC As IntegerPrivateATraceStart, CTraceStart, GTraceStart, TTraceStartAs Integer/the next declaration is for the actual file pointersPrivateD
4、ATA9, DATA10, DATA11, DATA12, PBAS2, FWOAs IntegerPrivate stremtempfile As String = stream Dim Basecalls() As IntegerDim acolorAs Color = Color.DarkGreenDim ccolorAs Color = Color.BlueDim gcolorAs Color = Color.BlackDim tcolorAs Color = Color.RedDim ncolorAs Color = Color.PinkDim abrushAs Brush = Br
5、ushes.BlueDim cbrushAs Brush = Brushes.RedDim gbrushAs Brush = Brushes.DarkGreenDim tbrushAs Brush = Brushes.BlackDim nbrushAs Brush = Brushes.PinkDim backcolor As Color = Color.WhiteDim dffontAs Font = NewFont(Times New Roman, 10)PrivatemyRund, mydate, myDYEP, myMACH, myMODL, myBCAL As StringPublic
6、lableAsStringPrivateerrstringPublicFunctionABITrace( ByVal ABIFile()As Byte ) As BooleaninitData(ABIFile)Iferrstring ReturnFalseThenElseReturnTrueEnd IfEnd FunctionPublicFunctionABITrace(ByVal ABIFileAs String)As BooleanIfABIFile = Thenerrstring = 请输入文件!ReturnFalseExitFunctionEnd IfDim bytes()As Byt
7、eDim fsAs FileStreamDim readerAs BinaryReaderTryfs =NewFileStream(ABIFile, FileMode.Open)reader =NewBinaryReader(fs)bytes = reader.ReadBytes(fs.Length)reader.Close()fs.Close()fs =NothingCatch exAs Exceptionerrstring = ex.ToStringReturnFalseExitFunctionEnd TryIfIsNothing(bytes)Thenerrstring = 无效文件!Re
8、turnFalseExitFunctionEnd Iferrstring = initData(bytes)Iferrstring ReturnFalseThenElseReturnEnd IfTrueEnd FunctionPrivateSub initData(ByVal fileData()As Byte )TraceData = fileDataIfisABI()ThensetIndex()setBasecalls()setSeq()setTraces()End IfEnd SubPublicSub getImage(ByRef outAs PictureBox,ByVal width
9、ScaleAs Integer)out.Image =CType(getImage(out.Height, widthScale), Image)End SubPublicFunctiongetImage(ByVal heightAs Integer,ByVal widthScaleAs Double )As BitmapDim out As Bitmap out = NewBitmap(CInt (TraceLength * 2 * widthScale), height)out.Widthout.Width = TraceLength * widthScaleDim imageHeight
10、As Integer= out.Height out.Height = imageHeightDim gdDim mypen As PenDim scaleAs Doublescale = calculateScale(out.Height)Dim bc()As Integer= Basecallsbc 可能是定义nt 所在的坐标位置Dim seq()As CharDim dfcolorAs Color = Color.BlackDim dfbrush = Brushes.BlackDim aaAs Brushseq = sequence.ToCharArraygd = Graphics.Fr
11、omImage(out)gd.Clear(backcolor)Dim here, basenumAs Integerhere = 0basenum = 0For qAs Integer= 1To 5For xAs Integer= 0To 2 * TraceLength - 2Ifq = 1Then 画A的轨迹 g.setColor(acolor)gd.DrawLine(NewPen(acolor), 2 * x, transmute(A(x), imageHeight, scale), _2 * (x + 1), transmute(A(x + 1), imageHeight, scale)
12、End IfIfq = 2Thengd.DrawLine(NewPen(ccolor), 2 * x, transmute(C(x), imageHeight, scale), _ 2 * (x + 1), transmute(C(x + 1), imageHeight,scale)End IfIfq = 3Thengd.DrawLine(NewPen(tcolor), 2 * x, transmute(T(x), imageHeight, scale), _ 2 * (x + 1), transmute(T(x + 1), imageHeight,scale)End IfIfq = 4The
13、ngd.DrawLine(NewPen(gcolor), 2 * x, transmute(G(x), imageHeight, scale), _ 2 * (x + 1), transmute(G(x + 1), imageHeight,scale)End IfIfq = 5Then 画其他内容的If(here bc.Length - 1)Or (basenum seq.Length - 1)Then ExitForIfxMod 30 = 0Thengd.DrawString(2 * x, dffont, Brushes.Black, _ (2 * x - 3), transmute(-27
14、 imageHeight, 1.0) End IfIf(bc(here) = x)Thengd.DrawLine(NewPen(dfcolor), 2 * x, transmute(-2, imageHeight, 1.0), _2 * x, transmute(-7, imageHeight, 1.0)If(basenum + 1)Mod10 = 0)Then /if the basecount is divisible by ten/add a numbergd.DrawLine(NewPen(dfcolor),2 * x,transmute(-20,imageHeight,1.0),_
15、2 * x, transmute(-25, imageHeight, 1.0)gd.DrawString(basenum + 1, dffont, Brushes.Black, _(2 * x - 3), transmute(-36, imageHeight, 1.0)End IfSelectCase seq(basenum)Case A, adfbrush = abrushCase C, cdfbrush = cbrushCase G, gdfbrush = gbrushCase T, tdfbrush = tbrushCase Elsedfbrush = nbrushEnd Selectg
16、d.DrawString(seq(basenum), dffont, dfbrush, (2 * x - 3), transmute(-18, imageHeight, 1.0)dfbrush = Brushes.Black 输入一个位图坐标,得到相应的一个here += 1basenum += 1End IfEnd IfNextNextReturn outEnd FunctionPublicFunctiongetabasebyid(ByVal xAs Integer )As CharbaseIfx sequence.Length - 1Return REnd IfThenReturnCTyp
17、e(sequence.Chars(x),Char)End FunctionPublicFunctiongetsiglebase(ByVal xAs Integer )As Char 输入一个位图坐标,得到相应的一个baseDim basenum As Integer= getbaseX(x)MsgBox(basenum)Ifbasenum sequence.Length - 1Return REnd IfThenReturnCType(sequence.Chars(basenum),Char)End FunctionPublicFunctiongetbaseX(ByVal xAs Intege
18、r )As Integer 根据输入的坐标得到最近 base的索引( x 方向)Dim xidx, xs, xsminAs IntegerIfx 2 * TraceLengthThenerrstring = 坐标越界! Return -1ExitFunctionEnd IfDim bc()As Integer= Basecallsxsmin = 2 * TraceLength - 2For iAs Integer= 0To bc.Length - 1xs = (x - bc(i) * 2) 2Ifxs xsminThenxsmin = xsxidx = iEnd IfNextMsgBox(xs
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 烟草 核酸 管理 系统 源程序
