**文書の過去の版を表示しています。**
全体概要図
メールアドレスをサーバに送信
- FileReaderが非同期的にファイルを読み込むため、http://gakki-uec15.hatenablog.com/entry/2019/09/19/234833を参考に、ファイル読み込みを同期的に行うようにした。
- email入力欄を作成、入力した項目はサーバに送信
index.pug
.container h1 #{title} p this is #{title} p Upload your fasta file below form(action="./upload" method="POST" enctype="multipart/form-data") input(type="file" name="file" id="inputfile") input(type="text" id="email") button(type="button" onclick="file_upload()" value="Upload") script. var slice_size = 100 * 1024 * 1024; var files; var file; var slice_file; var reader = new FileReader(); var content; var sendData = {}; function file_upload() { var slice_file = $("#inputfile")[0].files[0].slice(0,slice_size); reader.readAsText(slice_file); reader.onload = function() { content = reader.result; console.log(content); sendData.fileContent = content; sendData.email = $("#email")[0].value; $.ajax({ type: "POST", url: "./upload/", data: sendData, dataType: "json", }) .done(function(res){ console.log("success"); }) .fail(function(res){ console.log("falied"); }); } }
NCBI SRAのサイトからサンプルや実験手法が分かるデータを抽出
Study
curl https://www.ncbi.nlm.nih.gov/sra/?term=DRR000002 |grep "Study" |awk '{print substr($0, index($0, "Study:"))}'|awk '{print substr($0, 1, index($0, "<div")-1)}' | sed -e 's/Study: <span>//'
Sample
curl https://www.ncbi.nlm.nih.gov/sra/?term=DRR000089 |grep "Sample" |awk '{print substr($0, index($0, "Sample:"))}' |awk '{print substr($0, 1, index($0, "<div")-1)}'| sed -e 's/Sample: <span>//'