From 531449e5a127f821e142c2e74b69c948f3bfb932 Mon Sep 17 00:00:00 2001 From: rasi Date: Thu, 16 Dec 2021 18:04:34 -0800 Subject: [PATCH 1/3] Remove reaction tagging for output and add new options to help --- src/NFinput/NFinput.cpp | 32 +++++++-------- src/NFsim.cpp | 87 ++++++++++++++++++++++++----------------- 2 files changed, 67 insertions(+), 52 deletions(-) diff --git a/src/NFinput/NFinput.cpp b/src/NFinput/NFinput.cpp index 17110336..7cbc5a60 100644 --- a/src/NFinput/NFinput.cpp +++ b/src/NFinput/NFinput.cpp @@ -1828,20 +1828,20 @@ bool NFinput::initReactionRules( } } - if( !pRateLaw->Attribute("tag") ) { - cerr<<"\n!!Error! This XML file was generated using an older version of BioNetGen that does not support the 'TotalRate' convention!"<Attribute("tag")); - if(rf>0) tagFlag=true; - if(verbose) cout<<"\t\t\t= "<Attribute("tag") ) { + // cerr<<"\n!!Error! This XML file was generated using an older version of BioNetGen that does not support the 'TotalRate' convention!"<Attribute("tag")); + // if(rf>0) tagFlag=true; + // if(verbose) cout<<"\t\t\t= "<Attribute("id") || !pRateLaw->Attribute("type")) { cerr<<"!!Error:: ReactionRule "<setAllReactantAndProductTemplates(reactants, products); r->setTotalRateFlag(totalRateFlag); - if (tagFlag) { + // if (tagFlag) { r->tag(); s->turnOnTagRxnOutput(); - } + // } // Use reaction connectivity flag // Set to true if given on the command line r->setConnectivityFlag(s->getConnectivityFlag()); diff --git a/src/NFsim.cpp b/src/NFsim.cpp index df47f7ae..1a434d09 100644 --- a/src/NFsim.cpp +++ b/src/NFsim.cpp @@ -75,20 +75,24 @@ * -notf = disables On the Fly Observables, see manual * * -cb = turn on complex bookkeeping, see manual - * + * * -connect - infer network connectivity before starting simulation. (default: no). - * Does not require any modification to BioNetGen or PySB. * @author Arvind Rasi Subramaniam - * - * -printconnected - print connectivity of each reaction to an output file. (default: no). + * + * -rxnlog - write out firing time and molecules for all reactions + * Does not require any modification to BioNetGen or PySB. * @author Arvind Rasi Subramaniam * * -trackconnected - write out the reactions whose rates change after firing of each reaction. - * Default: false + * this works only if -rxnlog switch is included * @author: Arvind Rasi Subramaniam + * + * -printconnected - print connectivity of each reaction to an output file. (default: no). + * this works only if -rxnlog switch is included + * @author Arvind Rasi Subramaniam * * -trackrxnnum - track reaction number instead of name. this helps to keep the rxn log file small. - * Default: false + * this works only if -rxnlog switch is included * @author: Arvind Rasi Subramaniam * * -maxcputime - maximum run time for simulation in seconds (default: 1000s). @@ -516,37 +520,32 @@ System *initSystemFromFlags(map argMap, bool verbose) } } - if (s->getAnyRxnTagged()) { - if (argMap.find("rxnlog") != argMap.end()) { - string rxnLogFileName = argMap.find("rxnlog")->second; - s->registerReactionFileLocation(rxnLogFileName); - // track the reactions whose rates change upon each each reaction - // firing. This is useful for debugging to make sure that all the - // right reactions are updated after each firing. - // Arvind Rasi Subramaniam Nov 21, 2018 - if (argMap.find("trackconnected") != argMap.end()) { - s->registerConnectedRxnFileLocation( - rxnLogFileName.replace( - rxnLogFileName.end()-4, - rxnLogFileName.end(), - "_connected.tsv")); - s->setTrackConnected(true); - } else { - s->setTrackConnected(false); - } - if (argMap.find("printconnected") != argMap.end()) { - s->registerListOfConnectedRxnFileLocation( - rxnLogFileName.replace( - rxnLogFileName.end()-4, - rxnLogFileName.end(), - "_connectedlist.tsv")); - s->setPrintConnected(true); - } else { - s->setPrintConnected(false); - } + if (argMap.find("rxnlog") != argMap.end()) { + string rxnLogFileName = argMap.find("rxnlog")->second; + s->registerReactionFileLocation(rxnLogFileName); + // track the reactions whose rates change upon each each reaction + // firing. This is useful for debugging to make sure that all the + // right reactions are updated after each firing. + // Arvind Rasi Subramaniam Nov 21, 2018 + if (argMap.find("trackconnected") != argMap.end()) { + s->registerConnectedRxnFileLocation( + rxnLogFileName.replace( + rxnLogFileName.end()-4, + rxnLogFileName.end(), + "_connected.tsv")); + s->setTrackConnected(true); + } else { + s->setTrackConnected(false); + } + if (argMap.find("printconnected") != argMap.end()) { + s->registerListOfConnectedRxnFileLocation( + rxnLogFileName.replace( + rxnLogFileName.end()-4, + rxnLogFileName.end(), + "_connectedlist.tsv")); + s->setPrintConnected(true); } else { - s->registerReactionFileLocation( - s->getName() + "_rxns.dat"); + s->setPrintConnected(false); } if (argMap.find("trackrxnnum") != argMap.end()) { s->setRxnNumberTrack(true); @@ -554,6 +553,7 @@ System *initSystemFromFlags(map argMap, bool verbose) s->setRxnNumberTrack(false); } } + // } //turn off on the fly calculation of observables @@ -740,6 +740,21 @@ void printHelp(string version) cout<<""< Date: Thu, 16 Dec 2021 19:36:49 -0800 Subject: [PATCH 2/3] Add filename option to -rxnlog switch in help message --- src/NFsim.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/NFsim.cpp b/src/NFsim.cpp index 1a434d09..a8f5161d 100644 --- a/src/NFsim.cpp +++ b/src/NFsim.cpp @@ -79,7 +79,7 @@ * -connect - infer network connectivity before starting simulation. (default: no). * @author Arvind Rasi Subramaniam * - * -rxnlog - write out firing time and molecules for all reactions + * -rxnlog [filename] - write out firing time and participating molecules for all reactions to file * Does not require any modification to BioNetGen or PySB. * @author Arvind Rasi Subramaniam * @@ -742,13 +742,13 @@ void printHelp(string version) cout<<""< Date: Thu, 13 Jan 2022 12:49:22 -0500 Subject: [PATCH 3/3] removing old CI files, we will work off of github actions instead --- .appveyor.yml | 83 ----------------------------------------- .curl_ftp.sh | 18 --------- .make_tar.pl | 101 -------------------------------------------------- .travis.yml | 58 ----------------------------- bintray.json | 30 --------------- 5 files changed, 290 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .curl_ftp.sh delete mode 100644 .make_tar.pl delete mode 100644 .travis.yml delete mode 100644 bintray.json diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index baac5967..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,83 +0,0 @@ -os: unstable - -environment: - CTEST_OUTPUT_ON_FAILURE: 1 - matrix: - - platform: x86 - fast_finish: true - generator: "Ninja" - builder: cygwin - - - platform: x64 - fast_finish: true - generator: "Ninja" - builder: cygwin - - -branches: - only: - - master - - release - -install: - - if "%platform%"=="x86" ( C:\cygwin\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P openssl-devel -P libiodbc-devel -P libiodbc2 -P odbc-mysql -P odbc-pgsql -P odbc-sqlite3 -P libmysqlclient-devel -P libsqlite3-devel -P libcrypt-devel -P zip) - - if "%platform%"=="x86" ( set "PATH=C:\cygwin\bin;%PATH%" ; set "TRAVIS_OS_NAME=Win32" ) - - if "%platform%"=="x64" ( C:\cygwin64\setup-x86_64.exe -qnNdO -R C:/cygwin64 -s http://cygwin.mirror.constant.com -l C:/cygwin64/var/cache/setup -P openssl-devel -P libiodbc-devel -P libiodbc2 -P odbc-mysql -P odbc-pgsql -P odbc-sqlite3 -P libmysqlclient-devel -P libsqlite3-devel -P libcrypt-devel -P zip) - - if "%platform%"=="x64" ( set "PATH=C:\cygwin64\bin;%PATH%" ; set "TRAVIS_OS_NAME=Win64" ) -# - if "%platform%"=="x86" ( choco install -r -y mingw --x86 ) -# - if "%platform%"=="x64" ( choco install -r -y mingw ) - - choco install -r -y ninja - - -build_script: - - cmd: echo Running cmake ... - - cmd: mkdir build - - # Build the 32bit executable - - if "%platform%"=="x86" ( move CMakeLists.txt CMakeLists.x64.txt ) - - if "%platform%"=="x86" ( copy CMakeLists.x86.txt .\CMakeLists.txt ) - - if "%platform%"=="x86" ( cd build ) - - if "%platform%"=="x86" ( copy C:\cygwin\bin\gcc.exe C:\cygwin\bin\cc.exe ) - - # Build the 64bit executable - - if "%platform%"=="x64" ( cd build ) - - if "%platform%"=="x64" ( copy C:\cygwin64\bin\gcc.exe C:\cygwin64\bin\cc.exe ) - - - cmake -G "Ninja" .. - - ninja - # Test running the binary - - .\NFsim.exe - - "mkdir NFsim-Win%platform%" - - "cp NFsim.exe NFsim-Win%platform%" - - - if "%platform%"=="x86" (cp C:\cygwin\bin\cygwin1.dll NFsim-Win%platform%) - - if "%platform%"=="x86" (cp C:\cygwin\bin\cygstdc++-6.dll NFsim-Win%platform%) - - if "%platform%"=="x86" (cp C:\cygwin\bin\cygz.dll NFsim-Win%platform%) - - - if "%platform%"=="x64" (cp C:\cygwin64\bin\cygwin1.dll NFsim-Win%platform%) - - if "%platform%"=="x64" (cp C:\cygwin64\bin\cygstdc++-6.dll NFsim-Win%platform%) - - if "%platform%"=="x64" (cp C:\cygwin64\bin\cygz.dll NFsim-Win%platform%) - - if "%platform%"=="x64" (cp C:\cygwin64\bin\cyggcc_s-seh-1.dll NFsim-Win%platform%) - - - "7z a NFsim-Win%platform%.zip NFsim-Win%platform%" - - cd .. - -artifacts: - - path: '.\build\NFsim-*.zip' - name: nfsim - type: zip - -deploy: - - provider: BinTray - username: jczech - subject: jczech - api_key: - # api key from https://bintray.com/profile/edit - # encrypted in https://ci.appveyor.com/tools/encrypt - secure: XzrXGPWsRRrx8DZTJSNJpLkMZrxlXF2vdeao4CCBiXUtKBuxR7Nj2CQIBy3L3bSB - repo: nfsim - package: nfsim - version: 1.0 - artifact: nfsim - publish: true - override: true diff --git a/.curl_ftp.sh b/.curl_ftp.sh deleted file mode 100644 index 0c9c6c20..00000000 --- a/.curl_ftp.sh +++ /dev/null @@ -1,18 +0,0 @@ - - -curl -v -u $FTP_USER:$FTP_PASSWORD -T ./dist/NFsim-$TRAVIS_OS_NAME ftp://ftp.midcapsignals.com/BioNetGen_Beta/d_travis/ - - - -# The FTP_USER and FTP_PASSWORD strings are actually defined in the env: global: -secure: strings in travis.yml. Those strings -# Were generated using a program that may be installed on Linux. Documentation can be found at: https://docs.travis-ci.com/user/encryption-keys/ -# To make a long story short, the program may be installed on Linux with: gem install travis -# the command to generate the FTP_PASSWORD string is -# -# travis encrypt FTP_USER="password" --skip-version-check -r RuleWorld/nfsim -# -# The password should be surroundedd by double quotes, and the -r parameter indicates the repository for which the password -# will be used. -# - - diff --git a/.make_tar.pl b/.make_tar.pl deleted file mode 100644 index 1e7db12d..00000000 --- a/.make_tar.pl +++ /dev/null @@ -1,101 +0,0 @@ -#!/usr/bin/perl -# -# SYNOPSIS: -# make_html.pl [OPTS] -# -# DESCRIPTION: -# Create an html page that provides a link to the latest generated -# BioNetGen distribution. -# -# OPTIONS: -# --platform PLAT : Choices are Linux, MacOSX, Windows - - -use strict; -use warnings; - -# Perl Core Modules -use FindBin; -use File::Spec; -use Getopt::Long; -use Cwd ("getcwd"); -use Config; -use File::Path qw(remove_tree); - - -# distribution version (default undefined) -my $version = ''; -# platform choices are: (MacOSX or Linux or Windows) -my $platform = ''; -# path to version file -my $path_to_version_file = '.'; - - -GetOptions( 'help|h' => sub { display_help(); exit(0); }, - 'platform=s' => \$platform); - - -print "Platform: $platform\n"; - -my $zip_type = ''; -my $travis_os = ''; -if ($platform eq "linux") { - $zip_type = ".tar.gz"; $travis_os = "Linux"; - my $archive_file = "./dist/NFsim-source-".$platform.$zip_type; - print "\nCreating NFsim source archive:\n"; - system("tar cvzf ${archive_file} bin doc models src test tools validate CMakeLists.txt LICENSE.txt README.txt makefile NFsim_manual_v1.12.pdf "); - system("ls -lt dist"); - -} else { - if ($platform eq "osx") { - $zip_type = ".tar.gz"; $travis_os = "MacOSX"; - my $archive_file = "./dist/NFsim-source-".$platform.$zip_type; - print "\nCreating NFsim source archive:\n"; - system("tar cvzf ${archive_file} bin doc models src test tools validate CMakeLists.txt LICENSE.txt README.txt makefile NFsim_manual_v1.12.pdf "); - system("ls -lt dist"); - - } else { - - print " In perl platform = ".$platform."\n"; - - if ($platform eq "Win32") { - $zip_type = ".zip"; $travis_os = "Win32"; - my $archive_file = "build/NFsim-source-Win32".$zip_type; - print "\nCreating NFsim".$platform.".exe source archive:\n"; - system("7z a ${archive_file} doc models src test tools validate CMakeLists.txt LICENSE.txt README.txt makefile NFsim_manual_v1.12.pdf "); - system("dir ${archive_file}"); - } else { - if ($platform eq "Win64") { - $zip_type = ".zip"; $travis_os = "Win64"; - my $archive_file = "./build/NFsim-source-Win64".$zip_type; - print "\nCreating NFsim".$platform.".exe source archive:\n"; - system("7z a ${archive_file} doc models src test tools validate CMakeLists.txt LICENSE.txt README.txt makefile NFsim_manual_v1.12.pdf "); - } else { - print "Invalid platform: ".$platform."\n"; - exit; - } - } - } -} - - -exit; - -# ######################################################################## -# HELP -# ######################################################################## -# display help menu -sub display_help -{ -print < (<%{compare_url}|%{commit}>) Author: %{author}" - - "Build details: %{build_url} " - -before_install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - -install: - - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi - -script: - - mkdir -p build; mkdir -p dist; cd build; cmake ..; make; cp NFsim ../dist; cp NFsim ../dist/NFsim-$TRAVIS_OS_NAME ;cd ..; - - cd validate;tar xfj bionetgen-2.2.6.tar.bz2 - - python validate.py - - cd .. - -deploy: - provider: bintray - file: "./bintray.json" - user: jczech - key: - # If you need to regenrate this for some reason, here's what you do: - # travis encrypt --add deploy.key - # Get BINTRAY API KEY from https://bintray.com/profile/edit under "API Key" section - secure: blvEmR1iGkwD8AMj8Uqi1cWQaI/1JGMTWrxj1EGV8rF7jNhLdIDXdUsBWampZOTsySvU94feuJsjrQz6F9QselaSnEAROb3nmwtS8ta7cXPpouPOAL+ZuT0zQpRXPiY2gOeHXLd9gtW+plTlC8srsl1BuHlHAnIeY3fm+CRQ8fAg9KSBL6Gp6AcxAadPr6YcB5D18NqclByeKRiN0mUA7g2CRYsJ5oR14ZREjEL4QdyIxOP2JhRDgG2PPNP7Iws/t26TDnYAb4YMtcCfKsTQR13EGmmsYNaXfcTEcwaQE2WRFI4DzZ1hifYcZqkq+SQjMaq9C1xxuuxYg305q8dY6teIjBpijZuHEdsP4fJDP8WYXZupEy97p5duTnPhnLNkWabUNhj7RDzg0bsLujAYtdoACcM9pM7hRb2KsyVSLhVngWHibBVT4BkhyrceX4Lof9WLN++t3VigrX+iusJPbedoJVnJJpH+MWutwPnrW73CXrE+GNkLVDI7IcvN2xMxvWgjgMADnyxj7k1ZMoAO+CvFp0zwDkaTKLKIsDFiNFIZb3DHuH+d4Aeacua5xM3ZTmLFgFqPHAci+7JqCSeVdxHMP8PnEMowz3TAF9IVtiEzTYeFyfO11QbtMcHjYPaAtZq746X2LJv0fa2UCog+q6zyHVwJiKBEVMj/rOZZjG4= - skip_cleanup: true - on: - all_branches: true diff --git a/bintray.json b/bintray.json deleted file mode 100644 index b95c62df..00000000 --- a/bintray.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "package": { - "name": "nfsim", - "repo": "nfsim", - "subject": "jczech", - "desc": "I was pushed completely automatically", - "website_url": "www.bionetgen.org", - "issue_tracker_url": "https://github.com/ruleworld/nfsim/issues", - "licenses": ["MIT"], - "vcs_url": "https://github.com/ruleworld/nfsim.git", - "public_download_numbers": false, - "public_stats": false - }, - - "version": { - "name": "1.0", - "desc": "The latest release of nfsim", - "gpgSign": false - }, - - "files": - [ - {"includePattern": "dist/(NFsim-.*)", "uploadPattern": "/$1", - "matrixParams": { - "override": 1 } - } - ], - - "publish": true -}