Skip to content
Snippets Groups Projects
Commit f6a5ab69 authored by George Marchment's avatar George Marchment
Browse files

Writing README

parent 4ba563e8
No related branches found
No related tags found
No related merge requests found
Pipeline #13138 passed with stage
in 43 seconds
# BioFlow-Insight
[![MIT licensed](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) [![Version 0.1](https://img.shields.io/badge/version-v0.1-yellow)]()
## Getting started
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.liris.cnrs.fr/sharefair/bioflow-insight.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.liris.cnrs.fr/sharefair/bioflow-insight/-/settings/integrations)
## Collaborate with your team
## Description
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
This repository contains the software **BioFlow-Insight** written in Python. **BioFlow-Insight** automatically analyses the code of Nextflow workflows and extracts useful information, particularly in the form of visual graphs depicting the workflow's structure and representing its different steps.
## Test and Deploy
**BioFlow-Insight** is easily installable as a Python package (see here). It is also accesible as a web service (see [here](https://bioflow-insight.pasteur.cloud/)).
Use the built-in continuous integration in GitLab.
<!--The outputs of **BioFlow-Insight** are saved in the results folder.-->
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
## Table of Contents
***
- [BioFlow-Insight](#bioflow-insight)
- [Description](#description)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
# Editing this README
## Installation
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
**BioFlow-Insight** is easily installable as a [Python package]()<!--TODO : Add LINK-->.
## Suggestions for a good README
To install it using *pip*, use the following command :
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
```
pip install bioflow-insight
```
## Name
Choose a self-explaining name for your project.
TODO
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Usage
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
**BioFlow-Insight** automatically analyses the code of Nextflow workflows and extracts useful information, particularly in the form of visual graphs depicting the workflow's structure and representing its different steps.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
For an explanation of the different elements composing a Nextflow workflow, see [its documentation](https://www.nextflow.io/docs/latest/index.html).
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
The 3 different graphs generated by **BioFlow-Insight** are :
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
1. The *specification graph* which represents all elements of the workflow, including processes and operations, and their interactions through channels. Within the specification graph, we define two types of operations: those without inputs and those with inputs (called branch operations).
2. The second graph represents operations without any inputs, along with processes and their dependencies. This graph, called the *dependency graph without branch operations*, is obtained by removing the branch operations and linking the remaining elements if a path exists between them in the original specification graph.
3. The final graph, called the *process dependency graph*, represents only processes and their dependencies. Similar to the latter, this graph is constructed by removing all operations, leaving only processes, and linking them based on their dependencies in the original specification graph.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
To examplify **BioFlow-Insight** utilisation, let's use the rnaseq-nf workflow proposed by Nextflow (its source code can be found [here](https://github.com/nextflow-io/rnaseq-nf/tree/8253a586cc5a9679d37544ac54f72167cced324b)).
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
In this example, we are going to use the **BioFlow-Insight** source code. After cloning both repositories (this one and the rnaseq-nf workflow), the working directory should look like this :
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
Guidelines for contributing to the project, including how to report issues and submit pull requests.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## License
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
This project is licensed under the [MIT License](https://opensource.org/licenses/MIT)
## License
For open source projects, say how it is licensed.
___
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
<img align="left" src="img/logo.png" width="16%">
<img align="left" src="img/paris_saclay.png" width="16%">
<img align="left" src="img/lisn.png" width="16%">
<img align="left" src="img/pasteur.png" width="16%">
<img align="left" src="img/sharefair.png" width="16%">
<img align="left" src="img/france2030.png" width="16%">
\ No newline at end of file
img/france2030.png

625 KiB

img/lisn.png

22.7 KiB

img/logo.png

92.2 KiB

img/paris_saclay.png

35.3 KiB

img/pasteur.png

76 KiB

img/sharefair.png

479 KiB

......@@ -10,7 +10,7 @@ class Graph():
def __init__(self, nextflow_file):
self.workflow = nextflow_file
self.full_dico = nextflow_file.get_structure()
with open(f"{self.get_output_dir()}/graphs/full_graph_dico_format.json", 'w') as output_file :
with open(f"{self.get_output_dir()}/graphs/specification_graph.json", 'w') as output_file :
json.dump(self.full_dico, output_file, indent=4)
#This dico give for the nodes its sister nodes
self.link_dico = None
......@@ -65,8 +65,8 @@ class Graph():
remove_node(self.full_dico, node_id)
self.get_graph_wo_branch_operations()
self.get_graph_wo_operations()
self.get_dependency_graph_wo_branch_operations()
self.get_process_dependency_graph()
#self.networkX_wo_operations = self.get_networkx_graph(self.dico_wo_operation, self.networkX_wo_operations)
......@@ -118,19 +118,19 @@ class Graph():
if(self.link_dico==None):
self.link_dico = initia_link_dico_rec(self.full_dico)
def get_full_graph(self, filename = "full_graph", render_graphs = True):
def get_specification_graph(self, filename = "specification_graph", render_graphs = True):
generate_graph(self.get_output_dir()/'graphs'/filename, self.full_dico, render_graphs = render_graphs)
def get_full_graph_wo_lables(self, filename = "full_graph_wo_labels", render_graphs = True):
def get_specification_graph_wo_lables(self, filename = "specification_graph_wo_labels", render_graphs = True):
generate_graph(self.get_output_dir()/'graphs'/filename, self.full_dico, label_edge=False, label_node=False, render_graphs = render_graphs)
def get_graph_wo_orphan_operations(self, filename = "graph_wo_orphan_operations", render_graphs = True):
def get_specification_graph_wo_orphan_operations(self, filename = "specification_wo_orphan_operations", render_graphs = True):
generate_graph(self.get_output_dir()/'graphs'/filename, graph_dico_wo_orphan_operations(self.full_dico), render_graphs = render_graphs)
def get_graph_wo_orphan_operations_wo_lables(self, filename = "graph_wo_orphan_operations_wo_labels", render_graphs = True):
def get_specification_graph_wo_orphan_operations_wo_lables(self, filename = "specification_wo_orphan_operations_wo_labels", render_graphs = True):
generate_graph(self.get_output_dir()/'graphs'/filename, graph_dico_wo_orphan_operations(self.full_dico), label_edge=False, label_node=False, render_graphs = render_graphs)
def get_graph_wo_operations(self):
def get_process_dependency_graph(self):
self.intia_link_dico()
#Function that replicates the workflow's structure wo the operations in the nodes
......@@ -192,15 +192,15 @@ class Graph():
self.dico_wo_operation = dico
with open(f"{self.get_output_dir()}/graphs/graph_wo_operations.json", 'w') as output_file :
with open(f"{self.get_output_dir()}/graphs/process_dependency_graph.json", 'w') as output_file :
json.dump(self.dico_wo_operation, output_file, indent=4)
def render_graph_wo_operations(self, filename = "graph_wo_operations", render_graphs = True):
def render_graph_wo_operations(self, filename = "process_dependency_graph", render_graphs = True):
generate_graph(self.get_output_dir()/'graphs'/filename, self.dico_wo_operation, render_graphs = render_graphs, label_edge=False, label_node=False)
def get_graph_wo_branch_operations(self):
def get_dependency_graph_wo_branch_operations(self):
self.intia_link_dico()
nodes_in_graph = []
branch_operation_ids = []
......@@ -261,20 +261,20 @@ class Graph():
add_edges(dico)
self.dico_wo_branch_operation = dico
with open(f"{self.get_output_dir()}/graphs/graph_wo_branch_operations.json", 'w') as output_file :
with open(f"{self.get_output_dir()}/graphs/dependency_graph_wo_branch_operations.json", 'w') as output_file :
json.dump(self.dico_wo_branch_operation, output_file, indent=4)
def render_graph_wo_branch_operations(self, filename = "graph_wo_branch_operations", render_graphs = True):
def render_dependency_graph_wo_branch_operations(self, filename = "dependency_graph_wo_branch_operations", render_graphs = True):
generate_graph(self.get_output_dir()/'graphs'/filename, self.dico_wo_branch_operation, render_graphs = render_graphs)
def get_graph_wo_branch_operations_wo_lables(self, filename = "graph_wo_branch_operations_wo_lables", render_graphs = True):
def get_dependency_graph_wo_branch_operations_wo_lables(self, filename = "dependency_graph_wo_branch_operations_wo_lables", render_graphs = True):
generate_graph(self.get_output_dir()/'graphs'/filename, self.dico_wo_branch_operation, label_edge=False, label_node=False, render_graphs = render_graphs)
def get_graph_wo_branch_operations_wo_orphan_operations(self, filename = "graph_wo_branch_operations_wo_orphan_operations", render_graphs = True):
def get_dependency_graph_wo_branch_operations_wo_orphan_operations(self, filename = "dependency_graph_wo_branch_operations_wo_orphan_operations", render_graphs = True):
generate_graph(self.get_output_dir()/'graphs'/filename, graph_dico_wo_orphan_operations(self.dico_wo_branch_operation), render_graphs = render_graphs)
def get_graph_wo_branch_operations_wo_orphan_operations_wo_lables(self, filename = "graph_wo_branch_operations_wo_orphan_operations_wo_lables", render_graphs = True):
def get_dependency_graph_wo_branch_operations_wo_orphan_operations_wo_lables(self, filename = "dependency_graph_wo_branch_operations_wo_orphan_operations_wo_lables", render_graphs = True):
generate_graph(self.get_output_dir()/'graphs'/filename, graph_dico_wo_orphan_operations(self.dico_wo_branch_operation), label_edge=False, label_node=False, render_graphs = render_graphs)
......@@ -425,22 +425,22 @@ class Graph():
return dico
def get_metadata_fullgraph(self):
def get_metadata_specification_graph(self):
dico = self.get_metadata(self.full_dico)
with open(self.get_output_dir()/ "graphs/metadata_full_graph.json", 'w') as output_file :
with open(self.get_output_dir()/ "graphs/metadata_specification_graph.json", 'w') as output_file :
json.dump(dico, output_file, indent=4)
def get_metadata_graph_wo_branch_operations(self):
def get_metadata_dependency_graph_wo_branch_operations(self):
dico = self.get_metadata(self.dico_wo_branch_operation)
with open(self.get_output_dir()/ "graphs/metadata_graph_wo_branch_operations.json", 'w') as output_file :
with open(self.get_output_dir()/ "graphs/metadata_dependency_graph_wo_branch_operations.json", 'w') as output_file :
json.dump(dico, output_file, indent=4)
def get_metadata_graph_wo_operations(self):
def get_metadata_process_dependency_graph(self):
dico = self.get_metadata(self.dico_wo_operation)
with open(self.get_output_dir()/ "graphs/metadata_graph_wo_operations.json", 'w') as output_file :
with open(self.get_output_dir()/ "graphs/metadata_process_dependency_graph.json", 'w') as output_file :
json.dump(dico, output_file, indent=4)
#def get_metadata_graph_wo_operations(self):
......
......@@ -201,10 +201,6 @@ class Nextflow_File(Nextflow_Building_Blocks):
pass
with open(self.output_dir / "debug" / "operations_in_call.nf",'w') as file:
pass
with open(self.output_dir / "graphs" / "full_graph_dico_format.json",'w') as file:
pass
with open(self.output_dir / "graphs" / "metadata_full_graph.json",'w') as file:
pass
self.DSL = self.which_DSL()
self.set_null()
......@@ -642,21 +638,21 @@ class Nextflow_File(Nextflow_Building_Blocks):
self.graph.initialise(processes_2_remove = processes_2_remove)
#Generate the different graphs
self.graph.get_full_graph(render_graphs = render_graphs)
self.graph.get_full_graph_wo_lables(render_graphs = render_graphs)
self.graph.get_specification_graph(render_graphs = render_graphs)
self.graph.get_specification_graph_wo_lables(render_graphs = render_graphs)
self.graph.render_graph_wo_operations(render_graphs = render_graphs)
self.graph.get_graph_wo_orphan_operations(render_graphs = render_graphs)
self.graph.get_graph_wo_orphan_operations_wo_lables(render_graphs = render_graphs)
self.graph.render_graph_wo_branch_operations(render_graphs = render_graphs)
self.graph.get_graph_wo_branch_operations_wo_lables(render_graphs = render_graphs)
self.graph.get_graph_wo_branch_operations_wo_orphan_operations(render_graphs = render_graphs)
self.graph.get_graph_wo_branch_operations_wo_orphan_operations_wo_lables(render_graphs = render_graphs)
self.graph.get_specification_graph_wo_orphan_operations(render_graphs = render_graphs)
self.graph.get_specification_graph_wo_orphan_operations_wo_lables(render_graphs = render_graphs)
self.graph.render_dependency_graph_wo_branch_operations(render_graphs = render_graphs)
self.graph.get_dependency_graph_wo_branch_operations_wo_lables(render_graphs = render_graphs)
self.graph.get_dependency_graph_wo_branch_operations_wo_orphan_operations(render_graphs = render_graphs)
self.graph.get_dependency_graph_wo_branch_operations_wo_orphan_operations_wo_lables(render_graphs = render_graphs)
#Generate the different metadata associated with the graphs
self.graph.get_metadata_fullgraph()
self.graph.get_metadata_graph_wo_branch_operations()
self.graph.get_metadata_graph_wo_operations()
self.graph.get_metadata_specification_graph()
self.graph.get_metadata_dependency_graph_wo_branch_operations()
self.graph.get_metadata_process_dependency_graph()
#def get_metadata_graph_wo_operations(self):
# self.graph.get_metadata_graph_wo_operations()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment