Personal tools

Template:DRAAccessionNumbers: Difference between revisions

From FANTOM5_SSTAR

Jump to: navigation, search
No edit summary
mNo edit summary
Line 1: Line 1:
<html>
{{#vardefine:DRA_sample_accession_content|{{{1}}}}}{{#vardefine:accession_numbers_content|{{{2}}}}}{{#vardefine:library_ids_content|{{{3}}}}}{{#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,BAM accession id,CTSS accession id|;}}
<script type="text/javascript">
{{#arraydefine:headers_sample_access_numbers|Method,Sample accession id|;}}{{#arraydefine:y-1|}}{{#arraydefine:k-1|}}{{#vardefine:e-1|}}{{#vardefine:t-1|}}{{#loop: k
  | 0         
  | {{#arraysize:accession_numbers_array}}
  | <nowiki/>
{{#arraydefine:tmp{{#var:k}}|{{#arrayindex:accession_numbers_array |{{#var:k}}}}}}{{#arraydefine:tmp_{{#var:k}}|{{#arrayprint:tmp{{#var:k}}}}|;}}
{{#loop: m
  | 0         
  | {{#arraysize:tmp_{{#var:k}}}}
  | <nowiki/>
{{#switch: {{#var:m}}| 1 ={{#vardefine:link|experiment}}|2={{#vardefine:link|run}}|{{#vardefine:link|}} }}{{#vardefine:tmpe|{{#arrayindex:tmp_{{#var:k}}|{{#var:m}} }} }}{{#arraydefine:cont|{{#var:tmpe}}|,}}{{#ifexpr: {{#arraysize:cont}} > 1 |{{#loop: t
  | 0         
  | {{#arraysize:cont}}
  | <nowiki/>
  {{#vardefine:tmpinternal|{{#arrayindex:cont|{{#var:t}} }} }}
  {{#arraydefine:tmp__internal{{#var:t}}|{{#switch: {{#var:m}}| 1 = [http://trace.ddbj.nig.ac.jp/DRASearch/{{#var:link}}?acc={{#var:tmpinternal}} {{#var:tmpinternal}}]<br> | 2 = [http://trace.ddbj.nig.ac.jp/DRASearch/{{#var:link}}?acc={{#var:tmpinternal}} {{#var:tmpinternal}}]<br> | {{#var:tmpinternal}}<br>}} }}
  {{#arraymerge:t{{#var:t}}|t{{#expr:{{#var:t}}-1}}|tmp__internal{{#var:t}} }}
  {{#vardefine:out|{{#arrayprint:t{{#var:t}}| }} }}
}} <!--end of loop t -->
{{#arraydefine:out_without_delimiter|{{#var:out}}}}
{{#arraydefine:tmp__{{#var:m}}|{{#arrayprint:out_without_delimiter}} }}
|
{{#arraydefine:tmp__{{#var:m}}|{{#switch: {{#var:m}}| 1 = [http://trace.ddbj.nig.ac.jp/DRASearch/{{#var:link}}?acc={{#var:tmpe}} {{#var:tmpe}}] | 2 = [http://trace.ddbj.nig.ac.jp/DRASearch/{{#var:link}}?acc={{#var:tmpe}} {{#var:tmpe}}] | {{#var:tmpe}}}}  }}  }}
{{#arraymerge:y{{#var:m}}|y{{#expr:{{#var:m}}-1}}|tmp__{{#var:m}} }}
}}<!--end of loop m -->
{{#arraymerge:k{{#var:k}}|k{{#expr:{{#var:k}}-1}}|y{{#var:m}} }}
{{#vardefine:e{{#var:k}}|{{#var:e{{#expr:{{#var:k}}-1}}}}!{{#arrayprint:y{{#var:m}}|;}}}}
}}
{{#arraydefine:kekka|{{#sub:{{#var:e{{#var:k}}}}|1|{{#len:{{#var:e{{#var:k}}}} }} }}|!}}
{|class="wikitable  mw-outercollapse mw-collapsible mw-collapsed"
!Accession numbers
|-
|<table cellspacing="0" border="1"><tr><th>{{#replace:{{#arrayprint:headers_sample_access_numbers}}|,|</th><th></th><th>}}</tr>{{#loop: j
  | 0         
  | {{#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}}|[http://trace.ddbj.nig.ac.jp/DRASearch/sample?acc={{#var:LIBID}} [[Sample accession::{{#var:LIBID}}]]]|}}}}
<tr><td>{{#var:EXPMETHOD_URLed}}<td> <td>{{#var:LIBID_URLed}}</td><tr>
}} </table>


var sReturn ="";
{|class="wikitable mw-collapsible mw-innercollapse" style="width:auto"  
var m_data = new Array();
!Library accession numbers
var sample_accession_number ="";
|-
var library_ids = "";
|<table cellspacing="0" border="1"><tr><th>{{#replace:{{#arrayprint:headers}}|,|</th><th></th><th>}}</tr>
 
{{#loop: j
$(document).ready(function() {
  | 0         
library_ids = "</html>{{{3}}}<html>";
  | {{#arraysize:kekka}}
sample_accession_number = "</html>{{{1}}}<html>";
  | <nowiki/>
var accession_numbers  = "</html>{{{2}}}<html>";
{{#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|{{#arraysize:tmp_acc_num_arry}}}}{{#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>
 
}}
var sub_libraries = library_ids.split("!");
</table>
 
|}
var accession_numbers_content = accession_numbers.split("!");
|}
 
<br>
if(accession_numbers_content.length>1 ){
 
}
else{
}
for(i=0;i<accession_numbers_content.length;i++){
tmp =new Array();
tmp.push(sub_libraries[i]);
var row = accession_numbers_content[i];
var columns = row.split(";");
for(j=0;j<columns.length;j++){
 
tmp.push(columns[j]);
}
m_data.push(tmp);
}
 
motif_table = $('#example').dataTable({              
"sScrollY": "500px",
"bScrollCollapse": true,
"bPaginate": true,
"bFilter": true,
"bInfo": true,
                "aLengthMenu": [[5,-1], [5,"All"]],
                "aaData": m_data,
"aoColumnDefs":[
{"aTargets":[0],"sTitle": "Library ID","fnRender": function ( obj ) {
                  return obj.aData[ obj.iDataColumn ];}},
{"aTargets":[2],"sTitle": "Experiment 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 +'<a href=http://trace.ddbj.nig.ac.jp/DRASearch/experiment?acc='+cols[i]+'>'+cols[i]+'</a>'+"  ";
  }
}else{
temp ='<a href=http://trace.ddbj.nig.ac.jp/DRASearch/experiment?acc='+cols[i]+'>'+cols[i]+'</a>';
}
              return temp;}},
 
{"aTargets":[3],"sTitle": "Run 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 +'<a href=http://trace.ddbj.nig.ac.jp/DRASearch/run?acc='+cols[i]+'>'+cols[i]+'</a>'+"  ";
  }
}else{
temp ='<a href=http://trace.ddbj.nig.ac.jp/DRASearch/run?acc='+cols[i]+'>'+cols[i]+'</a>';
}
              return temp;}},
{"aTargets":[4],"sTitle": "Run Bam 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":[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>

Revision as of 10:40, 4 February 2014

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

Library idMethodExp. accession idRun accession idBAM accession idCTSS accession id
{{{3}}} {{{2}}}