没有合适的资源?快使用搜索试试~ 我知道了~
基因关联分析Gene_Asso算法代码(带标号).pdf
需积分: 0 0 下载量 129 浏览量
2024-04-17
14:19:04
上传
评论 1
收藏 139KB PDF 举报
温馨提示
试读
5页
基因关联分析Gene_Asso算法代码(带标号).pdf
资源推荐
资源详情
资源评论
1
基因关联分析 Gene_Asso 算法代码
1 package Gene_Asso;
2 import java.io.*;
3 import java.util.*;
4 import weka.core.converters.ConverterUtils.DataSource;
5 import weka.core.converters.ConverterUtils.DataSink;
6 import weka.core.*;
7 public class Main {
8 public static void main (String [] args) throws Exception {
9 Instances datas=DataSource.read("D:/example1/example1.arff");
10 int n2=datas.numAttributes();
11 int n=datas.size();
12 int minsup=2;
13 ArrayList<int[]> transactionDatas0;
14 AlgoAsso_Bitset geneAsso=new AlgoAsso_Bitset();
15 Main demo=new Main();
16 transactionDatas0=demo.readRDBMSData(datas);
17 geneAsso.runAlgorithm(transactionDatas0,minsup,n2,n);
18 demo.output();
19 }
20 public ArrayList<int[]> readRDBMSData(Instances datas) {
21 Instance temp;
22 int n=datas.size();
23 int n2=datas.numAttributes();
24 ArrayList<int[]> transactionDatas0=new ArrayList<>();
25 System.out.println("将样本基因表达值排序后输出:");
26 for (int i=0;i<n;i++) {
27 double[] newRecord=new double[n2];
28 double[] colArr1=new double[n2];
29 int[] colArr2=new int[n2];
30 temp=datas.instance(i);
31 for(int j=0;j<n2;j++) {
32 newRecord[j]=temp.value(j);
33 }
34 for(int j=0;j<n2;j++) {
35 colArr1[j]=newRecord[j];
36 }
37 Arrays.sort(colArr1);
38 for(int z=0;z<n2;z++) {
39 if(z>=n2-z-1) break;
40 double t=colArr1[z];
41 colArr1[z]=colArr1[n2-z-1];
42 colArr1[n2-z-1]=t;
资源评论
卋罖658
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功