您好,欢迎光临本网站![请登录][注册会员]  
文件名称: 毕业设计(论文)中期汇报表
  所属分类: 其它
  开发工具:
  文件大小: 29kb
  下载次数: 0
  上传时间: 2013-03-06
  提 供 者: aym****
 详细说明: 计算机,DNA [removed] function pairaln(seq1, seq2){ // scoring scheme var MATCH = 1; // +1 for letters that match var MISMATCH = -1; // -1 for letters that mismatch var GAP = -1; // -1 for any gap // initialization var score=[[]]; var pointer=[[]]; score[0][0] = 0; pointer[0][0] = 0; var l1=seq1.length var l2=seq2.length for(var j = 1; j <= l1; j++) { score[0][j] = GAP * j; pointer[0][j] = 2; } for (var i = 1; i <= l2; i++) { score[i]=[]; pointer[i]=[]; score[i][0] = GAP * i; pointer[i][0] = 3; } // fill for(var i = 1; i <= l2; i++) { var letter2 = seq2.charAt(i-1); for(var j = 1; j <= l1; j++) { var diagonal_score, left_score, up_score; // calculate match score var letter1 = seq1.charAt(j-1); if (letter1 == letter2) { diagonal_score = score[i-1][j-1] + MATCH; } else { diagonal_score = score[i-1][j-1] + MISMATCH; } // calculate gap scores up_score = score[i-1][j] + GAP; left_score = score[i][j-1] + GAP; // choose best score if (diagonal_score >= up_score) { if (diagonal_score >= left_score) { score[i][j] = diagonal_score; pointer[i][j] = 1; } else { score[i][j] = left_score; pointer[i][j] = 2; } } else { if (up_score >= left_score) { score[i][j] = up_score; pointer[i][j] = 3; } else { score[i][j] = left_score; pointer[i][j] = 2; } } } } // trace-back var align1 = []; var align2 = []; // start at last cell of matrix var j = l1; var i = l2; while (1) { if(pointer[i][j] == 0)break // ends at first cell of matrix if (pointer[i][j] == 1) { align1[align1.length] = seq1.charAt(j-1); align2[align2.length] = seq2.charAt(i-1); i--; j--; } if (pointer[i][j] == 2) { align1[align1.length] = seq1.charAt(j-1); align2[align2.length] = "-"; j--; } if (pointer[i][j] == 3) { align1[align1.length] = "-"; align2[align2.length] = seq2.charAt(i-1); i--; } } align1 = align1.reverse(); align2 = align2.reverse(); return "序列:

"+seq1+"
"+seq2+"

比对结果:

"+align1.join("")+"
"+align2.join("")+"
" } [removed](pairaln('CTGGGCTGACTGA', 'GACTAGCTAGACTGA')) [removed]
如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:http://www.veryhuo.com/
...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: 毕业设计
 输入关键字,在本站1000多万海量源码库中尽情搜索: