Skip to content

Commit

Permalink
Added canu 1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Cao-Berg committed May 8, 2024
1 parent 46ee3b3 commit 9412fd0
Show file tree
Hide file tree
Showing 8 changed files with 264 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Singularity build
on: [push, pull_request]
jobs:

build:
name: Build
runs-on: ubuntu-18.04
strategy:
matrix:
singularity_version:
- '3.7.3'
container:
image: quay.io/singularity/singularity:v${{ matrix.singularity_version }}
options: --privileged
steps:
- name: Check out code for the container build
uses: actions/checkout@v1

- name: Install useful utilities
run: apk update && apk add --no-cache tree figlet wget

- name: Build and test container
run: |
for DIRECTORY in *
do
if [ -d $DIRECTORY ]; then
if [[ $DIRECTORY != 'images' ]]; then
cd $DIRECTORY
if [ ! -f .ignore ]; then
echo "Building container"
bash ./build.sh
if [ -f ./test.sh ]; then
echo "Running tests"
bash ./test.sh
else
echo "Test file not found. Skipping tests."
fi
fi
cd ..
fi
fi
done
109 changes: 109 additions & 0 deletions .github/workflows/pretty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Publishing ready
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-18.04
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Install useful utilities
run: sudo apt-get install -y tree

- name: Checking if LICENSE exists
run: |
FILE=LICENSE
if [ -f "$FILE" ]; then
echo "File "$FILE" exists."
exit 0
else
echo "File $FILE does not exist."
exit 1
fi
- name: Checking if Apache License Version 2.0, January 2004 is being used
run: |
if grep --quiet "Apache License" LICENSE && grep --quiet "Version 2.0, January 2004" LICENSE; then
echo "Using Apache License Version 2.0, January 2004"
exit 0
else
echo "Not using Apache License Version 2.0, January 2004"
exit 1
fi
- name: Checking if CONTRIBUTING guide exists
run: |
FILE=CONTRIBUTING.md
if [ -f "$FILE" ]; then
echo "File "$FILE" exists."
exit 0
else
echo "File $FILE does not exist."
exit 1
fi
- name: Checking if README file exists
run: |
FILE=README.md
if [ -f "$FILE" ]; then
echo "File "$FILE" exists."
exit 0
else
echo "File $FILE does not exist."
exit 1
fi
- name: Checking if copyrighted to Pittsburgh Supercomputing Center
run: |
if grep --quiet "Pittsburgh Supercomputing Center. All Rights Reserved." README.md; then
echo "Copyright (c) Pittsburgh Supercomputing Center"
exit 0
else
echo "No reference to Pittsburgh Supercomputing Center"
exit 1
fi
- name: Checking if there exists at least one Singularity definition file
run: |
FILE=Singularity
if [ $(find . -name "$FILE" -mmin -5 | wc -l) -gt 0 ]; then
echo "File "$FILE" was found.";
exit 0
else
echo "File "$FILE" was not found.";
exit 1
fi
- name: Checking if there exists at least one build script
run: |
FILE=build.sh
if [ $(find . -name "$FILE" -mmin -5 | wc -l) -gt 0 ]; then
echo "File "$FILE" was found.";
exit 0
else
echo "File "$FILE" was not found.";
exit 1
fi
- name: Checking if there exists at least one remote build script
run: |
FILE=rbuild.sh
if [ $(find . -name "$FILE" -mmin -5 | wc -l) -gt 0 ]; then
echo "File "$FILE" was found.";
exit 0
else
echo "File "$FILE" was not found.";
exit 1
fi
- name: Checking if there exists at least one test script
run: |
FILE=test.sh
if [ $(find . -name "$FILE" -mmin -5 | wc -l) -gt 0 ]; then
echo "File "$FILE" was found.";
exit 0
else
echo "File "$FILE" was not found.";
exit 1
fi
17 changes: 17 additions & 0 deletions 1.5/Singularity
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Bootstrap: docker
From: continuumio/anaconda3

%labels
AUTHOR icaoberg
EMAIL [email protected]
SUPPORT [email protected]
REPOSITORY http://gitub.com/pscedu/singularity-canu
COPYRIGHT Copyright © 2024 Pittsburgh Supercomputing Center. All Rights Reserved.
VERSION 1.5

%post
apt update
conda install -c conda-forge -c bioconda -c defaults canu

%runscript
canu "$@"
16 changes: 16 additions & 0 deletions 1.5/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

IMAGE=singularity-canu-1.5.sif
DEFINITION=Singularity

if [ -f $IMAGE ]; then
rm -fv $IMAGE
fi

singularity build $IMAGE $DEFINITION

if [ -f $IMAGE ]; then
exit 0
else
exit 1
fi
18 changes: 18 additions & 0 deletions 1.5/canu
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

VERSION=1.5
PACKAGE=canu
TOOL=canu
DIRECTORY=$(dirname $0)

STORAGES=(/ocean /bil /hive /local)

OPTIONS=""
for STORAGE in "${STORAGES[@]}"
do
if [ -d "$STORAGE" ]; then
OPTIONS=$OPTIONS" -B $STORAGE"
fi
done

singularity exec $OPTIONS $DIRECTORY/singularity-$PACKAGE-$VERSION.sif $TOOL "$@"
39 changes: 39 additions & 0 deletions 1.5/modulefile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--
-- canu 1.5 modulefile
--
-- "URL: https://www.psc.edu/resources/software"
-- "Category: Utilities"
-- "Description: ."
-- "Keywords: singularity bioinformatics"

whatis("Name: canu")
whatis("Version: 1.5")
whatis("Category: Utilities")
whatis("URL: https://www.psc.edu/resources/software")
whatis("Description: A single molecule sequence assembler for genomes large and small.")
whatis("Keywords: singularity bioinformatics")

help([[
A single molecule sequence assembler for genomes large and small.
To load the module, type
> module load canu/1.5
To unload the module, type
> module unload canu/1.5
For help, type
> canu -h
Tools included in this module are
* canu
]])

local package = "canu"
local version = "1.5"
local base = pathJoin("/opt/packages",package,version)
prepend_path("PATH", base)
16 changes: 16 additions & 0 deletions 1.5/rbuild.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

IMAGE=singularity-canu-1.5.sif
DEFINITION=Singularity

if [ -f $IMAGE ]; then
rm -fv $IMAGE
fi

singularity build --remote $IMAGE $DEFINITION

if [ -f $IMAGE ]; then
exit 0
else
exit 1
fi
5 changes: 5 additions & 0 deletions 1.5/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -x

tree .

0 comments on commit 9412fd0

Please sign in to comment.