【问题标题】:how can i choose multiple chains as a structure object for structural alignment in biojava如何在 biojava 中选择多个链作为结构对象进行结构对齐
【发布时间】:2014-10-02 21:06:15
【问题描述】:

我正在尝试使用 BioJava 库进行结构对齐。我想从一个结构对象中一个接一个地挑选一些链并将它们添加到另一个结构对象中,这样我就可以对它们进行结构对齐,但我还不知道怎么做。到目前为止我写的代码如下,但它给出了空指针异常(可能是因为new_structure 设置为空)。我还能尝试什么?

 private static Structure prepareStructures(String structure_name, AtomCache cache){

    Structure structure = null;
    Structure new_structure = null;
    String[] pdbnchain;
    try{
        pdbnchain = structure_name.split("\\.");
        structure = cache.getStructure(pdbnchain[0]);
        for(int i = 0; i < pdbnchain[1].length(); i++){
            String letter = pdbnchain[1].charAt(i)+"";
            new_structure.addChain(structure.getChainByPDB(letter));
        }
    } catch(Exception ex){
        ex.printStackTrace();
    }
    return new_structure;
}

【问题讨论】:

    标签: java biojava


    【解决方案1】:

    你可以使用:

    Structure new_structure = structure.clone();
    

    获得结构的相同副本。然后您将在 new_structure 中拥有所有第一个结构的链。

    也许你应该这样做:

    structure = cache.getStructure(pdbnchain[0]);
    new_structure = structure.clone();
    

    具有非空值。 请参考this 文档。

    你也可以试试:

    Structure new_structure = new StructureImpl(); // StructureImpl implements Structure interface.
    

    【讨论】:

    • 但我不想拥有所有的链条,这就是问题所在。我想要一些锁链。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-09
    • 2012-07-17
    • 1970-01-01
    • 2019-02-08
    • 2017-12-05
    • 2014-02-19
    相关资源
    最近更新 更多