protected List<String> getProteinAccessions(Protein protein) { Set<ProteinXref> crossReferences = protein.getCrossReferences(); List<String> proteinXRefs = new ArrayList<>(crossReferences.size()); for (ProteinXref crossReference : crossReferences) { proteinXRefs.add(crossReference.getIdentifier()); } return proteinXRefs; }
private static ProteinXref stripUniqueIdentifierAndTrimForProteinSeqDefault(String id) { if (id == null || id.isEmpty()) { throw new IllegalStateException("Found an identifier in a fasta file which is null or empty???"); } else { id = id.trim(); Matcher matcher = DEFLINE_ID_PATTERN.matcher(id); if (matcher.find()) { return new ProteinXref(null, matcher.group(1), id, matcher.group(2)); } else { return new ProteinXref(null, id, id); } } }
/** * Adds and returns cross-reference * * @param ProteinXref Cross-reference to add * @return Cross-reference * @throws IllegalArgumentException if ProteinXref is null */ public ProteinXref addCrossReference(ProteinXref ProteinXref) throws IllegalArgumentException { if (ProteinXref == null) { throw new IllegalArgumentException("'ProteinXref' must not be null"); } crossReferences.add(ProteinXref); ProteinXref.setProtein(this); return ProteinXref; }
for (ProteinXref xref : proteinXrefs) { counter++; xref.setIdentifier(xref.getIdentifier() + "_" + counter); updates.add(xref);
"getCrossReferences: " + (System.currentTimeMillis() - startPersistProtein ) + " millis "); for (ProteinXref xref : xrefs) { String nucleotideId = xref.getIdentifier(); String description = xref.getDescription(); Long startNewOrf = System.currentTimeMillis(); OpenReadingFrame newOrf = descriptionLineParser.createORFFromParsingResult(description);
protected String getProteinAccession(Protein protein) { StringBuilder proteinXRef = new StringBuilder(); Set<ProteinXref> crossReferences = protein.getCrossReferences(); for (ProteinXref crossReference : crossReferences) { if (proteinXRef.length() > 0) proteinXRef.append(VALUE_SEPARATOR); proteinXRef.append(crossReference.getIdentifier()); } return proteinXRef.toString(); }
private static ProteinXref stripUniqueIdentifierAndTrimForProteinSeq(String id) { if (id == null || id.isEmpty()) { throw new IllegalStateException("Found an identifier in a fasta file which is null or empty???"); } else { id = id.trim(); Matcher matcher = DEFLINE_ID_PATTERN.matcher(id); if (matcher.find()) { return new ProteinXref(null, matcher.group(1), matcher.group(2)); } else { return new ProteinXref(id); } } }
protected List<String> getProteinAccessions(Protein protein) { Set<ProteinXref> crossReferences = protein.getCrossReferences(); List<String> proteinXRefs = new ArrayList<>(crossReferences.size()); for (ProteinXref crossReference : crossReferences) { proteinXRefs.add(crossReference.getIdentifier()); } return proteinXRefs; }
private static ProteinXref stripUniqueIdentifierAndTrimForProteinSeq(String id) { if (id == null || id.isEmpty()) { throw new IllegalStateException("Found an identifier in a fasta file which is null or empty???"); } else { id = id.trim(); Matcher matcher = DEFLINE_ID_PATTERN.matcher(id); if (matcher.find()) { return new ProteinXref(null, matcher.group(1), matcher.group(2)); } else { return new ProteinXref(id); } } }
protected String getProteinAccession(Protein protein) { StringBuilder proteinXRef = new StringBuilder(); Set<ProteinXref> crossReferences = protein.getCrossReferences(); for (ProteinXref crossReference : crossReferences) { if (proteinXRef.length() > 0) proteinXRef.append(VALUE_SEPARATOR); proteinXRef.append(crossReference.getIdentifier()); } return proteinXRef.toString(); }
/** * Utility method to add a List of cross references * * @param accessions */ public void addCrossReferences(String... accessions) { for (String accession : accessions) { addCrossReference(new ProteinXref(accession)); } }
LOGGER.trace("Has " + protein.getMatches().size() + " matches"); for (ProteinXref xref : protein.getCrossReferences()) { LOGGER.trace("Xref: " + xref.getIdentifier());
if (matcher.find()) { if (LOGGER.isDebugEnabled()) LOGGER.debug("MATCHES"); return new ProteinXref(null, matcher.group(1), null, matcher.group(2)); String description = chunks[2]; String proteinName = getProteinName(description); return new ProteinXref(database, identifier, proteinName, description); } else { return stripUniqueIdentifierAndTrimForProteinSeq(crossReference); String description = chunks[4]; String proteinName = getProteinName(description); return new ProteinXref(database, identifier, proteinName, description.trim()); } else { return stripUniqueIdentifierAndTrimForProteinSeq(crossReference);
LOGGER.trace(xref.getIdentifier()); LOGGER.trace("Adding " + xref.getIdentifier() + " and setting updateRequired = true");
return new ProteinXref(null, matcher.group(1), originalHeaderName, matcher.group(2)); return new ProteinXref(null, matcher.group(1), null, matcher.group(2)); String description = chunks[2]; String proteinName = getProteinName(description); return new ProteinXref(database, identifier, proteinName, description); } else { return stripUniqueIdentifierAndTrimForProteinSeq(crossReference); String description = chunks[4]; String proteinName = getProteinName(description); return new ProteinXref(database, identifier, proteinName, description.trim()); } else { return stripUniqueIdentifierAndTrimForProteinSeq(crossReference);
String urlFriendlyId = gen.generate(xref.getIdentifier()); final Path newResultFile = Paths.get(tempDirectory + urlFriendlyId + ".svg"); resultFiles.add(newResultFile);
String urlFriendlyId = gen.generate(xref.getIdentifier()); final Path newResultFile = Paths.get(tempDirectory + urlFriendlyId + ".html"); resultFiles.add(newResultFile);
String strippedProteinId = XrefParser.stripOfFinalUnderScore(proteinXref.getIdentifier());
String strippedProteinId = XrefParser.stripOfFinalUnderScore(proteinXref.getIdentifier());
String strippedProteinId = XrefParser.stripOfFinalUnderScore(proteinXref.getIdentifier());