From: Kyle M. D. <kyl...@ep...> - 2018-03-09 07:12:58
|
Hi all, First-time Scipion user here (version 1.1). How would I create a new project and import a workflow from a .json file from the command line? I ask because my collaborators are using Scipion as part of a larger data analysis pipeline that extends beyond EM. At one point in this pipeline we want to automatically launch the Scipion GUI with a new project and import a workflow that has already been specified in a .json file. I know how to do this manually with the GUI, but it would be nice to have the new project and workflow setup via a script so we can easily vary some of the analysis parameters. Thanks a lot for the help. I would be happy to provide any additional information if necessary. Cheers, Kyle Dr. Kyle M. Douglass Post-doctoral Researcher EPFL - The Laboratory of Experimental Biophysics http://leb.epfl.ch/ http://kmdouglass.github.io |
From: Jose M. de la R. T. <del...@gm...> - 2018-03-09 08:24:07
|
Hi Kyle, You can easily do what you want in a Python script via our API. Basically you will need to create a new project and then load the given .json file. Take a look at the following example here: https://github.com/delarosatrevin/scipion-session/blob/f2ac1934f24ebcf0c3da205e9878eca86e4d80a4/aarhus/new-session-aarhus.py#L60 I also wrote a simple script to edit .json files in the GUI (basically faking a project in a temporary folder and then saving the .json back when closing the windows.) that maybe could also be useful for you. It is in the branch *release-1.1.facilities-devel *that will be the next stable release 1.2. Following the link: https://github.com/I2PC/scipion/blob/release-1.1.facilities-devel/scripts/edit_workflow.py Hope this helps Best Jose Miguel On Fri, Mar 9, 2018 at 8:12 AM, Kyle Michael Douglass <kyl...@ep... > wrote: > Hi all, > > > First-time Scipion user here (version 1.1). How would I create a new > project and import a workflow from a .json file from the command line? > > > I ask because my collaborators are using Scipion as part of a larger data > analysis pipeline that extends beyond EM. At one point in this pipeline we > want to automatically launch the Scipion GUI with a new project and import > a workflow that has already been specified in a .json file. I know how to > do this manually with the GUI, but it would be nice to have the new project > and workflow setup via a script so we can easily vary some of the analysis > parameters. > > > Thanks a lot for the help. I would be happy to provide any additional > information if necessary. > > > Cheers, > > Kyle > > > Dr. Kyle M. Douglass > Post-doctoral Researcher > EPFL - The Laboratory of Experimental Biophysics > http://leb.epfl.ch/ > http://kmdouglass.github.io > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > scipion-users mailing list > sci...@li... > https://lists.sourceforge.net/lists/listinfo/scipion-users > > |
From: Jose M. de la R. T. <del...@gm...> - 2018-03-09 10:40:25
|
Hi Kyle, Unfortunately we haven't documented the API that well...this is a pending task. Nonetheless you have some developers documentation here: https://github.com/I2PC/scipion/wiki/Developers-Page I would recommend to take a look at the "How to create a protocol page": https://github.com/I2PC/scipion/wiki/Creating-a-Protocol I will recommend to look at the Python code, specially the following: - Object (basic wrapper around Python types that can be stored/retrieved), pyworkflow/object.py - Protocol (basic execution unit:Manager (to deal we projects): pyworkflow/protocol/protocol.py - Project (managing a given project) pyworkflow/project.py - Manager: pyworkflow/manager.py Feel free to provide any feedback, Best, Jose Miguel On Fri, Mar 9, 2018 at 11:15 AM, Kyle Douglass <kyl...@ep...> wrote: > Hi Jose Miguel, > > On 03/09/2018 09:23 AM, Jose Miguel de la Rosa Trevin wrote: > > You can easily do what you want in a Python script via our API. > Basically you will need to create a new project and then load the > given .json file. Take a look at the following example here: > > https://github.com/delarosatrevin/scipion-session/blob/f2ac1934f24ebcf0c3da205e9878eca86e4d80a4/aarhus/new-session-aarhus.py#L60 > > > > Thanks for the swift response! Indeed, I think that this is the solution I > am looking for. > > Is the Python API documented anywhere, or should I focus on extracting the > main functions by looking at the Python code itself? > > Thanks again, > > Kyle > > -- > Kyle M. Douglass, PhD > Post-doctoral researcher > The Laboratory of Experimental Biophysics > EPFL, Lausanne, Switzerlandhttp://kmdouglass.github.iohttp://leb.epfl.ch > > |
From: Pablo C. <pc...@cn...> - 2018-03-09 12:41:01
|
Thanks Jose....additionally you can have a look to this: https://github.com/I2PC/scipion/wiki/Streaming-Processing#kicking-off-scipion-in-your-pipeline I've just added today since I had to explain this to a facilitiy manager that had the same /similar question Feel free to ask...this is that first version and it can be more clear., may be?. On 09/03/18 10:40, Jose Miguel de la Rosa Trevin wrote: > Hi Kyle, > > Unfortunately we haven't documented the API that well...this is a > pending task. > Nonetheless you have some developers documentation here: > https://github.com/I2PC/scipion/wiki/Developers-Page > I would recommend to take a look at the "How to create a protocol page": > https://github.com/I2PC/scipion/wiki/Creating-a-Protocol > > I will recommend to look at the Python code, specially the following: > - Object (basic wrapper around Python types that can be > stored/retrieved), pyworkflow/object.py > - Protocol (basic execution unit:Manager (to deal we projects): > pyworkflow/protocol/protocol.py > - Project (managing a given project) pyworkflow/project.py > - Manager: pyworkflow/manager.py > > Feel free to provide any feedback, > Best, > Jose Miguel > > > On Fri, Mar 9, 2018 at 11:15 AM, Kyle Douglass <kyl...@ep... > <mailto:kyl...@ep...>> wrote: > > Hi Jose Miguel, > > > On 03/09/2018 09:23 AM, Jose Miguel de la Rosa Trevin wrote: > >> You can easily do what you want in a Python script via our API. >> Basically you will need to create a new project and then load the >> given .json file. Take a look at the following example here: >> >> https://github.com/delarosatrevin/scipion-session/blob/f2ac1934f24ebcf0c3da205e9878eca86e4d80a4/aarhus/new-session-aarhus.py#L60 >> <https://github.com/delarosatrevin/scipion-session/blob/f2ac1934f24ebcf0c3da205e9878eca86e4d80a4/aarhus/new-session-aarhus.py#L60> >> > > Thanks for the swift response! Indeed, I think that this is the > solution I am looking for. > > Is the Python API documented anywhere, or should I focus on > extracting the main functions by looking at the Python code itself? > > Thanks again, > > Kyle > > -- > Kyle M. Douglass, PhD > Post-doctoral researcher > The Laboratory of Experimental Biophysics > EPFL, Lausanne, Switzerland > http://kmdouglass.github.io > http://leb.epfl.ch > > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > _______________________________________________ > scipion-users mailing list > sci...@li... > https://lists.sourceforge.net/lists/listinfo/scipion-users |
From: Kyle D. <kyl...@ep...> - 2018-03-09 14:00:29
|
Dear Pablo and Jose Miguel, Thank you very much for your help. The ability to generate a project and workflow based on a JSON template is exactly what I was looking for. I should furthermore be able to figure out the Python API from the .py files you mentioned. Cheers, Kyle On 03/09/2018 01:40 PM, Pablo Conesa wrote: > > Thanks Jose....additionally you can have a look to this: > > https://github.com/I2PC/scipion/wiki/Streaming-Processing#kicking-off-scipion-in-your-pipeline > > I've just added today since I had to explain this to a facilitiy > manager that had the same /similar question > > Feel free to ask...this is that first version and it can be more > clear., may be?. > > > On 09/03/18 10:40, Jose Miguel de la Rosa Trevin wrote: >> Hi Kyle, >> >> Unfortunately we haven't documented the API that well...this is a >> pending task. >> Nonetheless you have some developers documentation here: >> https://github.com/I2PC/scipion/wiki/Developers-Page >> I would recommend to take a look at the "How to create a protocol page": >> https://github.com/I2PC/scipion/wiki/Creating-a-Protocol >> >> I will recommend to look at the Python code, specially the following: >> - Object (basic wrapper around Python types that can be >> stored/retrieved), pyworkflow/object.py >> - Protocol (basic execution unit:Manager (to deal we projects): >> pyworkflow/protocol/protocol.py >> - Project (managing a given project) pyworkflow/project.py >> - Manager: pyworkflow/manager.py >> >> Feel free to provide any feedback, >> Best, >> Jose Miguel >> >> >> On Fri, Mar 9, 2018 at 11:15 AM, Kyle Douglass <kyl...@ep... >> <mailto:kyl...@ep...>> wrote: >> >> Hi Jose Miguel, >> >> >> On 03/09/2018 09:23 AM, Jose Miguel de la Rosa Trevin wrote: >> >>> You can easily do what you want in a Python script via our API. >>> Basically you will need to create a new project and then load the >>> given .json file. Take a look at the following example here: >>> >>> https://github.com/delarosatrevin/scipion-session/blob/f2ac1934f24ebcf0c3da205e9878eca86e4d80a4/aarhus/new-session-aarhus.py#L60 >>> <https://github.com/delarosatrevin/scipion-session/blob/f2ac1934f24ebcf0c3da205e9878eca86e4d80a4/aarhus/new-session-aarhus.py#L60> >>> >> >> Thanks for the swift response! Indeed, I think that this is the >> solution I am looking for. >> >> Is the Python API documented anywhere, or should I focus on >> extracting the main functions by looking at the Python code itself? >> >> Thanks again, >> >> Kyle >> >> -- >> Kyle M. Douglass, PhD >> Post-doctoral researcher >> The Laboratory of Experimental Biophysics >> EPFL, Lausanne, Switzerland >> http://kmdouglass.github.io >> http://leb.epfl.ch >> >> >> >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org!http://sdm.link/slashdot >> >> >> _______________________________________________ >> scipion-users mailing list >> sci...@li... >> https://lists.sourceforge.net/lists/listinfo/scipion-users > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > _______________________________________________ > scipion-users mailing list > sci...@li... > https://lists.sourceforge.net/lists/listinfo/scipion-users -- Kyle M. Douglass, PhD Post-doctoral researcher The Laboratory of Experimental Biophysics EPFL, Lausanne, Switzerland http://kmdouglass.github.io http://leb.epfl.ch |
From: Pablo C. <pc...@cn...> - 2018-03-09 15:39:44
|
Excellent! Just keep us on the loop if you struggle with something. On 09/03/18 14:00, Kyle Douglass wrote: > > Dear Pablo and Jose Miguel, > > Thank you very much for your help. The ability to generate a project > and workflow based on a JSON template is exactly what I was looking > for. I should furthermore be able to figure out the Python API from > the .py files you mentioned. > > Cheers, > > Kyle > > > On 03/09/2018 01:40 PM, Pablo Conesa wrote: >> >> Thanks Jose....additionally you can have a look to this: >> >> https://github.com/I2PC/scipion/wiki/Streaming-Processing#kicking-off-scipion-in-your-pipeline >> >> I've just added today since I had to explain this to a facilitiy >> manager that had the same /similar question >> >> Feel free to ask...this is that first version and it can be more >> clear., may be?. >> >> >> On 09/03/18 10:40, Jose Miguel de la Rosa Trevin wrote: >>> Hi Kyle, >>> >>> Unfortunately we haven't documented the API that well...this is a >>> pending task. >>> Nonetheless you have some developers documentation here: >>> https://github.com/I2PC/scipion/wiki/Developers-Page >>> I would recommend to take a look at the "How to create a protocol page": >>> https://github.com/I2PC/scipion/wiki/Creating-a-Protocol >>> >>> I will recommend to look at the Python code, specially the following: >>> - Object (basic wrapper around Python types that can be >>> stored/retrieved), pyworkflow/object.py >>> - Protocol (basic execution unit:Manager (to deal we projects): >>> pyworkflow/protocol/protocol.py >>> - Project (managing a given project) pyworkflow/project.py >>> - Manager: pyworkflow/manager.py >>> >>> Feel free to provide any feedback, >>> Best, >>> Jose Miguel >>> >>> >>> On Fri, Mar 9, 2018 at 11:15 AM, Kyle Douglass >>> <kyl...@ep... <mailto:kyl...@ep...>> wrote: >>> >>> Hi Jose Miguel, >>> >>> >>> On 03/09/2018 09:23 AM, Jose Miguel de la Rosa Trevin wrote: >>> >>>> You can easily do what you want in a Python script via our API. >>>> Basically you will need to create a new project and then load the >>>> given .json file. Take a look at the following example here: >>>> >>>> https://github.com/delarosatrevin/scipion-session/blob/f2ac1934f24ebcf0c3da205e9878eca86e4d80a4/aarhus/new-session-aarhus.py#L60 >>>> <https://github.com/delarosatrevin/scipion-session/blob/f2ac1934f24ebcf0c3da205e9878eca86e4d80a4/aarhus/new-session-aarhus.py#L60> >>>> >>> >>> Thanks for the swift response! Indeed, I think that this is the >>> solution I am looking for. >>> >>> Is the Python API documented anywhere, or should I focus on >>> extracting the main functions by looking at the Python code itself? >>> >>> Thanks again, >>> >>> Kyle >>> >>> -- >>> Kyle M. Douglass, PhD >>> Post-doctoral researcher >>> The Laboratory of Experimental Biophysics >>> EPFL, Lausanne, Switzerland >>> http://kmdouglass.github.io >>> http://leb.epfl.ch >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, Slashdot.org!http://sdm.link/slashdot >>> >>> >>> _______________________________________________ >>> scipion-users mailing list >>> sci...@li... >>> https://lists.sourceforge.net/lists/listinfo/scipion-users >> >> >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org!http://sdm.link/slashdot >> >> >> _______________________________________________ >> scipion-users mailing list >> sci...@li... >> https://lists.sourceforge.net/lists/listinfo/scipion-users > > -- > Kyle M. Douglass, PhD > Post-doctoral researcher > The Laboratory of Experimental Biophysics > EPFL, Lausanne, Switzerland > http://kmdouglass.github.io > http://leb.epfl.ch > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > > _______________________________________________ > scipion-users mailing list > sci...@li... > https://lists.sourceforge.net/lists/listinfo/scipion-users |
From: Yaiza R. <su...@bc...> - 2018-03-21 11:47:35
Attachments:
create_project_from_json.py
|
Hi Kyle, At the moment we don't have the option to do this straight away, however this is done in Scipion for our tutorials and it shouldn't be very difficult create a new script and adapt it to your needs. You can find the tutorials script in pyworkflow/apps/pw_tutorial.py, I recommend you to launch the intro tutorial and check the script to see how it's done (To launch the tutorial do: ./scipion tutorial intro). I've attached here a simple version that creates a new project from a json and opens it, you can maybe use it as a starting point. To run it from your scipion directory you can do: ./scipion python path/to/create_project_from_json.py [PROJECT_NAME] [PATH_TO_JSON] Hope this helps, let us know if you have further questions. Yaiza Rancel Scipion Team Activo Vie, 9 Marzo at 8:13 AM , Kyle Michael Douglass <kyl...@ep...> Escrito: Hi all, First-time Scipion user here (version 1.1). How would I create a new project and import a workflow from a .json file from the command line? I ask because my collaborators are using Scipion as part of a larger data analysis pipeline that extends beyond EM. At one point in this pipeline we want to automatically launch the Scipion GUI with a new project and import a workflow that has already been specified in a .json file. I know how to do this manually with the GUI, but it would be nice to have the new project and workflow setup via a script so we can easily vary some of the analysis parameters. Thanks a lot for the help. I would be happy to provide any additional information if necessary. Cheers, Kyle Dr. Kyle M. Douglass Post-doctoral Researcher EPFL - The Laboratory of Experimental Biophysics http://leb.epfl.ch/ http://kmdouglass.github.io |
From: Yaiza R. <su...@bc...> - 2018-03-21 13:05:49
|
Hi again Kyle, Sorry! We do have already a script to do this, it's in scripts/create_project.py, and you can use it like this: scipion python scripts/create_project.py name="session1234" workflow="path/to/your/workflow.json" Cheers, Yaiza Activo Mie, 21 Marzo at 12:47 PM , Yaiza Rancel <su...@bc...> Escrito: Hi Kyle, At the moment we don't have the option to do this straight away, however this is done in Scipion for our tutorials and it shouldn't be very difficult create a new script and adapt it to your needs. You can find the tutorials script in pyworkflow/apps/pw_tutorial.py, I recommend you to launch the intro tutorial and check the script to see how it's done (To launch the tutorial do: ./scipion tutorial intro). I've attached here a simple version that creates a new project from a json and opens it, you can maybe use it as a starting point. To run it from your scipion directory you can do: ./scipion python path/to/create_project_from_json.py [PROJECT_NAME] [PATH_TO_JSON] Hope this helps, let us know if you have further questions. Yaiza Rancel Scipion Team Activo Vie, 9 Marzo at 8:13 AM , Kyle Michael Douglass <kyl...@ep...> Escrito: Hi all, First-time Scipion user here (version 1.1). How would I create a new project and import a workflow from a .json file from the command line? I ask because my collaborators are using Scipion as part of a larger data analysis pipeline that extends beyond EM. At one point in this pipeline we want to automatically launch the Scipion GUI with a new project and import a workflow that has already been specified in a .json file. I know how to do this manually with the GUI, but it would be nice to have the new project and workflow setup via a script so we can easily vary some of the analysis parameters. Thanks a lot for the help. I would be happy to provide any additional information if necessary. Cheers, Kyle Dr. Kyle M. Douglass Post-doctoral Researcher EPFL - The Laboratory of Experimental Biophysics http://leb.epfl.ch/ http://kmdouglass.github.io |
From: Kyle D. <kyl...@ep...> - 2018-03-21 15:52:17
|
Hi Yaiza, No problem at all. In fact, I am using this script and it works perfectly ;) Thanks! Kyle On 03/21/2018 02:05 PM, Yaiza Rancel wrote: > Hi again Kyle, > > Sorry! We do have already a script to do this, it's in > scripts/create_project.py, and you can use it like this: > scipion python scripts/create_project.py name="session1234" > workflow="path/to/your/workflow.json" > Cheers, > Yaiza > > Activo Mie, 21 Marzo at 12:47 PM , Yaiza Rancel > <su...@bc...> Escrito: > Hi Kyle, > > At the moment we don't have the option to do this straight away, > however this is done in Scipion for our tutorials and it shouldn't > be very difficult create a new script and adapt it to your needs. > You can find the tutorials script in > pyworkflow/apps/pw_tutorial.py, I recommend you to launch the > intro tutorial and check the script to see how it's done (To > launch the tutorial do: ./scipion tutorial intro). > I've attached here a simple version that creates a new project > from a json and opens it, you can maybe use it as a starting > point. To run it from your scipion directory you can do: > > ./scipion python path/to/create_project_from_json.py > [PROJECT_NAME] [PATH_TO_JSON] > > Hope this helps, let us know if you have further questions. > > > Yaiza Rancel > Scipion Team > > Activo Vie, 9 Marzo at 8:13 AM , Kyle Michael Douglass > <kyl...@ep...> Escrito: > Hi all, > > First-time Scipion user here (version 1.1). How would I create > a new project and import a workflow from a .json file from the > command line? > > I ask because my collaborators are using Scipion as part of a > larger data analysis pipeline that extends beyond EM. At one > point in this pipeline we want to automatically launch the > Scipion GUI with a new project and import a workflow that has > already been specified in a .json file. I know how to do this > manually with the GUI, but it would be nice to have the new > project and workflow setup via a script so we can easily vary > some of the analysis parameters. > > Thanks a lot for the help. I would be happy to provide any > additional information if necessary. > > Cheers, > Kyle > > Dr. Kyle M. Douglass > Post-doctoral Researcher > EPFL - The Laboratory of Experimental Biophysics > http://leb.epfl.ch/ > http://kmdouglass.github.io > > 300:553135 -- Kyle M. Douglass, PhD Post-doctoral researcher The Laboratory of Experimental Biophysics EPFL, Lausanne, Switzerland http://kmdouglass.github.io http://leb.epfl.ch |