Documentation ¶
Index ¶
- func ParseRheaToUniprotTsv(r io.Reader, lines chan<- RheaToUniprot)
- func ReadGzippedXml(gzipPath string) ([]byte, error)
- func ReadRheaToUniprotSprot(path string, lines chan RheaToUniprot)
- func ReadRheaToUniprotTrembl(path string, lines chan RheaToUniprot)
- type BidirectionalReaction
- type ChEBIXML
- type Citation
- type Compound
- type CompoundXML
- type Contains
- type ContainsX
- type Description
- type DirectionalReaction
- type EC
- type Location
- type Product
- type Rdf
- type Reaction
- type ReactionParticipant
- type ReactivePartXML
- type Rhea
- type RheaToUniprot
- type SeeAlso
- type Side
- type Status
- type Subclass
- type Substrate
- type SubstrateOrProduct
- type TransformableTo
- type UnderlyingChEBI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRheaToUniprotTsv ¶
func ParseRheaToUniprotTsv(r io.Reader, lines chan<- RheaToUniprot)
ParseRheaToUniprotTsv parses a rhea2uniprot TSV file and sends values to a channel.
func ReadGzippedXml ¶
ReadGzippedXml reads in a a gzip'd Rhea dump (https://www.rhea-db.org/help/download) into bytes.
func ReadRheaToUniprotSprot ¶
func ReadRheaToUniprotSprot(path string, lines chan RheaToUniprot)
ReadRheaToUniprotSprot reads in the rhea2uniprot sprot TSV file (not gzipped) and sends values into a channel.
func ReadRheaToUniprotTrembl ¶
func ReadRheaToUniprotTrembl(path string, lines chan RheaToUniprot)
ReadRheaToUniprotTrembl reads in the rhea2uniprot trembl TSV file (gzipped) and sends values into channel.
Types ¶
type BidirectionalReaction ¶
type BidirectionalReaction struct { XMLName xml.Name `xml:"bidirectionalReaction"` Resource string `xml:"resource,attr"` }
BidirectionalReaction is an XML representation of a Rhea bidirectional reaction.
type Compound ¶
type Compound struct { ID int `json:"id" db:"id"` Accession string `json:"accession" db:"accession"` Position string `json:"position" db:"position"` Name string `json:"name" db:"name"` HTMLName string `json:"htmlName" db:"htmlname"` Formula string `json:"formula" db:"formula"` Charge string `json:"charge" db:"charge"` ChEBI string `json:"chebi" db:"chebi"` SubclassOfChEBI string `json:"subclassOfChEBI"` PolymerizationIndex string `json:"polymerizationIndex" db:"polymerizationindex"` CompoundID int `json:"compoundid" db:"compoundid"` CompoundAccession string `json:"compoundaccession" db:"compoundaccession"` CompoundName string `json:"compoundname" db:"compoundname"` CompoundHTMLName string `json:"compoundhtmlName" db:"compoundhtmlname"` CompoundType string `json:"compoundType" db:"compoundtype"` }
Compound is a struct of a Rhea compound. These are chemicals - sometimes they are complicated chemicals like proteins or polymers, but often they are simple molecules. When Compounds are complicated molecules, like proteins, they can have reactiveParts that actually do the reactions. Compound, as defined here, is a pair containing a macro-molecule and a reactivePart. When building into a database, you will have to split this pairing for normalization.
func NewCompound ¶
func NewCompound(description Description, subclass Subclass) Compound
NewCompound returns a Compound.
type CompoundXML ¶
CompoundXML is an XML representation of a compound.
type ContainsX ¶
ContainsX is a catch-all XML representation of how many compounds a ReactionParticipant would use.
type Description ¶
type Description struct { // Reaction XMLName xml.Name `xml:"Description"` About string `xml:"about,attr"` ID int `xml:"id"` Accession string `xml:"accession"` // Accession refers to a Rhea accession number Equation string `xml:"equation"` HTMLEquation string `xml:"htmlEquation"` IsChemicallyBalanced bool `xml:"isChemicallyBalanced"` IsTransport bool `xml:"isTransport"` Citations []Citation `xml:"citation"` Substrates []Substrate `xml:"substrates"` Products []Product `xml:"products"` SubstrateOrProducts []SubstrateOrProduct `xml:"substratesOrProducts"` Subclass []Subclass `xml:"subClassOf"` Comment string `xml:"comment"` EC EC `xml:"ec"` Status Status `xml:"status"` Compound CompoundXML `xml:"compound"` // ReactionSide / Reaction Participant BidirectionalReactions []BidirectionalReaction `xml:"bidirectionalReaction"` DirectionalReactions []DirectionalReaction `xml:"directionalReaction"` Side Side `xml:"side"` SeeAlsos SeeAlso `xml:"seeAlso"` TransformableTo TransformableTo `xml:"transformableTo"` CuratedOrder int `xml:"curatedOrder"` Contains Contains `xml:"contains"` // ContainsX contains all other name-attribute pairs, with names like "contains1" in mind ContainsX []ContainsX `xml:",any"` // Small Molecule tags Name string `xml:"name"` HTMLName string `xml:"htmlName"` Formula string `xml:"formula"` Charge string `xml:"charge"` ChEBI ChEBIXML `xml:"chebi"` // Generic Compound ReactivePartXML ReactivePartXML `xml:"reactivePart"` // ReactivePart Position string `xml:"position"` // Polymer UnderlyingChEBI UnderlyingChEBI `xml:"underlyingChEBI"` PolymerizationIndex string `xml:"polymerizationIndex"` // Transport Location Location `xml:"location"` }
Description is the XML representation of an object in the Rhea database.
func (*Description) CitationStrings ¶
func (d *Description) CitationStrings() []string
CitationStrings gives a list of citation strings from a description.
func (*Description) ProductAccessionIDs ¶
func (d *Description) ProductAccessionIDs() []string
ProductAccessionIDs gives a list of product accessions from a description.
func (*Description) SubstrateAccessionIDs ¶
func (d *Description) SubstrateAccessionIDs() []string
SubstrateAccessionIDs gives a list of substrate accessions from a description.
func (*Description) SubstrateOrProductAccessionIDs ¶
func (d *Description) SubstrateOrProductAccessionIDs() []string
SubstrateOrProductAccessionIDs gives a list of substrateOrProduct accessions from a description.
type DirectionalReaction ¶
type DirectionalReaction struct { XMLName xml.Name `xml:"directionalReaction"` Resource string `xml:"resource,attr"` }
DirectionalReaction is an XML representation of a Rhea directional reaction.
type Location ¶
Location is an XML representation of Locations in a cell, usually referring to transport enzymes.
type Rdf ¶
type Rdf struct { XMLName xml.Name `xml:"RDF"` Descriptions []Description `xml:"Description"` }
Rdf is the RDF XML representation of the Rhea database.
type Reaction ¶
type Reaction struct { ID int `json:"id" db:"id"` Directional bool `json:"directional" db:"directional"` Accession string `json:"accession" db:"accession"` Status string `json:"status" db:"status"` Comment string `json:"comment" db:"comment"` Equation string `json:"equation" db:"equation"` HTMLEquation string `json:"htmlequation" db:"htmlequation"` IsChemicallyBalanced bool `json:"ischemicallybalanced" db:"ischemicallybalanced"` IsTransport bool `json:"istransport" db:"istransport"` Ec string `json:"ec" db:"ec"` Location string `json:"location" db:"location"` Citations []string `json:"citations"` Substrates []string `json:"substrates"` Products []string `json:"products"` SubstrateOrProducts []string `json:"substrateOrProducts"` }
Reaction represents a Rhea reaction. Substrates, Products, and SubstrateOrProducts are all ReactionSide accession numbers, which can be linked to the ReactionParticipant's ReactionSide accession
func NewReaction ¶
func NewReaction(description Description, subclass Subclass) Reaction
NewReaction returns a Reaction.
type ReactionParticipant ¶
type ReactionParticipant struct { ReactionSide string `json:"reactionside" db:"reactionside"` Contains int `json:"contains" db:"contains"` ContainsN bool `json:"containsn" db:"containsn"` Minus bool `json:"minus" db:"minus"` // Only set to true if ContainsN == true to handle Nminus1 Plus bool `json:"plus" db:"plus"` // Only set to true if ContainsN == true to handle Nplus1 Accession string `json:"reactionParticipant" db:"ReactionParticipant"` Compound string `json:"compound" db:"compound"` }
ReactionParticipant represents a Rhea ReactionParticipant. ReactionParticipants represent Compounds in Reactions. They can contain many of the same Compounds (including polymerized configurations) and are associated with a ReactionSide.
func NewReactionParticipant ¶
func NewReactionParticipant(description Description, containsx ContainsX, compoundParticipantMap map[string]string) (ReactionParticipant, error)
NewReactionParticipant returns a ReactionParticipant.
type ReactivePartXML ¶
type ReactivePartXML struct { XMLName xml.Name `xml:"reactivePart"` Resource string `xml:"resource,attr"` }
ReactivePartXML is an XML representation of a ReactivePart.
type Rhea ¶
type Rhea struct { ReactionParticipants []ReactionParticipant `json:"reactionParticipants"` Compounds []Compound `json:"compounds"` Reactions []Reaction `json:"reactions"` }
Rhea is a struct of the entire Rhea Database in a simplified higher-level way.
func (*Rhea) ExportJSON ¶
ExportJSON exports Rhea as a JSON file
type RheaToUniprot ¶
RheaToUniprot represents a single line of the TSV file.
type Subclass ¶
Subclass is an XML representation of a subclass, which can mean many different things in Rhea.
type SubstrateOrProduct ¶
type SubstrateOrProduct struct { XMLName xml.Name `xml:"substratesOrProducts"` Resource string `xml:"resource,attr"` }
SubstrateOrProduct is an XML representation of a SubstrateOrProduct.
type TransformableTo ¶
type TransformableTo struct { XMLName xml.Name `xml:"transformableTo"` Resource string `xml:"resource,attr"` }
TransformableTo is an XML representation of a transformableTo in a description. This essentially links two ReactionSides in Rhea.
type UnderlyingChEBI ¶
type UnderlyingChEBI struct { XMLName xml.Name `xml:"underlyingChEBI"` Resource string `xml:"resource,attr"` }
UnderlyingChEBI is an XML representation of ChEBI that builds a Polymer.