Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I add a new feature to the pipeline? #130

Closed
PhilPalmer opened this issue Jun 24, 2020 · 0 comments
Closed

How can I add a new feature to the pipeline? #130

PhilPalmer opened this issue Jun 24, 2020 · 0 comments
Labels
feature:nextflow question Further information is requested

Comments

@PhilPalmer
Copy link
Contributor

PhilPalmer commented Jun 24, 2020

Optional: Set up a development environment

It can be useful to set up a development environment where you have access to a modern IDE such as Visual Studio (VS) Code rather than a plain text editor on Sumner such as vim or nano on Sumner. IDEs contain more features and generally make writing code more enjoyable. This may make sense to setup on macOS or Linux but may be more difficult or even not worth doing on Windows.

  1. Install VS Code
  2. Install Git & configure your credentials
  3. Download Nextflow
curl -s https://get.nextflow.io | bash
sudo mv nextflow /usr/local/bin

1) Make an issue

Make sure the feature you plan to develop exists as an issue so that others can be made aware of it, as this will allow others to comment. The issue should ideally include the following:

  1. A clear explanation of the problem
  2. The solution to the problem
  3. Details of the implementation

2) Make a branch

The following will enable you to "checkout" to your own branch or version of the pipeline where you can make your own changes without affecting the main branch which is used by everyone for their analyses. You will need to make sure you have git cloned the pipeline prior to doing these steps if you haven't done so already

cd /path/to/splicing-pipelines-nf # go to the repository directory
git checkout master # to make sure you're on the main branch
git pull # to fetch latest updates
git checkout -b <your_name>-<feature-name> # eg phil-update-rmats

If you have any issues with conflicts when trying to git pull. You may need to run git stash to stash or save your local changes

3) Implement the feature

Some useful advice for developing features is to:

  • Create a minimum reproducible example - For big features, it can be easiest to start with the minimum amount of code required. To do this you could either temporarily remove or comment out parts of the code that you do not need or even start a small test script from scratch
  • Develop small chunks at a time - having as small iterations as possible
  • Keep running small tests
  • Commit & push to GitHub often

After each small change that you have added you may want to do the following:

git status # to see all the files you've changed
git add <file_that_you_have_changed> # to add the changes files
git commit -m "Description of the changes you've made"
git push # to push the changes to GitHub so others can view the changes

4) Test it

Once you're happy with the changes that you've made you can conduct a real test on Sumner

cd /projects/anczukow-lab/splicing_pipeline/splicing-pipelines-nf # go to the repo directory
git checkout <your_name>-<feature-name> # checkout your feature branch
sbatch main.pbs # test feature

5) Merge with the master branch

Finally, you can make a pull request, get anyone to review the changes you've made (recommended) and merge your changes into the main master branch 🎉

@PhilPalmer PhilPalmer added question Further information is requested feature:nextflow labels Jun 24, 2020
@cgpu cgpu pinned this issue Feb 8, 2021
@cgpu cgpu closed this as completed Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:nextflow question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants