icgc-argo-workflows / argo-modules

ARGO specific modules using nf-core framework
MIT License
0 stars 0 forks source link

Create a nf-core subworkflow Merge_Sort_Dup #31

Closed guanqiaofeng closed 6 months ago

guanqiaofeng commented 7 months ago

@guanqiaofeng

guanqiaofeng commented 7 months ago

Development Environment Setup

nf-core software is not running properly in my local environment. Using docker image for development.

1. Generate docker image (nf-core-docker)

(1) Download nfcore base docker image

docker pull nfcore/base

Interestingly, the nfcore/base docker image doesn't have nf-core installed. So I build a docker image on top of nfcore/base with nf-core installed:

(2) Create a Dockerfile (name has to be "Dockerfile") with this content:

FROM nfcore/base:latest

# Install pip
RUN apt-get update && apt-get install -y python3-pip

# Install nf-core tools
RUN pip3 install nf-core

(3) Create docker image (nf-core-docker) with the 'Dockerfile'

docker build -t nf-core-docker .
Screenshot 2024-03-22 at 11.16.28 AM.png

(4) Index docker image

docker scout quickview
Screenshot 2024-03-22 at 11.34.44 AM.png

(5) Run container

docker run -it nf-core-docker /bin/bash

docker image (nf-core-docker) generates successfully

(6) Exit container

exit

2. Repository set up

(1) Set up github repository 'Merge_Sort_Dup'

(2) Clone git repository in local VS Code

(3) Create dev branch and locate to dev branch

git branch dev
git checkout dev

repository (Merge_Sort_Dup dev) setup successfully

3 Run docker image (nf-core-docker) in git repository (Merge_Sort_Dup)

docker run -it -v $(pwd):/workspace -w /workspace nf-core-docker /bin/bash

Run a Docker container, mounting the repository's directory as a volume inside the container. Any changes made will be reflected in the local repository directory outside the container, thanks to the volume mount.

Screenshot 2024-03-22 at 2.13.05 PM.png

Environment setup successfully

guanqiaofeng commented 7 months ago
  1. Create a branch merge_sort_dup_subworkflow from main in git repository
  2. Clone git repository to VS Code environment
  3. Set docker environment docker run -it -v $(pwd):/workspace -w /workspace nf-core-nextflow-docker /bin/bash
  4. change to merge_sort_dup_subworkflow branch
  5. Create modules
    nf-core modules create samtools/merge
    nf-core modules create samtools/convert
    nf-core modules create biobambam/bammarkduplicates2
    nf-core modules create tar
  6. Update modules with git repositories exact copy of 3 files: environment.yml, main.nf, meta.yml: samtools/merge: https://github.com/nf-core/modules/tree/master/modules/nf-core/samtools/merge samtools/convert: https://github.com/nf-core/modules/tree/master/modules/nf-core/samtools/convert biobambam/bammarkduplicates2: https://github.com/nf-core/modules/tree/master/modules/nf-core/biobambam/bammarkduplicates2 tar: https://github.com/icgc-argo-workflows/dnaaln/blob/version1.0.0/modules/local/tar/main.nf --> edit accordingly https://github.com/nf-core/modules/blob/master/modules/nf-core/untar/environment.yml --> edit accordingly https://github.com/nf-core/modules/blob/master/modules/nf-core/untar/meta.yml --> edit accordingly
  7. Test that modules can be installed
    nf-core create
    cd /workspace/nf-core-rna 
    ls
    nf-core modules install star/align
    nf-core modules --git-remote https://github.com/icgc-argo-workflows/argo-modules.git list remote
    nf-core modules --git-remote https://github.com/icgc-argo-workflows/argo-modules.git install checkinput
    nf-core modules --git-remote https://github.com/icgc-argo-workflows/argo-modules.git --branch merge_sort_dup_subworkflow list remote
    nf-core modules --git-remote https://github.com/icgc-argo-workflows/argo-modules.git --branch merge_sort_dup_subworkflow install cleanup
    nf-core modules --git-remote https://github.com/icgc-argo-workflows/argo-modules.git --branch merge_sort_dup_subworkflow install biobambam/bammarkduplicates2
    nf-core modules --git-remote https://github.com/icgc-argo-workflows/argo-modules.git --branch merge_sort_dup_subworkflow install tar
    nf-core modules --git-remote https://github.com/icgc-argo-workflows/argo-modules.git --branch merge_sort_dup_subworkflow install samtools/merge
    nf-core modules --git-remote https://github.com/icgc-argo-workflows/argo-modules.git --branch merge_sort_dup_subworkflow install samtools/convert

    All 4 modules can be installed correctly.

guanqiaofeng commented 7 months ago

PR for review @edsu7 and @lindaxiang https://github.com/icgc-argo-workflows/argo-modules/pull/34

justincorrigible commented 6 months ago

Closing as done