Personal tools

Template:DRAAccessionNumbers: Difference between revisions

From FANTOM5_SSTAR

Jump to: navigation, search
No edit summary
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<html>
{{#vardefine:DRA_sample_accession_content|{{{2}}}}}{{#vardefine:accession_numbers_content|{{{3}}}}}{{#vardefine:library_ids_content|{{{4}}}}}{{#arraydefine:DRA_sample_accession_array|{{#var:DRA_sample_accession_content}}|!}}{{#arraydefine:accession_numbers_array|{{#var:accession_numbers_content}}|!}}{{#arraydefine:library_ids_array|{{#var:library_ids_content}}|!}}{{#arraymerge:new_key |accession_numbers_array |library_ids_array}}{{#arraydefine:headers|Library id,Method,Exp. accession id,Run accession id|;}}{{#arraydefine:headers_sample_access_numbers|Method,Sample accession id|;}}{{#arraydefine:y-1|}}{{#arraydefine:k-1|}}{{#vardefine:e-1|}}{{#vardefine:t-1|}}{{#vardefine:header_species1|{{#switch: {{{5}}} | Human (Homo sapiens) = Hg19 | Mouse (Mus musculus) = Mm9 }}}}{{#vardefine:header_species2|{{#switch: {{{5}}} | Human (Homo sapiens) = Hg38 | Mouse (Mus musculus) = Mm10 }}}}{{#loop: k
<script type="text/javascript">
  | 0          
 
  | {{#arraysize:accession_numbers_array}}
var sReturn ="";
  | <nowiki/>
var m_data = new Array();
{{#arraydefine:tmp{{#var:k}}|{{#arrayindex:accession_numbers_array |{{#var:k}}}}}}{{#arraydefine:tmp_{{#var:k}}|{{#arrayprint:tmp{{#var:k}}}}|;}}{{#loop: m
var sample_accession_number ="";
  | 0         
var library_ids = "";
  | {{#arraysize:tmp_{{#var:k}}}}
 
  | <nowiki/>
$(document).ready(function() {
{{#switch: {{#var:m}}| 1 ={{#vardefine:link|sra-experiment}}|2={{#vardefine:link|sra-run}}|{{#vardefine:link|}} }}{{#vardefine:tmpe|{{#arrayindex:tmp_{{#var:k}}|{{#var:m}} }} }}{{#arraydefine:cont|{{#var:tmpe}}|,}}{{#ifexpr: {{#arraysize:cont}} > 1 |{{#loop: t
library_ids = "</html>{{{3}}}<html>";
  | 0         
sample_accession_number = "</html>{{{1}}}<html>";
  | {{#arraysize:cont}}
var accession_numbers  = "</html>{{{2}}}<html>";
  | <nowiki/>
 
  {{#vardefine:tmpinternal|{{#arrayindex:cont|{{#var:t}} }} }}
var sub_libraries = library_ids.split("!");
   {{#arraydefine:tmp__internal{{#var:t}}|{{#switch: {{#var:m}}| 1 = [https://ddbj.nig.ac.jp/resource/{{#var:link}}/{{#var:tmpinternal}} {{#var:tmpinternal}}]<br> | 2 = [https://ddbj.nig.ac.jp/resource/{{#var:link}}/{{#var:tmpinternal}} {{#var:tmpinternal}}]<br> | {{#var:tmpinternal}}<br>}} }}
 
  {{#arraymerge:t{{#var:t}}|t{{#expr:{{#var:t}}-1}}|tmp__internal{{#var:t}} }}
var accession_numbers_content = accession_numbers.split("!");
  {{#vardefine:out|{{#arrayprint:t{{#var:t}}| }} }}
 
}} <!--end of loop t -->
if(accession_numbers_content.length>1 ){
{{#arraydefine:out_without_delimiter|{{#var:out}}}}
 
{{#arraydefine:tmp__{{#var:m}}|{{#arrayprint:out_without_delimiter}} }}
}
|
else{
{{#arraydefine:tmp__{{#var:m}}|{{#switch: {{#var:m}}| 1 = [https://ddbj.nig.ac.jp/resource/{{#var:link}}/{{#var:tmpe}} {{#var:tmpe}}] | 2 = [https://ddbj.nig.ac.jp/resource/{{#var:link}}/{{#var:tmpe}} {{#var:tmpe}}] | {{#var:tmpe}}}}  }}  }}
{{#arraymerge:y{{#var:m}}|y{{#expr:{{#var:m}}-1}}|tmp__{{#var:m}} }}
}
}}<!--end of loop m -->
for(i=0;i<accession_numbers_content.length;i++){
{{#arraymerge:k{{#var:k}}|k{{#expr:{{#var:k}}-1}}|y{{#var:m}} }}
tmp =new Array();
{{#vardefine:e{{#var:k}}|{{#var:e{{#expr:{{#var:k}}-1}}}}!{{#arrayprint:y{{#var:m}}|;}}}}
tmp.push(sub_libraries[i]);
}}
var row = accession_numbers_content[i];
{{#arraydefine:kekka|{{#sub:{{#var:e{{#var:k}}}}|1|{{#len:{{#var:e{{#var:k}}}} }} }}|!}}
var columns = row.split(";");
{|class="wikitable  mw-outercollapse mw-collapsible mw-collapsed"  
for(j=0;j<columns.length;j++){
!{{{1}}} Accession numbers
 
|-
tmp.push(columns[j]);
|<table cellspacing="0" border="1"><tr><th>{{#replace:{{#arrayprint:headers_sample_access_numbers}}|,|</th><th></th><th>}}</tr>{{#loop: j
}
  | 0          
m_data.push(tmp);
  | {{#arraysize:DRA_sample_accession_array}}
}
   | <nowiki/>
 
{{#vardefine:EXPMETHOD|{{#explode:{{#arrayindex:DRA_sample_accession_array| {{#var:j}} }}|@|0}} }}{{#vardefine:EXPMETHOD_URLed|{{#if:{{#var:EXPMETHOD}}|'''{{#var:EXPMETHOD}}'''<html>&nbsp;</html>|}}{{#vardefine:LIBID|{{#explode:{{#arrayindex:DRA_sample_accession_array| {{#var:j}} }}|@|1}} }}}}{{#vardefine:LIBID_URLed|{{#if:{{#var:LIBID}}|[https://ddbj.nig.ac.jp/resource/biosample/{{#var:LIBID}} [[Sample accession::{{#var:LIBID}}]]]|}}}}
motif_table = $('#example').dataTable({              
<tr><td>{{#var:EXPMETHOD_URLed}}<td> <td>{{#var:LIBID_URLed}}</td><tr>
"sScrollY": "500px",
}} </table>
"bScrollCollapse": true,
{|class="wikitable mw-collapsible mw-innercollapse" style="width:auto"  
"bPaginate": true,
!Library accession numbers
"bFilter": true,
|-
"bInfo": true,
|<table cellspacing="0" border="1"><tr><th>{{#replace:{{#arrayprint:headers}}|,|</th><th></th><th>}}</tr>
                "aLengthMenu": [[5,-1], [5,"All"]],
{{#loop: j
                "aaData": m_data,
   | 0          
"aoColumnDefs":[
  | {{#arraysize:kekka}}
{"aTargets":[0],"sTitle": "Library ID","fnRender": function ( obj ) {
  | <nowiki/>
                  return obj.aData[ obj.iDataColumn ];}},
{{#vardefine:tmp_acc_num|{{#arrayindex:kekka |{{#var:j}}}}}}{{#arraydefine:tmp_acc_num_arry|{{#var:tmp_acc_num}}|;}}{{#arrayslice:first_slice_tmp_acc_num_arry|tmp_acc_num_arry|0|1}}{{#arrayslice:second_slice_tmp_acc_num_arry|tmp_acc_num_arry|1|2}}{{#vardefine:tmp_lib_id |{{#arrayindex:library_ids_array|{{#var:j}}}}}}{{#arraydefine:tmp_lib_id_arry|{{#var:tmp_lib_id}}}}{{#arraymerge:x{{#var:j}}|tmp_lib_id_arry|first_slice_tmp_acc_num_arry |second_slice_tmp_acc_num_arry}}<tr><td>{{#replace:{{#arrayprint:x{{#var:j}}}}|,|</td><td></td><td>}}</tr>
{"aTargets":[2],"sTitle": "Experiment Accession ID", "fnRender": function ( obj ) {
}}
              var temp="";
</table>
var col = obj.aData[ obj.iDataColumn];
<!-- bam&ctss accession ID table (Hg19 Mm9) -->
var colll= col.toString();
{|class="wikitable mw-collapsible mw-innercollapse" style="width:auto"  
var cols =colll.split(",");
!Accession ID {{#var:header_species1}}
if(cols.length>0)
|-
{
|<table cellspacing="0" border="1"><tr><th>Library id</th><th></th><th>BAM</th><th></th><th>CTSS</th></tr>
   for(i=0;i<cols.length;i++){
{{#loop: p
      temp = temp +'<a href=http://trace.ddbj.nig.ac.jp/DRASearch/experiment?acc='+cols[i]+'>'+cols[i]+'</a>'+"  ";
  | 0         
  }
  | {{#arraysize:kekka}}
}else{
  | <nowiki/>
temp ='<a href=http://trace.ddbj.nig.ac.jp/DRASearch/experiment?acc='+cols[i]+'>'+cols[i]+'</a>';
{{#vardefine:tmp_acc_num|{{#arrayindex:kekka |{{#var:p}}}}}}{{#arraydefine:tmp_acc_num_arry|{{#var:tmp_acc_num}}|;}}{{#arrayslice:first_acc_num_arry|tmp_acc_num_arry|3|2}}{{#vardefine:tmp_lib_id |{{#arrayindex:library_ids_array|{{#var:p}}}}}}{{#arraydefine:tmp_lib_id_arry|{{#var:tmp_lib_id}}}}{{#arraymerge:x{{#var:p}}|tmp_lib_id_arry|first_acc_num_arry}}<tr><td>{{#replace:{{#arrayprint:x{{#var:p}}}}|,|</td><td></td><td>}}</tr>
}
}}
              return temp;}},
</table>
 
|}
{"aTargets":[3],"sTitle": "Run Accession ID","fnRender": function ( obj ) {
<!-- end of bam&ctss accession ID table -->
var temp="";
<!-- bam&ctss accession ID table (Hg38 Mm10) -->
var col = obj.aData[ obj.iDataColumn ];
{{#vardefine:kekka_firstline|{{#arrayindex:kekka|0}}}}{{#arraydefine:kekka_firstarry|{{#var:kekka_firstline}}|;}}{{#vardefine:disp|{{#if:{{#arrayindex:kekka_firstarry|5}}||display:none}}}}{|class="wikitable mw-collapsible mw-innercollapse" style="width:auto;{{#var:disp}}"  
var colll= col.toString();
!Accession ID {{#var:header_species2}}
var cols =colll.split(",");
|-
if(cols.length>0)
|<table cellspacing="0" border="1"><tr><th>Library id</th><th></th><th>BAM</th><th></th><th>CTSS</th></tr>
{
{{#loop: q
  for(i=0;i<cols.length;i++){
  | 0         
      temp = temp +'<a href=http://trace.ddbj.nig.ac.jp/DRASearch/run?acc='+cols[i]+'>'+cols[i]+'</a>'+"  ";
  | {{#arraysize:kekka}}
  }
  | <nowiki/>
}else{
{{#vardefine:tmp_acc_num|{{#arrayindex:kekka |{{#var:q}}}}}}{{#arraydefine:tmp_acc_num_arry|{{#var:tmp_acc_num}}|;}}{{#arrayslice:second_acc_num_arry|tmp_acc_num_arry|5|2}}{{#vardefine:tmp_lib_id |{{#arrayindex:library_ids_array|{{#var:q}}}}}}{{#arraydefine:tmp_lib_id_arry|{{#var:tmp_lib_id}}}}{{#arraymerge:x{{#var:q}}|tmp_lib_id_arry|second_acc_num_arry}}<tr><td>{{#replace:{{#arrayprint:x{{#var:q}}}}|,|</td><td></td><td>}}</tr>
temp ='<a href=http://trace.ddbj.nig.ac.jp/DRASearch/run?acc='+cols[i]+'>'+cols[i]+'</a>';
}}
}
</table>
              return temp;}},
|}
{"aTargets":[4],"sTitle": "Run Bam Accession ID","fnRender": function ( obj ) {
<!-- end of bam&ctss accession ID table -->
                var temp="";
|}
var col = obj.aData[ obj.iDataColumn ];
|}
var colll= col.toString();
var cols =colll.split(",");
if(cols.length>0)
{
   for(i=0;i<cols.length;i++){
      temp = temp +" "+cols[i];
  }
}else{
temp =cols[i];
}
              return temp;}},
{"aTargets":[5],"sTitle": "Run Ctss Accession ID","fnRender": function ( obj ) {
                var temp="";
var col = obj.aData[ obj.iDataColumn ];
var colll= col.toString();
var cols =colll.split(",");
if(cols.length>0)
{
   for(i=0;i<cols.length;i++){
      temp = temp +" "+cols[i];
  }
}else{
temp =cols[i];
}
              return temp;}},
{"aTargets":[1],"sTitle": "Method","fnRender": function ( obj ) {
                return obj.aData[ obj.iDataColumn ];}}
],
"aaSorting": [[ 0, "asc" ]],
 
});
});
</script>
</html>
* Library Accession Numbers  <br><br>
<includeonly> <table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table></includeonly>

Latest revision as of 13:46, 4 April 2022

{{{1}}} Accession numbers
MethodSample accession id
{{{2}}} 
Library accession numbers

Library idMethodExp. accession idRun accession id
{{{4}}} {{{3}}}
Accession ID

Library idBAMCTSS
{{{4}}}