diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 284c2988..04df94af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,7 @@ env: jobs: build: runs-on: ubuntu-latest + timeout-minutes: 2 strategy: matrix: python-version: ["3.9"] diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 18228e90..e2403bf7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,27 +1,89 @@ -name: mkdocs_build +name: docs on: workflow_dispatch: + release: + types: + - published push: branches: - main paths: - "docs/**" + - "**.md" + - .github/workflows/docs.yml + - mkdocs.yml + pull_request: + branches: + - main + paths: + - "docs/**" + - "**.md" + - .github/workflows/docs.yml + - mkdocs.yml env: actor: "41898282+github-actions[bot]" + GH_TOKEN: ${{ github.token }} jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 with: - python-version: 3.9 + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: 3.11 + cache: pip + - run: pip install --upgrade pip -r docs/requirements.txt - name: git config run: | git config --local user.email "${actor}@users.noreply.github.com" git config --local user.name "$actor" - - run: pip install --upgrade pip - - run: pip install -r docs/requirements.txt - - run: mkdocs gh-deploy --force + gh release list > releases.tsv + - name: get version tag & alias + shell: python {0} + run: | + import os + import re + import warnings + + release_tag = '' + with open('releases.tsv', 'r') as infile: + for line in infile: + release_name, latest, tag, timestamp = line.strip().split('\t') + if latest == "Latest": + release_tag = tag.strip('v') + break + if not release_tag: + warnings.warn("No latest release found") + + with open('VERSION', 'r') as infile: + current_version = infile.read().strip() + + if current_version == release_tag: + docs_alias = 'latest' + docs_version = release_tag + else: + semver_pattern = '(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?' + release_semver = re.match(semver_pattern, release_tag) + current_semver = re.match(semver_pattern, current_version) + + groups = ['major', 'minor', 'patch'] + if current_semver.group('prerelease') and any([current_semver.group(grp) >= release_semver.group(grp) for grp in groups]): + docs_alias = '' + docs_version = 'dev' + else: + raise ValueError(f"current version {current_version} is not greater than latest release {release_tag}") + + with open(os.getenv("GITHUB_ENV"), 'a') as out_env: + out_env.write(f"VERSION={docs_version}\n") + out_env.write(f"ALIAS={docs_alias}\n") + + - name: deploy docs + run: | + mike deploy ${{ env.VERSION }} ${{ env.ALIAS }} \ + --push \ + --update-aliases \ + --branch gh-pages diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml new file mode 100644 index 00000000..899f0be6 --- /dev/null +++ b/.github/workflows/draft-release.yml @@ -0,0 +1,150 @@ +name: draft-release + +on: + workflow_dispatch: + inputs: + version_tag: + description: | + Semantic version tag for next release. + If not provided, it will be determined based on conventional commit history. + Example: v2.5.11 + required: false + type: string + default: "" + +env: + GH_TOKEN: ${{ github.token }} + BRANCH: release-draft + +jobs: + draft-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # required to include tags + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: "pip" + - run: pip install cffconvert>=2.0.0 pyyaml + + - name: Get Date + run: | + echo "DATE=$(date +"%Y-%m-%d")" >> "$GITHUB_ENV" + + - name: Get current and next versions + id: semver + uses: ietf-tools/semver-action@v1 + with: + token: ${{ github.token }} + branch: ${{ github.ref_name }} + + - name: Set version variables + shell: python {0} + run: | + import os + import re + import warnings + + convco_version = "${{ steps.semver.outputs.next }}" + if "${{ github.event_name }}" == 'workflow_dispatch' and "${{ github.event.inputs.version_tag }}": + next_version = "${{ github.event.inputs.version_tag }}" + if next_version != convco_version: + warnings.warn(f"Manual version ({next_version}) not equal to version determined by conventional commit history ({convco_version})") + else: + next_version = convco_version + + with open(os.getenv("GITHUB_ENV"), 'a') as out_env: + out_env.write(f"NEXT_VERSION={next_version}\n") + out_env.write(f"NEXT_STRICT={next_version.strip('v')}\n") + current_version = "${{ steps.semver.outputs.current }}" + + # assert semantic version pattern + semver_pattern = 'v(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?' + next_semver = re.match(semver_pattern, next_version) + if not next_semver: + extra_msg = '' + if not next_version.startswith('v'): + extra_msg = "The tag does not start with 'v'." + raise ValueError(f"Tag {next_version} does not match semantic versioning guidelines. {extra_msg}\nView the guidelines here: https://semver.org/") + + # assert next version is only 1 greater than current + current_semver = re.match(semver_pattern, current_version) + groups = ['major', 'minor', 'patch'] + greater = sum([next_semver.group(grp) > current_semver.group(grp) for grp in groups]) + if not (greater == 1): + raise ValueError(f"Next version must only increment one number at a time. Current version: {current_version}. Proposed next version: {next_version}") + + - name: Get release notes, update changelog & version file + shell: python {0} + run: | + import os + latest_version = "${{ steps.semver.outputs.current }}".strip('v') + next_version = "${{ env.NEXT_STRICT }}" + + changelog_lines = list() + next_release_lines = list() + for_next = True + with open("CHANGELOG.md", "r") as infile: + for line in infile: + if line.startswith('#') and 'development version' in line: + line = line.replace('development version', next_version) + elif latest_version in line: + for_next = False + + changelog_lines.append(line) + if for_next and next_version not in line: + next_release_lines.append(line) + + with open(".github/latest-release.md", "w") as outfile: + outfile.writelines(next_release_lines) + with open('CHANGELOG.md', 'w') as outfile: + outfile.writelines(changelog_lines) + with open("VERSION", "w") as outfile: + outfile.write(f"{next_version}\n") + + - name: Update citation + shell: python {0} + run: | + from cffconvert.cli.create_citation import create_citation + from cffconvert.cli.validate_or_write_output import validate_or_write_output + import yaml + + citation = create_citation('CITATION.cff', None) + citation._implementation.cffobj['version'] = "${{ env.NEXT_VERSION }}" + citation._implementation.cffobj['date-released'] = "${{ env.DATE }}" + with open('CITATION.cff', 'w') as outfile: + outfile.write(yaml.dump(citation._implementation.cffobj, sort_keys=False, indent=2)) + + - uses: pre-commit/action@v3.0.0 + with: + extra_args: --files CITATION.cff CHANGELOG.md VERSION + continue-on-error: true + + - name: Commit & push to branch + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git push origin --delete ${{ env.BRANCH }} || echo "No ${{ env.BRANCH }} branch to delete" + git switch -c ${{ env.BRANCH }} || git switch ${{ env.BRANCH }} + git merge --ff-only ${{ github.ref_name }} + + git add CITATION.cff CHANGELOG.md VERSION + git commit -m 'chore: prepare release ${{ env.NEXT_VERSION }}' + git push --set-upstream origin ${{ env.BRANCH }} + + echo "COMMIT_HASH=$(git rev-parse HEAD)" >> "$GITHUB_ENV" + + - name: Tag & draft release + run: | + gh release create ${{ env.NEXT_VERSION }} \ + --draft \ + --notes-file .github/latest-release.md \ + --target ${{ env.COMMIT_HASH }} \ + --title "${{ github.event.repository.name }} ${{ env.NEXT_STRICT }}" + + - name: Next steps + run: | + echo "Next steps: Take a look at the changes in the ${{ env.BRANCH }} branch and the release notes on the web. If everything is correct, publish the release. Otherwise, delete the release draft and cut the release manually." diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml new file mode 100644 index 00000000..e3e8bd09 --- /dev/null +++ b/.github/workflows/post-release.yml @@ -0,0 +1,56 @@ +name: post-release + +on: + release: + types: + - published + +env: + GH_TOKEN: ${{ github.token }} + BRANCH: release/${{ github.ref_name }} + +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Configure git + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git push origin --delete ${{ env.BRANCH }} || echo "No ${{ env.BRANCH }} branch to delete" + git switch -c ${{ env.BRANCH }} + - name: Bump changelog & version + shell: python {0} + run: | + with open("CHANGELOG.md", "r") as infile: + lines = infile.readlines() + lines.insert(0, "## ${{ github.event.repository.name }} development version\n\n") + with open("CHANGELOG.md", "w") as outfile: + outfile.writelines(lines) + + with open('VERSION', 'r') as infile: + version = infile.read().strip() + with open('VERSION', 'w') as outfile: + outfile.write(f"{version}-dev\n") + + - uses: pre-commit/action@v3.0.0 + with: + extra_args: --files CITATION.cff CHANGELOG.md VERSION + continue-on-error: true + + - name: Open pull request + run: | + git add CHANGELOG.md VERSION + git commit -m "chore: bump changelog & version after release of ${{ github.ref_name }}" + git push --set-upstream origin ${{ env.BRANCH }} + + gh pr create \ + --fill-first \ + --reviewer ${{ github.triggering_actor }} + + - name: Clean up release-draft branch + run: | + git push origin --delete release-draft || echo "No release-draft branch to delete" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11ed0a79..12dc3730 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,8 @@ default_stages: [pre-commit] exclude: | (?x)( ^assets/| - ^docs/.*.html + ^docs/.*.html| + ^_extensions/ ) repos: - repo: https://github.com/pre-commit/pre-commit-hooks @@ -12,6 +13,7 @@ repos: - id: check-added-large-files - id: end-of-file-fixer - id: trailing-whitespace + - id: check-json # spell check - repo: https://github.com/codespell-project/codespell rev: v2.2.4 diff --git a/.prettierrc b/.prettierrc index d04c3f1e..81ee40a0 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,4 +1,7 @@ overrides: - - files: "*.md" - options: - tabWidth: 2 + - files: + - "*.md" + - "*.cff" + - ".prettierrc" + options: + tabWidth: 2 diff --git a/CHANGELOG.md b/CHANGELOG.md index d8a81fa7..6aaad7c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,18 @@ -## development version +## CHAMPAGNE development version + +- Fix configuration files for compatibility with using the GitHub repo as the source. (#173, @kelly-sovacool) + - These equivalent commands now work: + ```sh + nextflow run CCBR/CHAMPAGNE + champagne run --main CCBR/CHAMPAGNE + ``` +- Allow multiple samples to use the same input. (#176, @kelly-sovacool) +- Allow additional columns in the sample sheet beyond the minimum required header. (#176, @kelly-sovacool) +- Change the peak widths histogram type from overlay to stack. (#176, @kelly-sovacool) +- Add a workflow entry point to download fastq files from SRA. (#176, @kelly-sovacool) +- Add `test_human` profile with chipseq data from ENCODE. (#176, @kelly-sovacool) + +## CHAMPAGNE 0.3.0 ### New features @@ -6,12 +20,14 @@ - Run motif enrichment analysis with MEME. (#142) - Annotate peaks with chipseeker. (#142,#147,#157) - Add preseq complexity curve and fastq screen to multiqc report. (#147) -- Print the recommended citation in bibtex format with `champagne --citation`. (#153) - Support multiple replicates per sample and call consensus peaks on replicates. (#129) - Optionally normalize p-values with the [CCBR/consensus_peaks](https://github.com/CCBR/nf-modules/tree/60d50f4c45a50378cad70b49013f51750617caaa/subworkflows/CCBR/consensus_peaks) subworkflow. - Implement differential peak calling. (#158) - Optionally specify contrasts via a YAML file. If no file is specified, differential analysis is not performed. - If any sample has only one replicate, run `MAnorm`, otherwise run `diffbind`. +- Print the recommended citation in bibtex format with `champagne --citation`. (#153) + - CHAMPAGNE is also now archived in Zenodo with DOI `10.5281/zenodo.10516078`. +- The docs website now has a dropdown menu to select which version to view. The latest release is shown by default. (#170) ### Bug fixes @@ -21,12 +37,17 @@ - Protein-coding-only versions of plots. - Ensure sample IDs are sorted. (#150) - Fix a bug where the wrong SICER output file was used for downstream analyses. (#155) +- Fix CLI profile on machines other than biowulf & FRCE. (#168) +- Fix broken bold styling in documentation website. (#53) + +## CHAMPAGNE 0.2.2 +- Fix permissions issues in the CLI. (#167) ## CHAMPAGNE 0.2.1 -- Fixed a bug in QC stats that mixed up the statistics for different samples. (#125) -- Fixed a bug in the CLI that added the `-profile` to the nextflow command even if it wasn't needed (#125). +- Fix a bug in QC stats that mixed up the statistics for different samples. (#125) +- Fix a bug in the CLI that added the `-profile` to the nextflow command even if it wasn't needed (#125). - Report read counts between blacklist & filtering steps in the QC table. (#125) - Run spooker on workflow completion (#126). @@ -34,14 +55,14 @@ ### New features -- Implemented peak calling with sicer2, macs2, and gem. (#52) -- Added parameter options to skip QC, input normalization, and/or peak calling steps. (#72) +- Implement peak calling with sicer2, macs2, and gem. (#52) +- Add parameter options to skip QC, input normalization, and/or peak calling steps. (#72) - Calculate and plot QC metrics for called peaks: - Fraction in Peaks (FRiP) (#89) - Jaccard index (#92) - Histogram of peak widths (#92) -- Added support for paired-end reads. (#105) -- Added an option to use a custom reference from a genome fasta, gtf, and blacklist file. (#105) +- Add support for paired-end reads. (#105) +- Add an option to use a custom reference from a genome fasta, gtf, and blacklist file. (#105) - Champagne CLI: (#112) - New `--mode` option for `champagne run` to execute the workflow locally ('local') or submit it as a slurm job ('slurm'). - Option to override the path to the champagne `main.nf` file or specify the github repo (`CCBR/CHAMPAGNE`) instead. diff --git a/CITATION.cff b/CITATION.cff index 756047e6..f1863f3f 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,13 +1,24 @@ cff-version: 1.2.0 -message: "Please cite CHAMPAGNE as below." +message: Please cite CHAMPAGNE as below. authors: - - family-names: Sovacool - given-names: Kelly - orcid: https://orcid.org/0000-0003-3283-829X - - family-names: Koparde - given-names: Vishal - orcid: https://orcid.org/0000-0001-8978-8495 -title: "CHAMPAGNE: CHromAtin iMmuno PrecipitAtion sequencinG aNalysis pipEline" +- family-names: Sovacool + given-names: Kelly + orcid: https://orcid.org/0000-0003-3283-829X + affiliation: Advanced Biomedical Computational Science, Frederick National Laboratory + for Cancer Research, Frederick, MD 21702, USA +- family-names: Koparde + given-names: Vishal + orcid: https://orcid.org/0000-0001-8978-8495 + affiliation: Advanced Biomedical Computational Science, Frederick National Laboratory + for Cancer Research, Frederick, MD 21702, USA +title: 'CHAMPAGNE: CHromAtin iMmuno PrecipitAtion sequencinG aNalysis pipEline' url: https://ccbr.github.io/CHAMPAGNE/ repository-code: https://github.com/CCBR/CHAMPAGNE license: MIT +type: software +identifiers: +- description: Archived snapshots of all versions + type: doi + value: 10.5281/zenodo.10516079 +version: v0.3.0 +date-released: '2024-01-18' diff --git a/README.md b/README.md index f0bb704f..ca23c3e9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![build](https://github.com/CCBR/CHAMPAGNE/actions/workflows/build.yml/badge.svg)](https://github.com/CCBR/CHAMPAGNE/actions/workflows/build.yml) [![mkdocs](https://github.com/CCBR/CHAMPAGNE/actions/workflows/docs.yml/badge.svg)](https://github.com/CCBR/CHAMPAGNE/actions/workflows/docs.yml) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10516079.svg)](https://doi.org/10.5281/zenodo.10516079) 🚧 **This project is under active development. It is not yet ready for production use.** 🚧 diff --git a/VERSION b/VERSION index 192232a9..d5109100 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.2-dev +0.3.0-dev diff --git a/assets/ccbr_logo.png b/assets/ccbr_logo.png index 428465a2..bfa8c1a4 100644 Binary files a/assets/ccbr_logo.png and b/assets/ccbr_logo.png differ diff --git a/assets/contrasts_test_dcssim.yml b/assets/contrasts_test_dcssim.yml deleted file mode 100644 index cc4042b7..00000000 --- a/assets/contrasts_test_dcssim.yml +++ /dev/null @@ -1,5 +0,0 @@ -condition: - control: - - sample1 - treatment: - - sample2 diff --git a/assets/contrasts_test_dcssub.yml b/assets/contrasts_test_dcssub.yml deleted file mode 100644 index cc4042b7..00000000 --- a/assets/contrasts_test_dcssub.yml +++ /dev/null @@ -1,5 +0,0 @@ -condition: - control: - - sample1 - treatment: - - sample2 diff --git a/assets/samplesheet_test_dcssim.csv b/assets/samplesheet_test_dcssim.csv deleted file mode 100644 index 30e3ff60..00000000 --- a/assets/samplesheet_test_dcssim.csv +++ /dev/null @@ -1,7 +0,0 @@ -sample,rep,fastq_1,fastq_2,antibody,control -sample1_INPUT,,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsim/set1_1/mm10_chr19_sharp_50u50d_sample1-INPUT.fq.gz,,, -sample1,1,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsim/set1_1/mm10_chr19_sharp_50u50d_sample1-rep1.fq.gz,,TF,sample1_INPUT -sample1,2,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsim/set1_1/mm10_chr19_sharp_50u50d_sample1-rep2.fq.gz,,TF,sample1_INPUT -sample2_INPUT,,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsim/set1_1/mm10_chr19_sharp_50u50d_sample2-INPUT.fq.gz,,, -sample2,1,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsim/set1_1/mm10_chr19_sharp_50u50d_sample2-rep1.fq.gz,,TF,sample2_INPUT -sample2,2,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsim/set1_1/mm10_chr19_sharp_50u50d_sample2-rep2.fq.gz,,TF,sample2_INPUT diff --git a/assets/samplesheet_test_dcssub.csv b/assets/samplesheet_test_dcssub.csv deleted file mode 100644 index 04c792cf..00000000 --- a/assets/samplesheet_test_dcssub.csv +++ /dev/null @@ -1,7 +0,0 @@ -sample,rep,fastq_1,fastq_2,antibody,control -sample1,1,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsub/results/bam2fastq/mm10_chr19_C18_50u50d_sample1-rep1_R1.fastq.gz,,cebpa,sample1_INPUT -sample1,2,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsub/results/bam2fastq/mm10_chr19_C18_50u50d_sample1-rep2_R1.fastq.gz,,cebpa,sample1_INPUT -sample2,1,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsub/results/bam2fastq/mm10_chr19_C18_50u50d_sample2-rep1_R1.fastq.gz,,cebpa,sample2_INPUT -sample2,2,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsub/results/bam2fastq/mm10_chr19_C18_50u50d_sample2-rep2_R1.fastq.gz,,cebpa,sample2_INPUT -sample1_INPUT,,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsub/results/bam2fastq/mm10_chr19_C18_50u50d_sample1-INPUT_R1.fastq.gz,,, -sample2_INPUT,,/data/CCBR_Pipeliner/testdata/CHAMPAGNE/DCSsub/results/bam2fastq/mm10_chr19_C18_50u50d_sample2-INPUT_R1.fastq.gz,,, diff --git a/bin/chipseeker_annotate.R b/bin/chipseeker_annotate.R index c8db7285..142e84d0 100755 --- a/bin/chipseeker_annotate.R +++ b/bin/chipseeker_annotate.R @@ -14,6 +14,7 @@ parser$add_argument("-t", "--toppromoterpeaks", required = FALSE, type = "intege parser$add_argument("-o", "--outfile-prefix", required = TRUE, type = "character", dest = "outfile_prefix", help = "prefix for output filenames") parser$add_argument("--genome-txdb", dest = "txdb", required = TRUE, help = "BioConductor TxDb package, e.g. TxDb.Hsapiens.UCSC.hg38.knownGene") parser$add_argument("--genome-annot", dest = "adb", required = TRUE, help = "BioConductor annotation package, e.g. org.Hs.eg.db") +parser$add_argument("--cores", required = TRUE, type = "integer", help = "Number of cores to use") # get command line options, if help option encountered print help and exit, # otherwise if options not found on command line then set defaults, diff --git a/conf/biowulf.config b/conf/biowulf.config index 78b3f05d..4ce63599 100644 --- a/conf/biowulf.config +++ b/conf/biowulf.config @@ -12,7 +12,7 @@ params { // CCBR shared resource paths index_dir = '/data/CCBR_Pipeliner/db/PipeDB/Indices' fastq_screen { - conf = "assets/fastq_screen_biowulf.conf" + conf = "${projectDir}/assets/fastq_screen_biowulf.conf" db_dir = '/data/CCBR_Pipeliner/db/PipeDB/lib/fastq_screen_db/' } } diff --git a/conf/frce.config b/conf/frce.config index 4f132a81..a6510294 100644 --- a/conf/frce.config +++ b/conf/frce.config @@ -7,7 +7,7 @@ params { // CCBR shared resource paths index_dir = null // TODO fastq_screen { - conf = "assets/fastq_screen_frce.conf" // TODO + conf = "${projectDir}/assets/fastq_screen_frce.conf" // TODO db_dir = null // TODO } } diff --git a/conf/full_mm10.config b/conf/full_mm10.config index 730a185b..5d5c7de9 100644 --- a/conf/full_mm10.config +++ b/conf/full_mm10.config @@ -4,8 +4,8 @@ params { genome = 'mm10' outdir = "results/full_mm10" - input = "assets/samplesheet_full_mm10.csv" - contrasts = 'assets/contrasts_full_mm10.yml' + input = "${projectDir}/assets/samplesheet_full_mm10.csv" + contrasts = "${projectDir}/assets/contrasts_full_mm10.yml" sicer { species = "mm10" // supported species https://github.com/zanglab/SICER2/blob/master/sicer/lib/GenomeData.py } diff --git a/conf/genomes.config b/conf/genomes.config index 33e49dfe..7b86fdee 100644 --- a/conf/genomes.config +++ b/conf/genomes.config @@ -9,7 +9,7 @@ params { chrom_sizes = "${params.index_dir}/hg38_basic/indexes/hg38.fa.sizes" gene_info = "${params.index_dir}/hg38_basic/geneinfo.bed" effective_genome_size = 2700000000 - meme_motifs = 'assets/HOCOMOCOv11_core_HUMAN_mono_meme_format.tar.gz' // source https://github.com/CCBR/ASPEN/raw/55f909d76500c3502c1c397ef3000908649b0284/resources/motif/HOCOMOCOv11_core_HUMAN_mono_meme_format.tar.gz + meme_motifs = "${projectDir}/assets/HOCOMOCOv11_core_HUMAN_mono_meme_format.tar.gz" // source https://github.com/CCBR/ASPEN/raw/55f909d76500c3502c1c397ef3000908649b0284/resources/motif/HOCOMOCOv11_core_HUMAN_mono_meme_format.tar.gz bioc_txdb = 'TxDb.Hsapiens.UCSC.hg38.knownGene' bioc_annot = 'org.Hs.eg.db' } @@ -22,7 +22,7 @@ params { chrom_sizes = "${params.index_dir}/mm10_basic/indexes/mm10.fa.sizes" gene_info = "${params.index_dir}/mm10_basic/geneinfo.bed" effective_genome_size = 2400000000 - meme_motifs = 'assets/HOCOMOCOv11_core_MOUSE_mono_meme_format.tar.gz' // source https://github.com/CCBR/ASPEN/raw/55f909d76500c3502c1c397ef3000908649b0284/resources/motif/HOCOMOCOv11_core_MOUSE_mono_meme_format.tar.gz + meme_motifs = "${projectDir}/assets/HOCOMOCOv11_core_MOUSE_mono_meme_format.tar.gz" // source https://github.com/CCBR/ASPEN/raw/55f909d76500c3502c1c397ef3000908649b0284/resources/motif/HOCOMOCOv11_core_MOUSE_mono_meme_format.tar.gz bioc_txdb = 'TxDb.Mmusculus.UCSC.mm10.knownGene' bioc_annot = 'org.Mmu.eg.db' } diff --git a/conf/test.config b/conf/test.config index 8a53a15b..4e0a8f35 100644 --- a/conf/test.config +++ b/conf/test.config @@ -3,8 +3,8 @@ params { config_profile_description = 'Minimal test dataset to check paired & single end handling' outdir = 'results/test' - input = 'assets/samplesheet_test.csv' // adapted from 'https://raw.githubusercontent.com/nf-core/test-datasets/chipseq/samplesheet/v2.0/samplesheet_test.csv' - //contrasts = 'assets/contrasts_test.yml' // diffbind DESeq2 fails on this test data + input = "${projectDir}/assets/samplesheet_test.csv" // adapted from 'https://raw.githubusercontent.com/nf-core/test-datasets/chipseq/samplesheet/v2.0/samplesheet_test.csv' + //contrasts = "${projectDir}/assets/contrasts_test.yml" // diffbind DESeq2 fails on this test data genome = 'sacCer3' read_length = 50 @@ -13,7 +13,7 @@ params { genome_fasta = 'https://raw.githubusercontent.com/nf-core/test-datasets/atacseq/reference/genome.fa' genes_gtf = 'https://raw.githubusercontent.com/nf-core/test-datasets/atacseq/reference/genes.gtf' blacklist = '/data/CCBR_Pipeliner/db/PipeDB/Indices/hg38_basic/indexes/hg38.blacklist_v3.chrM.chr_rDNA.fa' - rename_contigs = 'assets/R64-1-1_ensembl2UCSC.txt' + rename_contigs = "${projectDir}/assets/R64-1-1_ensembl2UCSC.txt" meme_motifs = null bioc_txdb = 'TxDb.Scerevisiae.UCSC.sacCer3.sgdGene' bioc_annot = 'org.Sc.sgd.db' diff --git a/conf/test_dcssim.config b/conf/test_dcssim.config deleted file mode 100644 index 600cc1a3..00000000 --- a/conf/test_dcssim.config +++ /dev/null @@ -1,14 +0,0 @@ -params { - config_profile_name = 'Test DCS simulated dataset' - config_profile_description = 'https://zenodo.org/records/5005654' - - genome = 'mm10' - outdir = "results/dcssim" - input = "assets/samplesheet_test_dcssim.csv" - contrasts = 'assets/contrasts_test_dcssim.yml' - read_length = 50 - sicer.species = "mm10" // supported species https://github.com/zanglab/SICER2/blob/master/sicer/lib/GenomeData.py - - run.gem = false - -} diff --git a/conf/test_dcssub.config b/conf/test_dcssub.config deleted file mode 100644 index 7b834d23..00000000 --- a/conf/test_dcssub.config +++ /dev/null @@ -1,14 +0,0 @@ -params { - config_profile_name = 'Test DCS subsampled dataset' - config_profile_description = 'https://zenodo.org/records/5005654' - - genome = 'mm10' - outdir = "results/dcssub" - input = "assets/samplesheet_test_dcssub.csv" - contrasts = 'assets/contrasts_test_dcssub.yml' - read_length = 50 - sicer.species = "mm10" // supported species https://github.com/zanglab/SICER2/blob/master/sicer/lib/GenomeData.py - - run.gem = false - -} diff --git a/conf/test_mm10.config b/conf/test_mm10.config index 47086230..19f66705 100644 --- a/conf/test_mm10.config +++ b/conf/test_mm10.config @@ -4,8 +4,8 @@ params { genome = 'mm10' outdir = "results/test_mm10" - input = "assets/samplesheet_test_mm10.csv" - contrasts = 'assets/contrasts_test_mm10.yml' + input = "${projectDir}/assets/samplesheet_test_mm10.csv" + contrasts = "${projectDir}/assets/contrasts_test_mm10.yml" read_length = 50 sicer.species = "mm10" // supported species https://github.com/zanglab/SICER2/blob/master/sicer/lib/GenomeData.py diff --git a/docs/nextflow.md b/docs/nextflow.md index fef9e173..e827fb35 100644 --- a/docs/nextflow.md +++ b/docs/nextflow.md @@ -9,10 +9,10 @@ as the config files will be accessed directly from the GitHub repo. nextflow run CCBR/CHAMPAGNE -profile test,singularity ``` -You can specify a specific version, tag, or branch with `-r`: +You can specify a specific version, tag, or branch on [GitHub](https://github.com/CCBR/CHAMPAGNE) with `-r`: ```sh -nextflow run CCBR/CHAMPAGNE -r v1.0.0 -profile test,singularity +nextflow run CCBR/CHAMPAGNE -r v0.3.0 -profile test,singularity ``` Create and use a custom reference genome: @@ -21,3 +21,15 @@ Create and use a custom reference genome: nextflow run CCBR/CHAMPAGNE -profile test -entry MAKE_REFERENCE nextflow run CCBR/CHAMPAGNE -profile test -c results/test/genome/custom_genome.config ``` + +## biowulf + +If you're running it on biowulf without the `champagne` CLI, +first load the ccbrpipeliner and nextflow modules, +and be sure to specify the `biowulf` and `slurm` profiles: + +```sh +module load ccbrpipeliner +module load nextflow +nextflow run CCBR/CHAMPAGNE -profile test,biowulf,slurm +``` diff --git a/docs/requirements.txt b/docs/requirements.txt index 9d5ddac9..083b20bb 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,10 +1,13 @@ +mkdocs #https://pypi.org/project/mkdocs-git-revision-date-localized-plugin/ -mkdocs-git-revision-date-localized-plugin==1.2.0 +mkdocs-git-revision-date-localized-plugin #https://pypi.org/project/mkdocs-minify-plugin/ -mkdocs-minify-plugin==0.6.4 +mkdocs-minify-plugin #https://pypi.org/project/mkdocs-git-revision-date-plugin/ -mkdocs-git-revision-date-plugin==0.3.2 +mkdocs-git-revision-date-plugin #https://pypi.org/project/mkdocs-material/ -mkdocs-material==9.1.6 +mkdocs-material #https://pypi.org/project/mkdocs-material-extensions/ -mkdocs-material-extensions==1.1.1 +mkdocs-material-extensions +#https://github.com/jimporter/mike +mike diff --git a/main.nf b/main.nf index ede41f4c..1549c54c 100644 --- a/main.nf +++ b/main.nf @@ -46,7 +46,7 @@ workflow.onComplete { } workflow DOWNLOAD_SRA { - ch_sra = Channel.from(file('assets/test_human_metadata.csv')) + ch_sra = Channel.from(file(params.sra_csv)) // assets/test_human_metadata.csv .splitCsv ( header:true, sep:',' ) .map{ it -> [ it + [id: it.sra], it.sra ]} .view() @@ -152,10 +152,11 @@ workflow CHIPSEQ { } } - MULTIQC( - file(params.multiqc.config, checkIfExists: true), - file(params.multiqc.logo, checkIfExists: true), - ch_multiqc.collect() - ) - + if (!workflow.stubRun) { + MULTIQC( + file(params.multiqc.config, checkIfExists: true), + file(params.multiqc.logo, checkIfExists: true), + ch_multiqc.collect() + ) + } } diff --git a/mkdocs.yml b/mkdocs.yml index 954cd758..cd9f0885 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -39,6 +39,10 @@ plugins: - git-revision-date - minify: minify_html: true + - mike: + alias_type: symlink + canonical_version: latest + version_selector: true # Customization extra: @@ -64,8 +68,6 @@ markdown_extensions: permalink: true - pymdownx.arithmatex: generic: true - - pymdownx.betterem: - smart_enable: all - pymdownx.caret - pymdownx.critic - pymdownx.details diff --git a/modules/local/chipseeker/annotate/main.nf b/modules/local/chipseeker/annotate/main.nf index 1389e7b2..756304e7 100644 --- a/modules/local/chipseeker/annotate/main.nf +++ b/modules/local/chipseeker/annotate/main.nf @@ -1,7 +1,7 @@ process CHIPSEEKER_ANNOTATE { tag "${meta.id}.${meta.group}" label 'peaks' - label 'process_medium' + label 'process_high' container 'nciccbr/ccbr_chipseeker:1.1.2' @@ -24,7 +24,8 @@ process CHIPSEEKER_ANNOTATE { --genome-annot ${annot_db} \\ --uptss 2000 \\ --downtss 2000 \\ - --toppromoterpeaks 1000 + --toppromoterpeaks 1000 \\ + --cores ${task.cpus} """ stub: diff --git a/nextflow.config b/nextflow.config index ac682db8..8b66688b 100644 --- a/nextflow.config +++ b/nextflow.config @@ -40,14 +40,14 @@ params { } multiqc { - config = "assets/multiqc_config.yaml" - logo = "assets/ccbr_logo.png" + config = "${projectDir}/assets/multiqc_config.yaml" + logo = "${projectDir}/assets/ccbr_logo.png" } min_fragment_length = 200 // https://github.com/CCBR/Pipeliner/blob/86c6ccaa3d58381a0ffd696bbf9c047e4f991f9e/Rules/InitialChIPseqQC.snakefile#L539 gem { - read_dists = 'assets/gem/Read_Distribution_default.txt' // source https://groups.csail.mit.edu/cgs/gem/download/Read_Distribution_default.txt + read_dists = "${projectDir}/assets/gem/Read_Distribution_default.txt" // source https://groups.csail.mit.edu/cgs/gem/download/Read_Distribution_default.txt fold = 3 k_min = 6 k_max = 13 @@ -67,7 +67,7 @@ params { } homer { de_novo = true - jaspar_db = 'assets/JASPAR2022_CORE_vertebrates_non-redundant_pfms_jaspar.txt' // source https://jaspar.genereg.net/download/data/2022/CORE/JASPAR2022_CORE_vertebrates_non-redundant_pfms_jaspar.txt + jaspar_db = "${projectDir}/assets/JASPAR2022_CORE_vertebrates_non-redundant_pfms_jaspar.txt" // source https://jaspar.genereg.net/download/data/2022/CORE/JASPAR2022_CORE_vertebrates_non-redundant_pfms_jaspar.txt } diffbind { @@ -126,12 +126,6 @@ profiles { full_mm10 { includeConfig "conf/full_mm10.config" } - test_dcssim { - includeConfig "conf/test_dcssim.config" - } - test_dcssub { - includeConfig "conf/test_dcssub.config" - } test_human { includeConfig 'conf/test_human.config' } @@ -173,6 +167,7 @@ manifest { homePage = "https://github.com/CCBR/CHAMPAGNE" description = "CHromAtin iMmuno PrecipitAtion sequencinG aNalysis pipEline" mainScript = "main.nf" + defaultBranch = "main" } // Function to ensure that resource requirements don't go beyond diff --git a/src/__main__.py b/src/__main__.py index eb97ed14..f38fbd4c 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -113,6 +113,12 @@ def init(**kwargs): os.mkdir("log/") +@click.command() +def citation(**kwargs): + """Print the citation""" + print_citation() + + cli.add_command(run) cli.add_command(init) diff --git a/src/util.py b/src/util.py index 0df6bb3f..380c1f50 100644 --- a/src/util.py +++ b/src/util.py @@ -183,7 +183,10 @@ def run_nextflow( profiles.add("slurm") if hpc: profiles.add(hpc_options[hpc]["profile"]) - args_dict["-profile"] = ",".join(sorted(profiles)) + if ( + profiles + ): # only add to the profiles if there are any. there are none when champagne is run on GitHub Actions. + args_dict["-profile"] = ",".join(sorted(profiles)) nextflow_command += list(f"{k} {v}" for k, v in args_dict.items()) # Print nextflow command diff --git a/tests/cli/ci_stub.config b/tests/cli/ci_stub.config index e287e9a7..ca30e765 100644 --- a/tests/cli/ci_stub.config +++ b/tests/cli/ci_stub.config @@ -40,3 +40,7 @@ process { cpus = 1 memory = '1 GB' } + +executor { + queueSize = 20 +}