当前位置: 首页>>代码示例>>Java>>正文


Java Peptide.getParentProteinsNoRemapping方法代码示例

本文整理汇总了Java中com.compomics.util.experiment.biology.Peptide.getParentProteinsNoRemapping方法的典型用法代码示例。如果您正苦于以下问题:Java Peptide.getParentProteinsNoRemapping方法的具体用法?Java Peptide.getParentProteinsNoRemapping怎么用?Java Peptide.getParentProteinsNoRemapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.compomics.util.experiment.biology.Peptide的用法示例。


在下文中一共展示了Peptide.getParentProteinsNoRemapping方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProteinMatchKey

import com.compomics.util.experiment.biology.Peptide; //导入方法依赖的package包/类
/**
 * Convenience method which returns the protein key of a peptide. Note:
 * proteins must be set for the peptide.
 *
 * @param peptide the considered peptide
 * @return the protein match key
 *
 * @throws IOException if an IOException occurs
 * @throws SQLException if an SQLException occurs
 * @throws ClassNotFoundException if a ClassNotFoundException occurs
 * @throws InterruptedException if an InterruptedException occurs
 */
public static String getProteinMatchKey(Peptide peptide) throws IOException, SQLException, ClassNotFoundException, InterruptedException {

    ArrayList<String> accessions = peptide.getParentProteinsNoRemapping();
    if (accessions == null) {
        throw new IllegalArgumentException("Proteins not set for peptide " + peptide.getKey() + ".");
    }
    HashSet<String> uniqueAccessions = new HashSet<String>(accessions);
    accessions = new ArrayList<String>(uniqueAccessions);
    Collections.sort(accessions);
    StringBuilder key = new StringBuilder(accessions.size() * 6);
    for (String accession : accessions) {
        if (key.length() > 0) {
            key.append(PROTEIN_KEY_SPLITTER);
        }
        key.append(accession);
    }
    return key.toString();
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:31,代码来源:ProteinMatch.java

示例2: ProteinMatch

import com.compomics.util.experiment.biology.Peptide; //导入方法依赖的package包/类
/**
 * Constructor for the protein match. Note: proteins must be set for the
 * peptide.
 *
 * @param peptide the corresponding peptide match
 * @param peptideMatchKey the key of the peptide match
 *
 * @throws IOException if an IOException occurs
 * @throws SQLException if an SQLException occurs
 * @throws ClassNotFoundException if a ClassNotFoundException occurs
 * @throws InterruptedException if an InterruptedException occurs
 */
public ProteinMatch(Peptide peptide, String peptideMatchKey) throws IOException, SQLException, ClassNotFoundException, InterruptedException {
    ArrayList<String> parentProteins = peptide.getParentProteinsNoRemapping();
    if (parentProteins == null || parentProteins.isEmpty()) {
        throw new IllegalArgumentException("Peptide " + peptide.getSequence() + " presents no parent protein.");
    }
    Collections.sort(parentProteins);
    for (String protein : parentProteins) {
        if (!theoreticProtein.contains(protein)) {
            theoreticProtein.add(protein);
        }
    }
    mainMatch = parentProteins.get(0);
    peptideMatchesKeys.add(peptideMatchKey);
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:27,代码来源:ProteinMatch.java

示例3: getProteinMatches

import com.compomics.util.experiment.biology.Peptide; //导入方法依赖的package包/类
/**
 * Returns the keys of the protein matches where a peptide can be found.
 * Note: proteins have to be set for the peptide.
 *
 * @param peptide the peptide of interest
 *
 * @return the keys of the protein matches
 *
 * @throws SQLException exception thrown whenever an error occurred while
 * loading the object from the database
 * @throws IOException exception thrown whenever an error occurred while
 * reading the object in the database
 * @throws ClassNotFoundException exception thrown whenever an error
 * occurred while casting the database input in the desired match class
 * @throws InterruptedException thrown whenever a threading issue occurred
 * while interacting with the database
 */
public HashSet<String> getProteinMatches(Peptide peptide) throws IOException, SQLException, ClassNotFoundException, InterruptedException {
    HashSet<String> proteinMatches = new HashSet<String>();
    if (peptide.getParentProteinsNoRemapping() == null) {
        throw new IllegalArgumentException("Proteins are not mapped for peptide " + peptide.getKey() + ".");
    }
    for (String accession : peptide.getParentProteinsNoRemapping()) {
        HashSet<String> keys = proteinMap.get(accession);
        if (keys != null) {
            for (String key : keys) {
                proteinMatches.add(key);
            }
        }
    }
    return proteinMatches;
}
 
开发者ID:compomics,项目名称:compomics-utilities,代码行数:33,代码来源:Identification.java


注:本文中的com.compomics.util.experiment.biology.Peptide.getParentProteinsNoRemapping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。