*/ TCAPIEXPORT tc_items tc_getConnections(long part) { if (_tc_getConnections) return _tc_getConnections(part); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_getConnectionsWithRole(long part, const char* role) { if (_tc_getConnectionsWithRole) return _tc_getConnectionsWithRole(part,role); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_getConnectedNodes(long connection) { if (_tc_getConnectedNodes) return _tc_getConnectedNodes(connection); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_getConnectedNodesWithRole(long connection, const char* role) { if (_tc_getConnectedNodesWithRole) return _tc_getConnectedNodesWithRole(connection,role); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_allItems() { if (_tc_allItems) return _tc_allItems(); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_findItemsUsingRegexp(const char* re) { if (_tc_findItemsUsingRegexp) return _tc_findItemsUsingRegexp(re); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_getChildren(long o) { if (_tc_getChildren) return _tc_getChildren(o); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_findItems(tc_strings names) { if (_tc_findItems) return _tc_findItems(names); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_itemsOfFamilyFrom(const char* family, tc_items itemsToSelectFrom) { if (_tc_itemsOfFamilyFrom) return _tc_itemsOfFamilyFrom(family,itemsToSelectFrom); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_itemsOfFamily(const char* family) { if (_tc_itemsOfFamily) return _tc_itemsOfFamily(family); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_partsIn(long o) { if (_tc_partsIn) return _tc_partsIn(o); return tc_createItemsArray(0); }
*/ TCAPIEXPORT tc_items tc_partsDownstream(long o) { if (_tc_partsDownstream) return _tc_partsDownstream(o); return tc_createItemsArray(0); }
void loadAllNames() { int i,len; tc_matrix params, N; tc_items A = tc_createItemsArray(0); if (selectedItemsOnly) A = tc_selectedItems(); if (A.length < 1 || !tc_getItem(A,0)) A = tc_allItems(); tc_deleteStringsArray(allNames); if (tc_getItem(A,0)) { params = tc_getParameters(A); N = tc_getStoichiometry(A); len = N.rows; allNames = tc_createStringsArray(len+params.rows); for (i=0; i < params.rows; ++i) tc_setString(allNames,i,tc_getRowName(params,i)); for (i=0; i < len; ++i) tc_setString(allNames,i+params.rows,tc_getRowName(N,i)); params.rownames = tc_createStringsArray(0); tc_deleteMatrix(params); tc_deleteMatrix(N); tc_deleteItemsArray(A); } }
void run() { tc_items selected = tc_selectedItems(); long p; tc_items C; int i, j, k, N = 0; tc_items js, tfs, parts; tc_strings names, jnames; tc_matrix m; p = tc_getItem(selected,0); if (p == 0) return; //if (! tc_isA(p,"Regulator")) return; C = tc_getConnections(p); //count the number of repressors/activators for (i=0; i < C.length; ++i) { if (tc_isA(tc_getItem(C,i),"Binding")) { ++N; } } js = tc_createItemsArray(N); //get kon,koff,and trans.reg. connections j = 0; for (i=0; i < C.length; ++i) { if (tc_isA(tc_getItem(C,i),"Binding")) { tc_setItem(js,j, tc_getItem(C,i)); ++j; } } //get the repressors/activators names tfs = tc_createItemsArray(N+1); tc_setItem(tfs,0,p); k = 1; for (i=0; i < C.length; ++i) { if (tc_isA(tc_getItem(C,i),"Binding")) { parts = tc_getConnectedNodes(tc_getItem(C,i)); for (j=0; i < parts.length; ++j) { if (tc_getItem(parts,j) != p) { tc_setItem( tfs, k, tc_getItem(parts,j)); //save tfs ++k; } } tc_deleteItemsArray(parts); } } names = tc_getUniqueNames(tfs); //get names of proteins jnames = tc_getUniqueNames(js); //get names of reactions //main function that generates the full stoichiometry and rates m = fullBindingKinetics(N,jnames.strings,names.strings); //output that matrix to screen and item tc_printTable(m); tc_setRates(js,m.colnames); if (m.colnames.strings) free(m.colnames.strings); m.colnames = tc_createStringsArray(0); tc_setStoichiometry(js,m); tc_deleteItemsArray(js); tc_deleteItemsArray(tfs); tc_deleteMatrix(m); tc_deleteStringsArray(names); tc_deleteStringsArray(jnames); tc_deleteItemsArray(selected); return; }