Package org.helm.notation2.tools
Class WebService
java.lang.Object
org.helm.notation2.tools.WebService
public class WebService extends Object
WebService class containing all required methods for the web-service
- Author:
- hecht
-
Constructor Summary
Constructors Constructor Description WebService() -
Method Summary
Modifier and Type Method Description FloatcalculateExtinctionCoefficient(String notation)method to calculate from a non-ambiguous HELM string the extinction coefficientDoublecalculateMolecularWeight(String notation)method to calculate from a non-ambiguous HELM input the molecular weightStringconvertIntoStandardHELM(String notation)method to convert the input HELM into a standard HELMStringconvertMolFileSMILESWithAtomMapping(String molfile, List<Attachment> attachments)method to generate a smiles with atom mapping for a given molfile with the given attachmentsStringconvertStandardHELMToCanonicalHELM(String notation)method to convert the input HELM into canonical HELMStringgenerateCanSMILESForHELM2(String notation)method to generate a SMILES representation for a whole HELM2 inputStringgenerateFasta(String notation)method to generate FASTA-Formats for all rna and peptide sequences from an HELM inputStringgenerateHELMFromFastaNucleotide(String notation)method to generate HELM from a FASTA containing rna/dna sequencesStringgenerateHELMFromFastaPeptide(String notation)method to generate HELM from a FASTA containing peptide sequence(s)byte[]generateImageForHELMMolecule(String notation)method to generate a HELM moleculebyte[]generateImageForMonomer(Monomer monomer, boolean showRgroups)method to generate an image for a monomerStringgenerateJSON(String helm)method to generate JSON-Output for the HELMStringgenerateNaturalAnalogSequencePeptide(String notation)method to generate the natural analogue sequence for all peptide-sequences from an HELM inputStringgenerateNaturalAnalogSequenceRNA(String notation)method to generate the natural analogue sequence for all rna-sequences from an HELM inputStringgenerateSMILESForHELM2(String notation)method to generate a SMILES representation for a whole HELM2 inputStringgetMolecularFormula(String notation)method to calculate from a non-ambiguous HELM input the molecular formulaList<String>getMolecularProperties(String notation)method to calculate froma non-ambiguous HELM input the molecular properties: molecular formula, molecular weight, exact mass, extinction coefficientStringreadPeptide(String peptide)method to read a single peptide sequence and generates HELMStringreadRNA(String rna)method to read a single rna sequence and generates HELMvoidrefreshMonomerCache()method to refresh the monomer cache of the MonomerFactoryvoidvalidateHELM(String helm)method to validate the input HELM-StringvoidvalidateSyntaxHELM(String helm)
-
Constructor Details
-
WebService
public WebService()
-
-
Method Details
-
validateHELM
public void validateHELM(String helm) throws ValidationException, MonomerLoadingException, ChemistryExceptionmethod to validate the input HELM-String- Parameters:
helm- input HELM-string- Throws:
ValidationException- if the input HELM is not validMonomerLoadingException- if the MonomerFactory can not be refreshedChemistryException- if the Chemistry Engine can not be initialized
-
validateSyntaxHELM
public void validateSyntaxHELM(String helm) throws ChemistryException, ParserException, org.jdom2.JDOMException, IOException, MonomerException- Throws:
ChemistryExceptionParserExceptionorg.jdom2.JDOMExceptionIOExceptionMonomerException
-
convertStandardHELMToCanonicalHELM
public String convertStandardHELMToCanonicalHELM(String notation) throws HELM1FormatException, ValidationException, MonomerLoadingException, ChemistryExceptionmethod to convert the input HELM into canonical HELM- Parameters:
notation- HELM input- Returns:
- canonical HELM
- Throws:
HELM1FormatException- if HELM input contains HELM2 featuresValidationException- if the HELM input is not validMonomerLoadingException- if the MonomerFactory can not be loadedChemistryException- if the Chemistry Engine can not be initialized
-
convertIntoStandardHELM
public String convertIntoStandardHELM(String notation) throws HELM1FormatException, ValidationException, MonomerLoadingException, org.helm.chemtoolkit.CTKException, ChemistryExceptionmethod to convert the input HELM into a standard HELM- Parameters:
notation- HELM input- Returns:
- standard HELM
- Throws:
HELM1FormatException- if the HELM input contains HELM2 featuresValidationException- if the HELM input is not validMonomerLoadingException- if the MonomerFactory can not be loadedorg.helm.chemtoolkit.CTKException- general ChemToolKit exception passed to HELMToolKitChemistryException- if the Chemistry Engine can not be initialized
-
calculateExtinctionCoefficient
public Float calculateExtinctionCoefficient(String notation) throws ExtinctionCoefficientException, ValidationException, MonomerLoadingException, ChemistryExceptionmethod to calculate from a non-ambiguous HELM string the extinction coefficient- Parameters:
notation- HELM input- Returns:
- extinction coefficient from the HELM input
- Throws:
ExtinctionCoefficientException- if the extinction coefficient can not be calculatedValidationException- if the HELM input is not validMonomerLoadingException- if the MonomerFactory can not be refreshedChemistryException- if the Chemistry Engine can not be initialized
-
generateFasta
public String generateFasta(String notation) throws FastaFormatException, ValidationException, MonomerLoadingException, ChemistryExceptionmethod to generate FASTA-Formats for all rna and peptide sequences from an HELM input- Parameters:
notation- HELM input- Returns:
- FASTA containing all rna and peptide sequences
- Throws:
ValidationException- if the HELM input is not validFastaFormatException- if the FASTA-sequences can not be builtMonomerLoadingException- if the MonomerFactory can not be loadedChemistryException- if the Chemistry Engine can not be initialized
-
generateHELMFromFastaNucleotide
public String generateHELMFromFastaNucleotide(String notation) throws FastaFormatException, org.helm.notation2.parser.exceptionparser.NotationException, ChemistryException, MonomerLoadingException, NucleotideLoadingExceptionmethod to generate HELM from a FASTA containing rna/dna sequences- Parameters:
notation- FASTA containing rna/dna sequences- Returns:
- HELM
- Throws:
FastaFormatException- if the input is not validorg.helm.notation2.parser.exceptionparser.NotationException- if notation is not validChemistryException- if chemistry engine can not be initializedMonomerLoadingException- if monomers can not be loadedNucleotideLoadingException- if nucleotides can not be loaded
-
generateHELMFromFastaPeptide
public String generateHELMFromFastaPeptide(String notation) throws FastaFormatException, MonomerLoadingException, ChemistryExceptionmethod to generate HELM from a FASTA containing peptide sequence(s)- Parameters:
notation- FASTA containing peptide sequence(s)- Returns:
- HELM
- Throws:
FastaFormatException- if the FASTA input is not validMonomerLoadingException- if the MonomerFactory can not be loadedChemistryException- if chemistry engine can not be initialized
-
calculateMolecularWeight
public Double calculateMolecularWeight(String notation) throws MonomerLoadingException, BuilderMoleculeException, org.helm.chemtoolkit.CTKException, ValidationException, ChemistryExceptionmethod to calculate from a non-ambiguous HELM input the molecular weight- Parameters:
notation- HELM input- Returns:
- moleuclar weight from the HELM input
- Throws:
MonomerLoadingException- if the MonomerFactory can not be refreshedValidationException- if the HELM input is not validBuilderMoleculeException- if the molecule for the calculation can not be builtorg.helm.chemtoolkit.CTKException- general ChemToolKit exception passed to HELMToolKitChemistryException- if the Chemistry Engine can not be initialized
-
getMolecularFormula
public String getMolecularFormula(String notation) throws BuilderMoleculeException, org.helm.chemtoolkit.CTKException, ValidationException, MonomerLoadingException, ChemistryExceptionmethod to calculate from a non-ambiguous HELM input the molecular formula- Parameters:
notation- HELM input- Returns:
- molecular formula from the HELM input
- Throws:
ValidationException- if the HELM input is not validBuilderMoleculeException- if the molecule for the calculation can not be builtorg.helm.chemtoolkit.CTKException- general ChemToolKit exception passed to HELMToolKitMonomerLoadingException- if the MonomerFactory can not be refreshedChemistryException- if the Chemistry Engine can not be initialized
-
getMolecularProperties
public List<String> getMolecularProperties(String notation) throws BuilderMoleculeException, org.helm.chemtoolkit.CTKException, ExtinctionCoefficientException, ValidationException, MonomerLoadingException, ChemistryExceptionmethod to calculate froma non-ambiguous HELM input the molecular properties: molecular formula, molecular weight, exact mass, extinction coefficient- Parameters:
notation- given HELM- Returns:
List<String>containing the molecule properties- Throws:
BuilderMoleculeException- if the molecule can't be builtorg.helm.chemtoolkit.CTKException- general ChemToolKit exception passed to HELMToolKitExtinctionCoefficientException- if extinction coefficient can not be calculatedValidationException- if notation is not validMonomerLoadingException- if monomers can not be loadedChemistryException- if the Chemistry Engine can not be initialized
-
readPeptide
public String readPeptide(String peptide) throws FastaFormatException, org.helm.notation2.parser.exceptionparser.NotationException, ChemistryExceptionmethod to read a single peptide sequence and generates HELM- Parameters:
peptide- peptide sequence- Returns:
- HELM
- Throws:
org.helm.notation2.parser.exceptionparser.NotationException- if the notation object can not be builtFastaFormatException- if the peptide sequence is not in the right formatChemistryException- if chemistry engine can not be initialized
-
readRNA
public String readRNA(String rna) throws org.helm.notation2.parser.exceptionparser.NotationException, FastaFormatException, ChemistryException, NucleotideLoadingExceptionmethod to read a single rna sequence and generates HELM- Parameters:
rna- rna sequence- Returns:
- HELM
- Throws:
org.helm.notation2.parser.exceptionparser.NotationException- if the notation object can not be builtFastaFormatException- if the rna-sequence is not in the right format HELMChemistryException- if chemistry engine can not be initializedNucleotideLoadingException- if nucleotides can not be loaded
-
generateImageForHELMMolecule
public byte[] generateImageForHELMMolecule(String notation) throws BuilderMoleculeException, org.helm.chemtoolkit.CTKException, IOException, ValidationException, ChemistryExceptionmethod to generate a HELM molecule- Parameters:
notation- HELM string- Returns:
- generated molecule image in byte[]
- Throws:
ValidationException- if the HELM string is not validBuilderMoleculeException- if the molecule can't be builtorg.helm.chemtoolkit.CTKException- general ChemToolKit exception passed to HELMToolKitIOException- if the image can not be producedChemistryException- if the Chemistry Engine can not be initialized
-
generateImageForMonomer
public byte[] generateImageForMonomer(Monomer monomer, boolean showRgroups) throws BuilderMoleculeException, org.helm.chemtoolkit.CTKException, ChemistryExceptionmethod to generate an image for a monomer- Parameters:
monomer- Monomer InputshowRgroups- wheter to show the r groups in the image- Returns:
- generated molecule image in byte[]
- Throws:
BuilderMoleculeException- if the molecule can not be builtorg.helm.chemtoolkit.CTKException- general ChemToolKit exception passed to HELMToolKitChemistryException- if the Chemistry Engine can not be initialized
-
generateJSON
public String generateJSON(String helm) throws ValidationException, MonomerLoadingException, ChemistryException, com.fasterxml.jackson.core.JsonProcessingExceptionmethod to generate JSON-Output for the HELM- Parameters:
helm- HELM input- Returns:
- HELM as JSON-objects
- Throws:
ValidationException- if the HELM input is not validMonomerLoadingException- if the MonomerFactory can not be refreshedChemistryException- if the Chemistry Engine can not be initializedcom.fasterxml.jackson.core.JsonProcessingException- if json can not be produced
-
refreshMonomerCache
method to refresh the monomer cache of the MonomerFactory- Throws:
MonomerLoadingException- if the MonomerFactory can not be loadedChemistryException- if chemistry engine can not be initialized
-
generateNaturalAnalogSequencePeptide
public String generateNaturalAnalogSequencePeptide(String notation) throws HELM2HandledException, ValidationException, MonomerLoadingException, PeptideUtilsException, org.helm.notation2.parser.exceptionparser.NotationException, ChemistryExceptionmethod to generate the natural analogue sequence for all peptide-sequences from an HELM input- Parameters:
notation- input HELM- Returns:
- natural analogue peptide sequences, divided by white spaces
- Throws:
org.helm.notation2.parser.exceptionparser.NotationException- if the input complex notation contains non-peptide polymer(s)HELM2HandledException- if the HELM input contains HELM2 featuresValidationException- if the input HELM is not validMonomerLoadingException- if the MonomerFactory can not be refreshedPeptideUtilsException- if the polymer is not a peptideorg.helm.notation2.parser.exceptionparser.NotationException- if notation is not validChemistryException- if the Chemistry Engine can not be initialized
-
generateNaturalAnalogSequenceRNA
public String generateNaturalAnalogSequenceRNA(String notation) throws org.helm.notation2.parser.exceptionparser.NotationException, HELM2HandledException, ValidationException, MonomerLoadingException, ChemistryExceptionmethod to generate the natural analogue sequence for all rna-sequences from an HELM input- Parameters:
notation- HELM input- Returns:
- natural analogue rna sequences, divided by white spaces
- Throws:
org.helm.notation2.parser.exceptionparser.NotationException- if the input complex notation contains non-nucleid acid polymer(s)HELM2HandledException- if HELM input contains HELM2 featuresValidationException- if the HELM input is not validMonomerLoadingException- if the MonomerFactory can not be refreshedChemistryException- if the Chemistry Engine can not be initialized
-
generateSMILESForHELM2
public String generateSMILESForHELM2(String notation) throws BuilderMoleculeException, org.helm.chemtoolkit.CTKException, ChemistryException, ValidationException, MonomerLoadingExceptionmethod to generate a SMILES representation for a whole HELM2 input- Parameters:
notation- given helm notation- Returns:
- generated smiles for the given helm notation
- Throws:
BuilderMoleculeException- if the molecule can't be builtorg.helm.chemtoolkit.CTKException- general ChemToolKit exception passed to HELMToolKitChemistryException- if chemistry engine can not be initializedValidationException- if notation is not validMonomerLoadingException- if monomers can not be loaded
-
generateCanSMILESForHELM2
public String generateCanSMILESForHELM2(String notation) throws BuilderMoleculeException, org.helm.chemtoolkit.CTKException, ChemistryException, ValidationException, MonomerLoadingException, NotationExceptionmethod to generate a SMILES representation for a whole HELM2 input- Parameters:
notation- given helm notation- Returns:
- generated canonical smiles for the given notation
- Throws:
BuilderMoleculeException- if the molecule can't be builtorg.helm.chemtoolkit.CTKException- general ChemToolKit exception passed to HELMToolKitChemistryException- if chemistry engine can not be initializedValidationException- if notation is not validMonomerLoadingException- if monomers can not be loadedNotationException- if notation is not valid
-
convertMolFileSMILESWithAtomMapping
public String convertMolFileSMILESWithAtomMapping(String molfile, List<Attachment> attachments) throws org.helm.chemtoolkit.CTKException, ChemistryExceptionmethod to generate a smiles with atom mapping for a given molfile with the given attachments- Parameters:
molfile- given molfileattachments- given attachments- Returns:
- smiles with atom mapping
- Throws:
org.helm.chemtoolkit.CTKException- general ChemToolKit exception passed to HELMToolKitChemistryException- if the chemistry engine can not be initialized
-