Celldesigner¶
- addAnnotation(fname, fname_out, infix, model, infix_type)[source]¶
Retrieves omics data from a COBRA model structure and add them to a CellDesginer XML file; The omics data will be shown as texts in CellDesigner or ReconMap online.
- USAGE
[var] = addAnnotation (fname, fname_out, infix, model, infix_type)
- INPUTS
fname – an XML file to be modified to include annotations
fanme_out – the name of the output XML file
infix – The metabolite/reaction IDs to be used to retrieve omics data in the COBRA model structure.
model – a COBRA model structure that contains the annotations which can be retrieved by using the infix as the index value.
- OPTIONAL INPUT
infix_type – ‘name’ or ‘id’
‘name’ indicates that ‘infix’ contains a list of reaction names, which are normally used in a COBRA model structure.
‘id’ indicates that ‘infix’ contains a list of IDs used in CellDesigner such as ‘re32’.
- OPTIONAL OUTPUT:
var: the content of the moidfied XML file with annotations
- addColour(parsed, listRxn_Color, colorScheme)[source]¶
Changes colour attributes of the reaction links in a parsed CellDesigner model structure given a list of reaction IDs
- USAGE
[ref, listRxnColour] = addColour (parsed, listRxn_Color, colorScheme)
- INPUTS
parsed – A parsed model structure generated by parseCD function
listRxn_Color – A list of reaction IDs that need to be highilighted by changing the colour attributes of the reaciton links in the CellDesigner model. The first column stores a list of reaction IDs whose reaction links need to be highlighted, whereas the second column saves a list of html Colours.
- OUTPUT
ref – An updated parsed CellDesigner model structure
listRxnColour
- addFlux(model, FBA_result, parsed, listRxn)[source]¶
Changes the thickness attributes of the reaction links in a CellDesigner model structure and make them propotional to the flux values obtained from COBRA functions
- USAGE
[ref, normalizedFlux, newListRxn] = addFlux (model, FBA_result, parsed, listRxn)
- INPUTS
model – A COBRA model structure
FBAresult – FBA results of a COBRA simulation by the optimizeCbModel function
parsed – The CD model structure outputed by the parseCD function
listRxn – A list of reaction IDs, after which the flux values are modified or added. P.s., the reaction IDs must be present in both the parsed CD model and the COBRA model structures. the reactions can be examined by cmpR function.
- OUTPUTS
ref – An updated parsed CellDesigner model that include information about the width of reaction links
normalizedFlux – A list of normalised flux values generated based on FBAresult.
newListRxn – New list of reaction IDs
Example
[parsed_1] = addFlux(recon2, fba_results, parsePD, listRxn);
- addMiriam(fname, fname_out, infix, model, infix_type, list, miriam_path)[source]¶
Adds Miriam information to CellDesigner XML file. The Miriam information is retrieved from a COBRA model structure using Metabolite/Reaction IDs as the name of entry. The omics data will be shown as texts hyperlinking to external databases in CellDesigner or ReconMap online.
- USAGE
[fname_out, var] = addMiriam (fname, fname_out, infix, model, infix_type, list, miriam_path)
- INPUTS
fname – An XML file to be modified to include annotations.
fname_out – The name of an output XML file.
infix – A list of metabolite/reaction IDs to be used to retrieve omics data in the COBRA model structure.
model – a COBRA model structure contains the annotations that can be retrieved by using the infix as the index value.
list – Column 1 stores a list of the fieldnames of the COBRA model strucutres that contains MIRIAM information; Column 2 stores a list of MIRIAM types corresponding to each field; column 3 stores a list of relations
- OPTIONAL INPUT
infix_type – ‘name’ or ‘id’;
‘name’indicates that ‘infix’ contains a list of reaction names, which are normally used in a COBRA model structure.
‘id’ indicates that ‘infix’ contains a list of IDs used in CellDesigner such as ‘re32’.
miriam_path – the file path of the miriam registry’s dataset (*.mat).
- OPTIONAL OUTPUT:
fname_out: the name of an output XML file. var: the content of the modified XML file with annotations
Example
%the following example command is intended to add all MIRIAM information %for the metabolites in the ReconMap [var] = addMiriam(‘ReconMap.xml’, ‘ReconMap_annotated.xml’, recon2.mets(:), recon2)
- cmpMet(parsed, model)[source]¶
Compares metabolites in a parsed CellDesigner model structure (imported by ‘parseCD’) and a COBRA model Matlab structure.
- USAGE
[results] = cmpMet (parsed, model)
- INPUTS
parsed – A parsed model structure generated by parseCD function.
model – A COBRA model Matlab structure.
- OUTPUT
results – contains three fields:
listOfFound - A list of reactions in the test model that are present in the reference COBRA model.
listOfNotFound - A list of reactions in the test model that are NOT present in the reference COBRA model.
list_of_rxns_not_present_in_ReferenceModel - A list of reactions in the reference model that are NOT included in the test model.
Example
results_M = cmpM(parseRecon2_species, recon2)
- cmpRxn(parsed, model)[source]¶
Compare reactions in a parsed CellDesigner model structure (imported by parseCD) and a COBRA model Matlab structure.
- USAGE
[results] = cmpRxn (parsed, model)
- INPUTS
parsed – A parsed model structure generated by parseCD function.
model – A COBRA model Matlab structure.
- OUTPUTS
results: Consist of four fields
listOfFound - A list of reactions in the test model that are present in the reference COBRA model.
listOfNotFound - A list of reactions in the test model that are NOT present in the reference COBRA model.
found_rxns_and_mets - A list of matched reactions in both the test model and the COBRA model; The lists of substrates and products for each rections stored in the sub field of rxns_mets
list_of_rxns_not_present_in_ReferenceModel - A list of reactions in the reference model that are NOT included in the test model.
Example
cmp_PD_recon2_result = cmpRxn(parsePD, recon2)
- colourAll(fname, parsed, fname_out, new_colour)[source]¶
Change the colours of all metabolite nodes to a specific colour.
- USAGE
[mainText_new, keyText, numText] = colourAll (fname, parsed, fname_out, new_colour)
- INPUTS
fname – An XML file that needs to be modified to change the colour of all metabolite nodes
fanme_out – The name of the output XML file
parsed – A parsed model structure generated by parseCD function
new_colour – a colour hex code such as ‘5bcdb8’ or ‘#5bcdb8’. A list of reaction IDs that need to be highilighted by changing the colour attributes of the reaciton links in the CellDesigner model. The first column stores a list of reaction IDs whose reaction links need to be highlighted, whereas the second column saves a list of html Colours.
- OPTIONAL OUTPUT:
mainText_new: Lines of the XML file keyText: Lists of retrieved alias and species IDs numText: Lists of the corresponding line numbers for each alias
and species ID
- colourNode(parsed, fname_out, list_Rxn, list_Met, list_Colour_Met)[source]¶
Changes the colours of metabolite nodes
- USAGE
[parsed_updated, mainText_new, final_list] = colourNode (parsed, fname_out, list_Rxn, list_Met, list_Colour_Met)
- INPUTS
fname_out – The name of the output XML file
parsed – A parsed model structure generated by parseCD function
list_Rxn – A list of reaction IDs that need to be highilighted by changing the colour attributes of the reaciton links in the CellDesigner model. The first column stores a list of reaction IDs whose reaction links need to be highlighted, whereas the second column stores a list of html Colours.
- OPTIONAL INPUTS
list_Met – The list of metabolite IDs to be highlighed
list_Colour_Met – Colour Hex Codes for Metabolite IDs in list_Met.
- OPTIONAL OUTPUT:
parsed_updated: An updated parsed model structure. mainText_new: The lines of the new XML file. final_list: A list of the metabolite nodes whose colour attributes are modified.
Example
[var] = colourNode(‘fatty_acid_synthesis_Miriam__rxns_test.xml’, ‘fatty_acid_synthesis_Miriam__rxns_test_colour.xml’, parsed_fatty_acid, list_nodes)
- colourNodeWhite(parsed, fname_out, list, list_Met)[source]¶
Highlights the metabolite nodes using the same colour scheme as in addColour function while changing the colours of rest nodes to white
- USAGE
[parsed_update, mainText_new, final_list] = colourNodeWhite (parsed, fname_out, list, list_Met)
- INPUTS
fanme_out – The name of the output XML file
parsed – A parsed model structure generated by parseCD function
list – A list of reaction IDs that need to be highilighted by changing the colour attributes of the reaciton links in the CellDesigner model. The first column stores a list of reaction IDs whose reaction links need to be highlighted, whereas the second column stores a list of Html Colours.
- OPTIONAL INPUTS
list_Met – The list of metabolite IDs to be highlighed
- OPTIONAL OUTPUTS:
parsed_updated: An updated parsed model structure. mainText_new: The lines of the new XML file. final_list: A list of the metabolite nodes whose colour attributes
are modified.
Example
[var, final_list] = colourNodeWhite(‘fatty_acid_synthesis_Miriam__rxns_test_white.xml’, ‘fatty_acid_synthesis_Miriam__rxns_test_white_colour.xml’, parsed_fatty_acid_new, list_nodes)
- correctMetName(parsed, cmpM_results, listR)[source]¶
Correct the inconsistent species name in the test model (identified by the cmpM function) according to a reference list of species names.
- USAGE
[parsed_updated] = correctMetName (parsed, cmpM_results, listR)
- INPUTS
parsed – A parsed CD model structure generated by parseCD function.
cmpM_results – the output of the cmpM function. A list of species names that are present in the reference model (A COBRA model structure, but not in the test model (the parsed model structure of a CD XML file).
listR – A new list of species names that will be used to substitute the incorrect names (as listed in listN)
- OUTPUT
parsed_updated – The corrected CD model structure
Example
ref_corrected = correctMetName(ref, cmp_recon2map_M.listOfNotFound(:, 6), listForCorrection(:, 2))
- intergrate(fname, fname_out, model, FBAsolution, listRxn)[source]¶
- USAGE
intergrate (fname, fname_out, model, FBAsolution, listRxn)
- INPUTS
fname – The name fo the file
fname_out – The name of the output XML file name.
model – A COBRA model structure
FBAsolution – FBA results of a COBRA simulation by the optimizeCbModel function
listRxn – A list of reaction IDs, after which the flux values are modified or added. P.s., the reaction IDs must be present in both the parsed CD model and the COBRA model structures. the reactions can be examined by cmpR function.
- OUTPUT
fname_out – A new XML file with the width of reaction links changed according to flux values calculated by COBRA
Example
intergrate(‘anno_test.xml’, ‘anno_test_2_ecoli.xml’, model_ecoli,solution, model_ecoli.rxns(:))
- parseCD(fname)[source]¶
Parse an XML file into two types of CellDesigner model structures. The first type organises data by reaction; the second type organises data by property (namely, ID, width, colour, etc.)
- USAGE
[annotation] = parseCD (fname)
- INPUT
fanme – A CellDesigner XML file
- OUTPUT
annotation – The first type of the parsed model structure
annotation.r_info - The second type of the parsed model structure
Examples
parsePD_1 = parseCD(‘PD_140620_1.xml’)
- position(str_long, str_ID)[source]¶
Retrieve the value of an attribute (str_ID) in the line (str_long) of the XML file and identify the starting and ending indices of the value in the attribute line of the XML file.
- USAGE
[string, p_st, p_ed] = position (str_long, str_ID)
- INPUTS
str_long – A string of the line of the XML file
str_ID – The name of the attribute
- OUTPUTS
string – The value of the attribute
p_st – The starting index of the value
p_ed – The ending index of the value
- readCD(parsed)[source]¶
Convert the a type of the parsed model structure (orgnised by reaction) into the other type of the parsed model structure (organised by property (namely, ID, width, colour, etc.)
- USAGE
[r_info] = readCD (parsed)
- INPUT
parsed – the first type of the parsed model structure outputed by parseCD function (more user-friendely to modify speicfic graphic properties for specific reactions)
- OUTPUT
r_info – the second type of the parsed model structure (similar to a COBRA Matlab structure).
- repairXML(parsed, fname_out)[source]¶
Write the corrected CD model structure to an XML file
- USAGE
[annotedText] = repairXML (parsed, fname_out)
- INPUTS
parsed – A parsed model structure generated by ‘parseCD’function.
fanme_out – The name of the output XML file.
- OUTPUTS
annotedText – A matlab variable storing the all the XML lines
Example
annotedText_fatty_acid = repairXML(parsed_fatty_acid_new_corrected, ‘fatty_acid_synthesis_species_corrected_2.xml’)
- retrieveMet(parsed, lkup)[source]¶
Retrieve all the identifiers for a metabolite in the parsed CD model structure; there could be multiple identifiers for a metabolite.
- USAGE
[identifier] = retrieveMet (parsed, lkup)
- INPUTS
parsed – A parsed model structure generated by parseCD function.
lkup – A species name
- OUTPUT
identifier – The identifiers of a metabolite used the parsed CD model structure
- updateCD(text, parsed, note)[source]¶
Correct(Update) the species name according to a reference list of the names.
- USAGE
[results] = updateCD (text, parsed, note)
- INPUTS
text – A matlab variable that saves the lines of the XML file.
parsed – A parsed CD model structure generated by parseCD function.
- OPTIONAL INPUT
note – The default value is ‘0’; It can be set as ‘true’; Record the column number of the species that are to be replaced with a new name.
- OUTPUTS
text – The corrected lines of the XML file.
number – The number of the line.
changdStrLines – The changed line of text.
col – Record the column number of the species that is to be replaced with a new species name.
Example
[text, number, numberofchanges, col] = updateCD(annotedText, ref_corrected)
- writeCD(parsed, fname_out)[source]¶
Write the parsed CD model structure to a CD-compatible XML file.
- USAGE
[parsed_update, annotedText] = writeCD (fname, parsed, fname_out)
- INPUTS
fname – The original XML file
parsed – A parsed model structure generated by parseCD function.
fanme_out – The name of the output XML file.
- OUTPUTS
parsed_update – An updated version of the parsed
annotedText – A matlab variable storing the all the XML lines
Example
aaa = writeXML(‘PD_140620_1.xml’, parsePD,’text.html’)
- writeTXT(para, fname_out)[source]¶
Write a txt file for online PD map to highlight specific reaction nodes.
- USAGE
[text] = writeTXT (para, fname_out)
- INPUTS
para – A variable that stores two columns: the first column contains a list of reaction names,whereas the second column contains a corresponding list of the colours (Hex triplet, e.g., https://closedxml.codeplex.com/wikipage?title=Excel%20Indexed%20Colors)
fanme_out – The name of the output text file name.
- OPTIONAL OUTPUT:
text: The lines of the text file
- writeText2XML(text, fname_out)[source]¶
An auxiliary function to write the lines of text generated by other CD package functions to a XML file.
- USAGE
writeText2XML (text, fname_out)
- INPUTS
text – A matlab variable contains the lines of the variable to be written to a XML file.
fanme_out – The name of the output XML file name.
- writeXML(fname, parsed, fname_out)[source]¶
Write a parsed CD model strucutre to a CD-compatible XML file.
- USAGE
[annotedText] = writeXML (fname, parsed, fname_out)
- INPUTS
fname – The original XML file
parsed – A parsed model structure generated by parseCD function.
fanme_out – The name of the output XML file.
- OUTPUTS
annotedText – A matlab variable storing the all the XML lines
Example
aaa = writeXML(‘PD_140620_1.xml’, parsePD, ‘text.html’)