烟草核酸管理系统源程序Word下载.doc
《烟草核酸管理系统源程序Word下载.doc》由会员分享,可在线阅读,更多相关《烟草核酸管理系统源程序Word下载.doc(76页珍藏版)》请在冰点文库上搜索。
![烟草核酸管理系统源程序Word下载.doc](https://file1.bingdoc.com/fileroot1/2023-5/11/d682998b-9d31-42c0-b1dd-f39eaafe1f0b/d682998b-9d31-42c0-b1dd-f39eaafe1f0b1.gif)
//allowsABITracetohandlethatinawaythat
//isinvisibletotheuser.
PrivateSharedAbsIndexBaseAsInteger=26'
//ThefilelocationoftheIndexpointer
PrivateIndexBase,PLOCAsInteger
PrivateATraceStart,CTraceStart,GTraceStart,TTraceStartAsInteger
//thenextdeclarationisfortheactualfilepointers
PrivateDATA9,DATA10,DATA11,DATA12,PBAS2,FWOAsInteger
PrivatestremtempfileAsString="
stream"
DimBasecalls()AsInteger
DimacolorAsColor=Color.DarkGreen
DimccolorAsColor=Color.Blue
DimgcolorAsColor=Color.Black
DimtcolorAsColor=Color.Red
DimncolorAsColor=Color.Pink
DimabrushAsBrush=Brushes.Blue
DimcbrushAsBrush=Brushes.Red
DimgbrushAsBrush=Brushes.DarkGreen
DimtbrushAsBrush=Brushes.Black
DimnbrushAsBrush=Brushes.Pink
DimbackcolorAsColor=Color.White
DimdffontAsFont=NewFont("
TimesNewRoman"
10)
PrivatemyRund,mydate,myDYEP,myMACH,myMODL,myBCALAsString
PubliclableAsString
Privateerrstring
PublicFunctionABITrace(ByValABIFile()AsByte)AsBoolean
initData(ABIFile)
Iferrstring<
>
"
"
Then
ReturnFalse
Else
ReturnTrue
EndIf
EndFunction
PublicFunctionABITrace(ByValABIFileAsString)AsBoolean
IfABIFile="
errstring="
请输入文件!
ExitFunction
Dimbytes()AsByte
DimfsAsFileStream
DimreaderAsBinaryReader
Try
fs=NewFileStream(ABIFile,FileMode.Open)
reader=NewBinaryReader(fs)
bytes=reader.ReadBytes(fs.Length)
reader.Close()
fs.Close()
fs=Nothing
CatchexAsException
errstring=ex.ToString
EndTry
IfIsNothing(bytes)Then
无效文件!
errstring="
initData(bytes)
PrivateSubinitData(ByValfileData()AsByte)
TraceData=fileData
IfisABI()Then
setIndex()
setBasecalls()
setSeq()
setTraces()
EndSub
PublicSubgetImage(ByRefoutAsPictureBox,ByValwidthScaleAsInteger)
out.Image=CType(getImage(out.Height,widthScale),Image)
PublicFunctiongetImage(ByValheightAsInteger,ByValwidthScaleAsDouble)AsBitmap
DimoutAsBitmap
out=NewBitmap(CInt(TraceLength*2*widthScale),height)
'
out.Width
out.Width=TraceLength*widthScale
DimimageHeightAsInteger=out.Height
out.Height=imageHeight
DimgdAsSystem.Drawing.Graphics
DimmypenAsPen
DimscaleAsDouble
scale=calculateScale(out.Height)
Dimbc()AsInteger=Basecalls'
bc可能是定义nt所在的坐标位置
Dimseq()AsChar
DimdfcolorAsColor=Color.Black
Dimdfbrush=Brushes.Black
DimaaAsBrush
seq=sequence.ToCharArray
gd=Graphics.FromImage(out)
gd.Clear(backcolor)
Dimhere,basenumAsInteger
here=0
basenum=0
ForqAsInteger=1To5
ForxAsInteger=0To2*TraceLength-2
Ifq=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))
EndIf
Ifq=2Then
gd.DrawLine(NewPen(ccolor),2*x,transmute(C(x),imageHeight,scale),_
2*(x+1),transmute(C(x+1),imageHeight,scale))
Ifq=3Then
gd.DrawLine(NewPen(tcolor),2*x,transmute(T(x),imageHeight,scale),_
2*(x+1),transmute(T(x+1),imageHeight,scale))
Ifq=4Then
gd.DrawLine(NewPen(gcolor),2*x,transmute(G(x),imageHeight,scale),_
2*(x+1),transmute(G(x+1),imageHeight,scale))
Ifq=5Then'
画其他内容的
If((here>
bc.Length-1)Or(basenum>
seq.Length-1))ThenExitFor
IfxMod30=0Then
'
gd.DrawString(2*x,dffont,Brushes.Black,_
(2*x-3),transmute(-27,imageHeight,1.0))
EndIf
If(bc(here)=x)Then
gd.DrawLine(NewPen(dfcolor),2*x,transmute(-2,imageHeight,1.0),_
2*x,transmute(-7,imageHeight,1.0))
If((basenum+1)Mod10=0)Then'
//ifthebasecountisdivisiblebyten//addanumber
gd.DrawLine(NewPen(dfcolor),2*x,transmute(-20,imageHeight,1.0),_
2*x,transmute(-25,imageHeight,1.0))
gd.DrawString(basenum+1,dffont,Brushes.Black,_
(2*x-3),transmute(-36,imageHeight,1.0))
EndIf
SelectCaseseq(basenum)
Case"
A"
"
a"
dfbrush=abrush
C"
c"
dfbrush=cbrush
G"
g"
dfbrush=gbrush
T"
t"
dfbrush=tbrush
CaseElse
dfbrush=nbrush
EndSelect
gd.DrawString(seq(basenum),dffont,dfbrush,(2*x-3),transmute(-18,imageHeight,1.0))
dfbrush=Brushes.Black
here+=1
basenum+=1
Next
Next
Returnout
PublicFunctiongetabasebyid(ByValxAsInteger)AsChar
输入一个位图坐标,得到相应的一个base
Ifx>
sequence.Length-1Then
Return"
R"
ReturnCType(sequence.Chars(x),Char)
PublicFunctiongetsiglebase(ByValxAsInteger)AsChar
DimbasenumAsInteger=getbaseX(x)
MsgBox(basenum)
Ifbasenum>
ReturnCType(sequence.Chars(basenum),Char)
PublicFunctiongetbaseX(ByValxAsInteger)AsInteger
根据输入的坐标得到最近base的索引(x方向)
Dimxidx,xs,xsminAsInteger
2*TraceLengthThen
坐标越界!
Return-1
Dimbc()AsInteger=Basecalls
xsmin=2*TraceLength-2
ForiAsInteger=0Tobc.Length-1
xs=(x-bc(i)*2)^2
Ifxs<
xsminThen
xsmin=xs
xidx=i
EndIf
MsgBox(xsmin)
MsgBox(bc(xidx))
bc=Nothing
Returnxidx
PublicFunctiongetbaseLX(ByValseqAsString,ByValcountAsInteger,ByValislastAsBoolean)AsInteger
得到要查找询列的
DimidxAsInteger
idx=getbaseX(seq,count,islast)
Ifidx=-1ThenReturn-1
ReturnBasecalls(idx)*2
PublicFunctiongetbaseLX(ByValidxAsInteger)AsInteger
得到要查找询列的坐标
Ifidx<
=-1ThenReturn-1
Ifidx>
=Basecalls.LengthThenReturn-1
PublicFunctiongetbaseY_cf(ByValidxAsInteger)AsInteger
得到该序列的置信度
transmute(A(x+1),imageHeight,scale)
DimbaseAsChar=sequence.Chars(idx)
DimYYAsInteger()
SelectCasebase
Case"
YY=A
lable="
YY=T
YY=C