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); } } }
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); } } }
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); } } }
/** * Utility method to add a List of cross references * * @param accessions */ public void addCrossReferences(String... accessions) { for (String accession : accessions) { addCrossReference(new ProteinXref(accession)); } }
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);
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);