本文整理汇总了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();
}
示例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);
}
示例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;
}