/** * Create a protein from a string * * @param seqString * @throws CompoundNotFoundException */ public ProteinSequence(String seqString) throws CompoundNotFoundException { this(seqString, AminoAcidCompoundSet.getAminoAcidCompoundSet()); }
/** * A protein sequence where the storage of the sequence is somewhere else. * Could be loaded from a large Fasta file or via a Uniprot Proxy reader via * Uniprot ID * * @param proxyLoader */ public ProteinSequence(ProxySequenceReader<AminoAcidCompound> proxyLoader) { this(proxyLoader, AminoAcidCompoundSet.getAminoAcidCompoundSet()); }
private CompoundSet<AminoAcidCompound> getAminoAcidCompounds() { if (aminoAcidCompounds != null) { return aminoAcidCompounds; } return AminoAcidCompoundSet.getAminoAcidCompoundSet(); }
/** * A protein sequence where the storage of the sequence is somewhere else. * Could be loaded from a large Fasta file or via a Uniprot Proxy reader via * Uniprot ID * * @param proxyLoader */ public ProteinSequence(ProxySequenceReader<AminoAcidCompound> proxyLoader) { this(proxyLoader, AminoAcidCompoundSet.getAminoAcidCompoundSet()); }
/** * Create a protein from a string * * @param seqString * @throws CompoundNotFoundException */ public ProteinSequence(String seqString) throws CompoundNotFoundException { this(seqString, AminoAcidCompoundSet.getAminoAcidCompoundSet()); }
private CompoundSet<AminoAcidCompound> getAminoAcidCompounds() { if (aminoAcidCompounds != null) { return aminoAcidCompounds; } return AminoAcidCompoundSet.getAminoAcidCompoundSet(); }
public ScaledSubstitutionMatrix(){ compoundSet = AminoAcidCompoundSet.getAminoAcidCompoundSet(); }
public static SubstitutionMatrix<AminoAcidCompound> getBlosum62() { return new SimpleSubstitutionMatrix<AminoAcidCompound>(AminoAcidCompoundSet.getAminoAcidCompoundSet(), new InputStreamReader( SimpleSubstitutionMatrix.class.getResourceAsStream("/matrices/blosum62.txt")), "blosum62"); }
public static SubstitutionMatrix<AminoAcidCompound> getBlosum62() { return new SimpleSubstitutionMatrix<AminoAcidCompound>(AminoAcidCompoundSet.getAminoAcidCompoundSet(), new InputStreamReader( SimpleSubstitutionMatrix.class.getResourceAsStream("/matrices/blosum62.txt")), "blosum62"); }
private static SubstitutionMatrix<AminoAcidCompound> getAminoAcidMatrix(String file) { if (!aminoAcidMatrices.containsKey(file)) { aminoAcidMatrices.put(file, new SimpleSubstitutionMatrix<AminoAcidCompound>( AminoAcidCompoundSet.getAminoAcidCompoundSet(), getReader(file), file)); } return aminoAcidMatrices.get(file); }
private static SubstitutionMatrix<AminoAcidCompound> getAminoAcidMatrix(String file) { if (!aminoAcidMatrices.containsKey(file)) { aminoAcidMatrices.put(file, new SimpleSubstitutionMatrix<AminoAcidCompound>( AminoAcidCompoundSet.getAminoAcidCompoundSet(), getReader(file), file)); } return aminoAcidMatrices.get(file); }
private boolean isSimilar(char c1, char c2) { AminoAcidCompoundSet set = AminoAcidCompoundSet.getAminoAcidCompoundSet(); AminoAcidCompound aa1 = set.getCompoundForString(String.valueOf(c1)); AminoAcidCompound aa2 = set.getCompoundForString(String.valueOf(c2)); short val = matrix.getValue(aa1,aa2); return val > 0; }
private boolean isSimilar(char c1, char c2) { AminoAcidCompoundSet set = AminoAcidCompoundSet.getAminoAcidCompoundSet(); AminoAcidCompound aa1 = set.getCompoundForString(String.valueOf(c1)); AminoAcidCompound aa2 = set.getCompoundForString(String.valueOf(c2)); short val = matrix.getValue(aa1,aa2); return val > 0; }
public static void main(String[] args) throws Exception { CasePreservingProteinSequenceCreator creator = new CasePreservingProteinSequenceCreator(AminoAcidCompoundSet.getAminoAcidCompoundSet()); AbstractSequence<AminoAcidCompound> seq = creator.getSequence("aaAA",0); logger.info("Sequence: {}", seq.getSequenceAsString()); //"AAAA" logger.info("User Collection: {}", seq.getUserCollection()); //"[false, false, true, true]" }
public static void main(String[] args) throws Exception { CasePreservingProteinSequenceCreator creator = new CasePreservingProteinSequenceCreator(AminoAcidCompoundSet.getAminoAcidCompoundSet()); AbstractSequence<AminoAcidCompound> seq = creator.getSequence("aaAA",0); logger.info("Sequence: {}", seq.getSequenceAsString()); //"AAAA" logger.info("User Collection: {}", seq.getUserCollection()); //"[false, false, true, true]" }
public static void main(String[] args) { try { UniprotProxySequenceReader<AminoAcidCompound> uniprotSequence = new UniprotProxySequenceReader<AminoAcidCompound>("YA745_GIBZE", AminoAcidCompoundSet.getAminoAcidCompoundSet()); ProteinSequence proteinSequence = new ProteinSequence(uniprotSequence); logger.info("Accession: {}", proteinSequence.getAccession().getID()); logger.info("Sequence: {}", proteinSequence.getSequenceAsString()); } catch (Exception e) { logger.error("Exception: ", e); } }
public static void main(String[] args) { try { UniprotProxySequenceReader<AminoAcidCompound> uniprotSequence = new UniprotProxySequenceReader<AminoAcidCompound>("YA745_GIBZE", AminoAcidCompoundSet.getAminoAcidCompoundSet()); ProteinSequence proteinSequence = new ProteinSequence(uniprotSequence); logger.info("Accession: {}", proteinSequence.getAccession().getID()); logger.info("Sequence: {}", proteinSequence.getSequenceAsString()); } catch (Exception e) { logger.error("Exception: ", e); } }
private Sequence getSequence(String gappedSequenceString){ if (gappedSequenceString == null) return null; Sequence returnSeq = null; String sequenceString = gappedSequenceString.replace("-", ""); try { if (sequenceString.matches("^[ACTG]+$")) returnSeq = new DNASequence(sequenceString, DNACompoundSet.getDNACompoundSet()); else if (sequenceString.matches("^[ACUG]+$")) returnSeq = new RNASequence(sequenceString, DNACompoundSet.getDNACompoundSet()); else returnSeq = new ProteinSequence(sequenceString, AminoAcidCompoundSet.getAminoAcidCompoundSet()); } catch (CompoundNotFoundException ex) { logger.error("Unexpected error, could not find compound when creating Sequence object from Hsp", ex); } return returnSeq; }
public static void main(String[] args) throws Exception { ProteinSequence proteinSequence = new ProteinSequence("ARNDCEQGHILKMFPSTWYVBZJX"); logger.info("Protein Sequence: {}", proteinSequence.toString()); StringProxySequenceReader<AminoAcidCompound> sequenceStringProxyLoader = new StringProxySequenceReader<AminoAcidCompound>("XRNDCEQGHILKMFPSTWYVBZJA", AminoAcidCompoundSet.getAminoAcidCompoundSet()); ProteinSequence proteinSequenceFromProxy = new ProteinSequence(sequenceStringProxyLoader); logger.info("Protein Sequence from Proxy: {}", proteinSequenceFromProxy.toString()); } }
public static void main(String[] args) throws Exception { ProteinSequence proteinSequence = new ProteinSequence("ARNDCEQGHILKMFPSTWYVBZJX"); logger.info("Protein Sequence: {}", proteinSequence.toString()); StringProxySequenceReader<AminoAcidCompound> sequenceStringProxyLoader = new StringProxySequenceReader<AminoAcidCompound>("XRNDCEQGHILKMFPSTWYVBZJA", AminoAcidCompoundSet.getAminoAcidCompoundSet()); ProteinSequence proteinSequenceFromProxy = new ProteinSequence(sequenceStringProxyLoader); logger.info("Protein Sequence from Proxy: {}", proteinSequenceFromProxy.toString()); } }