Skip to content

Commit

Permalink
[WIP] Initial porting of Infant-DWI - working main with minimal tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gagnonanthony committed Nov 17, 2024
1 parent 26f2e66 commit 29c9ae5
Show file tree
Hide file tree
Showing 785 changed files with 1,259,188 additions and 1,020 deletions.
16 changes: 8 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# nf/pediatric: Contributing Guidelines
# nf-pediatric: Contributing Guidelines

Hi there!
Many thanks for taking an interest in improving nf/pediatric.
Many thanks for taking an interest in improving nf-pediatric.

We try to manage the required tasks for nf/pediatric using GitHub issues, you probably came to this page when creating one.
We try to manage the required tasks for nf-pediatric using GitHub issues, you probably came to this page when creating one.
Please use the pre-filled template to save time.

However, don't be put off by this template - other more general issues and suggestions are welcome!
Contributions to the code are even more welcome ;)

## Contribution workflow

If you'd like to write some code for nf/pediatric, the standard workflow is as follows:
If you'd like to write some code for nf-pediatric, the standard workflow is as follows:

1. Check that there isn't already an issue about your idea in the [nf/pediatric issues](https://github.com/nf/pediatric/issues) to avoid duplicating work. If there isn't one already, please create one so that others know you're working on this
2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [nf/pediatric repository](https://github.com/nf/pediatric) to your GitHub account
1. Check that there isn't already an issue about your idea in the [nf-pediatric issues](https://github.com/nf-pediatric/issues) to avoid duplicating work. If there isn't one already, please create one so that others know you're working on this
2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [nf-pediatric repository](https://github.com/nf-pediatric) to your GitHub account
3. Make the necessary changes / additions within your forked repository following [Pipeline conventions](#pipeline-contribution-conventions)
4. Use `nf-core pipelines schema build` and add any new parameters to the pipeline JSON schema (requires [nf-core tools](https://github.com/nf-core/tools) >= 1.10).
5. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged
Expand Down Expand Up @@ -58,7 +58,7 @@ These tests are run both with the latest available version of `Nextflow` and als

## Pipeline contribution conventions

To make the nf/pediatric code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written.
To make the nf-pediatric code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written.

### Adding a new step

Expand Down Expand Up @@ -108,7 +108,7 @@ This repo includes a devcontainer configuration which will create a GitHub Codes

To get started:

- Open the repo in [Codespaces](https://github.com/nf/pediatric/codespaces)
- Open the repo in [Codespaces](https://github.com/nf-pediatric/codespaces)
- Tools installed
- nf-core
- Nextflow
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf/pediatric

- [ ] This comment contains a description of changes (with reason).
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf/pediatric/tree/master/.github/CONTRIBUTING.md)
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/gagnonanthony/nf-pediatric/tree/master/.github/CONTRIBUTING.md)
- [ ] Make sure your code lints (`nf-core pipelines lint`).
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir <OUTDIR>`).
Expand Down
28 changes: 10 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: nf-core CI
name: nf-pediatric CI
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
on:
push:
Expand All @@ -22,15 +22,16 @@ jobs:
test:
name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }})"
# Only run on push if this is the nf-core dev branch (merged PRs)
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf/pediatric') }}"
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-pediatric') }}"
runs-on: ubuntu-latest
strategy:
matrix:
NXF_VER:
- "24.04.2"
- "latest-everything"
nf-test-version:
- "0.9.0"
profile:
- "conda"
- "docker"
- "singularity"
test_name:
Expand All @@ -52,6 +53,12 @@ jobs:
with:
version: "${{ matrix.NXF_VER }}"

- uses: AlexVCaron/setup-nf-test@2c5a31b90b34d97abf155b57ee0f79c7f5aa118a
# Used to make the action executable on our runners. Related to how the home
# and work directories are set up from ephemeral disks. See nf-core/setup-nf-test/issues/6
with:
version: ${{ matrix.nf_test_version }}

- name: Set up Apptainer
if: matrix.profile == 'singularity'
uses: eWaterCycle/setup-apptainer@main
Expand All @@ -62,21 +69,6 @@ jobs:
mkdir -p $NXF_SINGULARITY_CACHEDIR
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
- name: Set up Miniconda
if: matrix.profile == 'conda'
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
with:
miniconda-version: "latest"
auto-update-conda: true
conda-solver: libmamba
channels: conda-forge,bioconda

- name: Set up Conda
if: matrix.profile == 'conda'
run: |
echo $(realpath $CONDA)/condabin >> $GITHUB_PATH
echo $(realpath python) >> $GITHUB_PATH
- name: Clean up Disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.nextflow*
work/
data/
results/
.DS_Store
testing/
testing*
*.pyc
null/
.nf-test*
2 changes: 1 addition & 1 deletion .nf-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ repository_type: pipeline
template:
author: Anthony Gagnon
description: nf-pediatric is a neuroimaging pipeline to process pediatric MRI data
(including fMRI, dMRI, and sMRI) ranging from 0-18 years old.
(dMRI, and sMRI) ranging from 0-18 years old.
force: false
is_nfcore: false
name: pediatric
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf/pediatric: Changelog
# nf-pediatric: Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
Expand Down
30 changes: 18 additions & 12 deletions CITATIONS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nf/pediatric: Citations
# nf-pediatric: Citations

## [nf-core](https://pubmed.ncbi.nlm.nih.gov/32055031/)

Expand All @@ -10,27 +10,33 @@
## Pipeline tools

- [FastQC](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)
- [scilpy](https://github.com/scilus/scilpy)

> Andrews, S. (2010). FastQC: A Quality Control Tool for High Throughput Sequence Data [Online].
- [Mrtrix](https://www.mrtrix.org/)

- [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/)
> Tournier, J.-D., Smith, R., Raffelt, D., Tabbara, R., Dhollander, T., Pietsch, M., Christiaens, D., Jeurissen, B., Yeh, C.-H., & Connelly, A. (2019). MRtrix3: A fast, flexible and open software framework for medical image processing and visualisation. NeuroImage, 202, 116137. https://doi.org/10.1016/j.neuroimage.2019.116137
> Ewels P, Magnusson M, Lundin S, Käller M. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics. 2016 Oct 1;32(19):3047-8. doi: 10.1093/bioinformatics/btw354. Epub 2016 Jun 16. PubMed PMID: 27312411; PubMed Central PMCID: PMC5039924.
- [FSL](https://fsl.fmrib.ox.ac.uk/fsl/docs/#/)

## Software packaging/containerisation tools
> Jenkinson, M., Beckmann, C. F., Behrens, T. E. J., Woolrich, M. W., & Smith, S. M. (2012). FSL. NeuroImage, 62(2), 782–790. https://doi.org/10.1016/j.neuroimage.2011.09.015
- [Anaconda](https://anaconda.com)
- [ANTs](https://antsx.github.io/ANTs/)

> Anaconda Software Distribution. Computer software. Vers. 2-2.4.0. Anaconda, Nov. 2016. Web.
> Tustison, N. J., Cook, P. A., Holbrook, A. J., Johnson, H. J., Muschelli, J., Devenyi, G. A., Duda, J. T., Das, S. R., Cullen, N. C., Gillen, D. L., Yassa, M. A., Stone, J. R., Gee, J. C., & Avants, B. B. (2021). The ANTsX ecosystem for quantitative biological and medical imaging. Scientific Reports, 11(1), 9068. https://doi.org/10.1038/s41598-021-87564-6
- [Bioconda](https://pubmed.ncbi.nlm.nih.gov/29967506/)
- [FastSurfer](https://deep-mi.org/research/fastsurfer/)

> Grüning B, Dale R, Sjödin A, Chapman BA, Rowe J, Tomkins-Tinch CH, Valieris R, Köster J; Bioconda Team. Bioconda: sustainable and comprehensive software distribution for the life sciences. Nat Methods. 2018 Jul;15(7):475-476. doi: 10.1038/s41592-018-0046-7. PubMed PMID: 29967506.
> Henschel, L., Conjeti, S., Estrada, S., Diers, K., Fischl, B., & Reuter, M. (2020). FastSurfer—A fast and accurate deep learning based neuroimaging pipeline. NeuroImage, 219, 117012. https://doi.org/10.1016/j.neuroimage.2020.117012
- [BioContainers](https://pubmed.ncbi.nlm.nih.gov/28379341/)
- [FreeSurfer](https://surfer.nmr.mgh.harvard.edu/)

> da Veiga Leprevost F, Grüning B, Aflitos SA, Röst HL, Uszkoreit J, Barsnes H, Vaudel M, Moreno P, Gatto L, Weber J, Bai M, Jimenez RC, Sachsenberg T, Pfeuffer J, Alvarez RV, Griss J, Nesvizhskii AI, Perez-Riverol Y. BioContainers: an open-source and community-driven framework for software standardization. Bioinformatics. 2017 Aug 15;33(16):2580-2582. doi: 10.1093/bioinformatics/btx192. PubMed PMID: 28379341; PubMed Central PMCID: PMC5870671.
> Fischl, B. (2012). FreeSurfer. NeuroImage, 62(2), 774–781. https://doi.org/10.1016/j.neuroimage.2012.01.021
- [MultiQC](https://pubmed.ncbi.nlm.nih.gov/27312411/)

> Ewels P, Magnusson M, Lundin S, Käller M. MultiQC: summarize analysis results for multiple tools and samples in a single report. Bioinformatics. 2016 Oct 1;32(19):3047-8. doi: 10.1093/bioinformatics/btw354. Epub 2016 Jun 16. PubMed PMID: 27312411; PubMed Central PMCID: PMC5039924.
## Software packaging/containerisation tools

- [Docker](https://dl.acm.org/doi/10.5555/2600239.2600241)

Expand Down
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,18 @@
[![nf-test](https://img.shields.io/badge/unit_tests-nf--test-337ab7.svg)](https://www.nf-test.com)

[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A524.04.2-23aa62.svg)](https://www.nextflow.io/)
[![run with conda](http://img.shields.io/badge/run%20with-conda-3EB049?labelColor=000000&logo=anaconda)](https://docs.conda.io/en/latest/)
[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)
[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)
[![Launch on Seqera Platform](https://img.shields.io/badge/Launch%20%F0%9F%9A%80-Seqera%20Platform-%234256e7)](https://cloud.seqera.io/launch?pipeline=https://github.com/nf/pediatric)

## Introduction

**nf/pediatric** is a bioinformatics pipeline that ...

<!-- TODO nf-core:
Complete this sentence with a 2-3 sentence summary of what types of data the pipeline ingests, a brief overview of the
major pipeline sections and the types of output it produces. You're giving an overview to someone new
to nf-core here, in 15-20 seconds. For an example, see https://github.com/nf-core/rnaseq/blob/master/README.md#introduction
-->
**nf-pediatric** is an end-to-end connectomics pipeline for pediatric (0-18y) dMRI and sMRI brain scans. It performs tractography, t1 reconstruction, cortical and subcortical segmentation, and connectomics. Final outputs are connectivity matrices for a variety of diffusion (or not) related metrics. Here is a detail list of the default pipeline steps:

<!-- TODO nf-core: Include a figure that guides the user through the major workflow steps. Many nf-core
workflows use the "tube map" design for that. See https://nf-co.re/docs/contributing/design_guidelines#examples for examples. -->
<!-- TODO nf-core: Fill in short bullet-pointed list of the default steps in the pipeline -->

1. Read QC ([`FastQC`](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/))
1.
2. Present QC for raw reads ([`MultiQC`](http://multiqc.info/))

## Usage
Expand Down Expand Up @@ -64,7 +56,7 @@ nextflow run nf/pediatric \
## Credits

nf/pediatric was originally written by Anthony Gagnon.
nf-pediatric was originally written by Anthony Gagnon.

We thank the following people for their extensive assistance in the development of this pipeline:

Expand Down
20 changes: 20 additions & 0 deletions assets/FS_BN_GL_SF_utils/convert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python
import sys
import json

with open(sys.argv[1]) as f:
content = f.readlines()

content = [x.strip().split() for x in content]
print(len(content))
dict_data = {}
for line in content:
if line and line[0].isnumeric():
print(line)
if '_RH_' in line[1]:
dict_data['rh.'+line[1]] = line[0]
elif '_LH_' in line[1]:
dict_data['lh.'+line[1]] = line[0]

with open(sys.argv[1].replace('txt', 'json'), 'w') as outfile:
json.dump(dict_data, outfile, indent=2)
Loading

0 comments on commit 29c9ae5

Please sign in to comment.