Bioinformatics/Subsequence: Difference between revisions
Content added Content deleted
(→{{header|Ring}}: video link is private) |
|||
Line 315: | Line 315: | ||
=={{header|Ring}}== |
=={{header|Ring}}== |
||
{{improve|Ring|video link is private}} |
|||
<lang ring> |
<lang ring> |
||
/*----------------------------------- |
/*----------------------------------- |
||
Line 327: | Line 326: | ||
load "guilib.ring" |
load "guilib.ring" |
||
start = 0 |
|||
base = ["A","C","G","T"] |
base = ["A","C","G","T"] |
||
dnaList = [] |
dnaList = [] |
||
Line 335: | Line 335: | ||
C_ButtonDnaStyle = ' background-color: Red; border-radius: 8px;' |
C_ButtonDnaStyle = ' background-color: Red; border-radius: 8px;' |
||
C_ButtonStyle = '"background-color:white"; border-radius: 8px;' |
|||
Button = newlist(10,20) |
Button = newlist(10,20) |
||
LayoutButtonRow = list(10) |
LayoutButtonRow = list(10) |
||
Line 353: | Line 353: | ||
LayoutButtonMain.setSpacing(C_Spacing) |
LayoutButtonMain.setSpacing(C_Spacing) |
||
LayoutButtonMain.setContentsmargins(0,0,0,0) |
LayoutButtonMain.setContentsmargins(0,0,0,0) |
||
⚫ | |||
LabelFind = new qLabel(win) { settext(" DNA subsequence to find:") |
|||
setStyleSheet("background-color:yellow") } |
|||
ButtonFind = new QPushButton(win) |
|||
DnaSearch = new QPushButton(win) { setclickevent("pstart()") |
|||
setStyleSheet("background-color:yellow") |
|||
settext("Find") |
|||
} |
|||
ButtonFind = new QPushButton(win) |
|||
for Col = 1 to 21 |
for Col = 1 to 21 |
||
ColLine[Col] = new qLabel(win) { |
ColLine[Col] = new qLabel(win) { |
||
Line 378: | Line 389: | ||
Letter = " " + Row*20 |
Letter = " " + Row*20 |
||
ok |
ok |
||
RowLine[Row] = new qLabel(win) { |
RowLine[Row] = new qLabel(win) { setFont(new qFont("Verdana",fontSize,40,0)) |
||
setAlignment(Qt_AlignHCenter | Qt_AlignVCenter) |
setAlignment(Qt_AlignHCenter | Qt_AlignVCenter) |
||
setStyleSheet("background-color:darkgray") |
setStyleSheet("background-color:darkgray") |
||
Line 406: | Line 417: | ||
LayoutDataRow = new QHBoxLayout() { setSpacing(C_Spacing) setContentsMargins(0,0,0,0) } |
LayoutDataRow = new QHBoxLayout() { setSpacing(C_Spacing) setContentsMargins(0,0,0,0) } |
||
⚫ | |||
LayoutDataRow.AddWidget(LabelFind) |
|||
LayoutDataRow.AddWidget(ButtonFind) |
|||
LayoutDataRow.AddWidget(DnaSearch) |
|||
LayoutButtonMain.AddLayout(LayoutDataRow) |
|||
setLayout(LayoutButtonMain) |
setLayout(LayoutButtonMain) |
||
Line 420: | Line 434: | ||
func pStart() |
func pStart() |
||
start = start + 1 |
|||
⚫ | |||
⚫ | |||
for col = 1 to 20 |
|||
Button[row][col].settext("") |
|||
⚫ | |||
next |
|||
for nr = 1 to 200 |
for nr = 1 to 200 |
||
rnd = random(3)+1 |
rnd = random(3)+1 |
||
Line 431: | Line 453: | ||
add(dnaList,baseStr) |
add(dnaList,baseStr) |
||
next |
next |
||
startDna() |
startDna() |
||
Line 452: | Line 475: | ||
end |
end |
||
showDna(dnaList) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
see nl |
|||
⚫ | |||
for m = 0 to 3 |
for m = 0 to 3 |
||
ind = dnaSeq[n] + m |
|||
row = ceil(ind/20) |
|||
col = ind%20 |
|||
if col = 0 |
|||
⚫ | |||
ok |
ok |
||
Button[row][col].setstylesheet(C_ButtonStyle) |
|||
next |
next |
||
⚫ | |||
⚫ | |||
⚫ | |||
//see "" + n + " " |
|||
ok*/ |
|||
next |
next |
||
ok |
|||
⚫ | |||
⚫ | |||
dnaSeq = [] |
|||
strDna = list2str(dnaList) |
strDna = list2str(dnaList) |
||
strDna = substr(strDna,nl,"") |
strDna = substr(strDna,nl,"") |
||
Line 488: | Line 513: | ||
ok |
ok |
||
end |
end |
||
ButtonFind.setStyleSheet("background-color:yellow") |
|||
ButtonFind.settext(strBase) |
|||
for n = 1 to 196 |
for n = 1 to 196 |
||
Line 499: | Line 527: | ||
if flag = 1 |
if flag = 1 |
||
add(dnaSeq,n) |
add(dnaSeq,n) |
||
⚫ | |||
see "" + n + " " |
|||
ok |
ok |
||
next |
next |
||
Line 517: | Line 543: | ||
next |
next |
||
ok |
ok |
||
next |
next |
||
//----------------------------------------- |
//----------------------------------------- |
||
</lang> |
</lang> |
||
[https://youtu.be/ |
[https://youtu.be/R0zhpT0h2vU Bioinformatics/Subsequence - video] |
||
=={{header|Wren}}== |
=={{header|Wren}}== |