生物信息 生物数据到网格图分析

1 首先对生物序列进行blast比对:得出网格图分析的点和边两部分。
第一:首先用blast用序列对fasta数据建库,建库中会产生,phr结尾的数据库文件

D:\blast1\bin>formatdb -i D:\blast1\fasta\T3SE_All_check.fasta -o T -p T

第二:用blastall命令对程序进行比对,保留生成的比对结果,把结果保留到文件中。

D:\blast1\bin>blastall -i D:\blast1\fasta\T6SE_All_check.fasta -p blastp -d D:\blast1\fasta\T6SE_All_check.fasta -m 8 -e 0.001 -o T6se.txt

2 这里采取的是点是用数据库的fastahead头信息所以保证fasta文件中的头信息与数据库中的头信息保持一致也是很重要的。
代码部分:
StatisticsController

 @RequestMapping("/gettestjsondata6")
    public BastionResponse getJsonData6() throws IOException, JSONException {
        HashMap output = new HashMap();
        //read edges from csv
        List edgeList = new ArrayList();
        BufferedReader br;
        br = new BufferedReader(new FileReader("C:\\Users\\hy\\Desktop\\blast\\T6se.txt"));
        String stemp;
        while ((stemp = br.readLine()) != null) {
            HashMap jsonObject = new HashMap();
            stemp = stemp.toLowerCase(); //读取的序列信息统一调整为小写

            String[] list = stemp.split("\t");  //按照文件序列中的空格符作为切割,分别把数据存放到列表中。
            //String[] list = stemp.split(",");
            jsonObject.put("source", list[0]);//把取到的第一个信息,也就是头赋值给source
            jsonObject.put("target", list[1]);
            jsonObject.put("value", list[2]);
            HashMap dataJsonObject = new HashMap();//初始化一个hashmap存储,然后存储
            dataJsonObject.put("data", jsonObject); //
            edgeList.add(dataJsonObject);  //把边放入
        }

        output.put("edges", edgeList);
        //read nodes from database;
        List nodesList = new ArrayList();
        List<Protein> proteins = proteinService.getProteinNodesByType("T6SE");//这里有问题 是因为在T6se的数据库中存在一条序列的fastahead为空,这里
        //利用下面的在数据库中查找的头信息存储到链表中,实现了从数据库中获取的头信息
        for (int i=0;i<proteins.size();i++){ //然后是遍历 
            String originalHead = proteins.get(i).getFastaHead();    //
            originalHead = originalHead.toLowerCase();
            String[] Heads = originalHead.split(" ");//头信息用空格分割
            String matchHead = Heads[0];
            
            Integer proteinID = proteins.get(i).getProteinID();//直接重新定义一份从数据库中获得蛋白质ID,然后把id从数据库中取出来,和取头信息的方法大同小异
            String url = "http://localhost:8080/searchresults/showdetail?id=" + proteinID.toString();

            HashMap nodeMap = new HashMap();
            nodeMap.put("id",matchHead);//对应的头信息和url匹配,把这两个放入到hashmap中进行匹配
            nodeMap.put("href",url);

            HashMap nodeDataMap = new HashMap();
            nodeDataMap.put("data",nodeMap);
            nodesList.add(nodeDataMap);
        }
        output.put("nodes", nodesList);

        return new BastionResponse().data(output);//把output结果放入到data中然后传送到前台js中
    }

在ProteinService中定义一个

    List<Protein> getProteinNodesByType(String type);//获得蛋白质的分泌类型

去定义需要从数据库中获取一个目的字段的信息

然后在ProteinSeriveImpl中去具体实现查询的过程

@Override
    public List<Protein> getProteinNodesByType(String type) {
        return proteinMapper.selectList(new QueryWrapper<Protein>().like("flagType", type));//在数据库中选择分泌种类
    }

转载cytoscape:https://blog.csdn.net/cuishizun/article/details/82710493?tdsourcetag=s_pctim_aiomsg

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值