當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。