Template:JAS/MutationStat: Difference between revisions

(New page: {| class="wikitable" style="text-align:center" |+ The number of mutations <small>(E = exon; I = intron)</small> | {{#lua: function SortAndPrint(prefix, T) local idx = {} for k,v ...)
 
No edit summary
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
{| class="wikitable" style="text-align:center"
{{#def:list|{{#SearchLine:&&{{{1|LDLR}}}/|JASReference}}}}
<center>
{| class="wikitable" style="text-align:center;width:100%"
|+ The number of mutations <small>(E = exon; I = intron)</small>
|+ The number of mutations <small>(E = exon; I = intron)</small>
|
|
{{#lua:
{{#invoke:JAS|NumberOfMutations|{{#var:list}} }}
  function SortAndPrint(prefix, T)
|}
    local idx = {}
    for k,v in pairs(T) do
      table.insert(idx, k)
    end
    table.sort(idx)
    for i=1, #idx do
      print(prefix .. idx[i] .. "<br/>" .. T[idx[i]] .."\n{{#bar:}}")
    end
  end


  local exn = {}
{| class="wikitable" style="text-align:center;width:100%"
  local inn = {}
|+ The type of mutations
  local etc = {}
  local total =0
  for gene in stdin:gmatch("&&(%w+)\n") do
    total = total+1
    local n = tonumber(string.match(gene,"(%d+)"))
    if (string.match(gene,"exon")) then
      if (exn[n] == nil) then exn[n] = 1 else exn[n] = exn[n]+1 end
    elseif (string.match(gene,"intron")) then
      if (inn[n] == nil) then inn[n] = 1 else inn[n] = inn[n]+1 end
    else
      if (etc[gene] == nil) then etc[gene] = 1 else etc[gene] = etc[gene]+1 end
    end
  end
  SortAndPrint("E", exn)
  SortAndPrint("I", inn)
  SortAndPrint("", etc)
  print("Total<br/>" .. total)
|
|
{{#SearchLine:{{{1}}}/_%|JASReference}}
{{#invoke:JAS|TypeOfMutations|{{#var:list}}|{{{1|LDLR}}}}}
}}
|}
|}
</center>

Latest revision as of 02:34, 31 January 2023

The number of mutations (E = exon; I = intron)

E1
5

E2
10
E3
8
E4
22
E5
3
E6
3
E7
7
E8
9
E9
10
E10
3
E11
8
E12
4
E13
4
E14
8
E15
4
E16
4
E17
1
I10
1
I12
1
I15
1
Exon15
1
promoter
2
Total
119
The type of mutations

Single-nucleotide
mutation
75

Deletion
30
Insertion
10
Del&Ins
1
Duplication
5
Others
0
Total
121