Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
apps/cellranger/0.1/common/test/*
121 changes: 121 additions & 0 deletions apps/cellranger/0.1/common/cellranger_common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#
# Toy common functions
#
# This script relies upon global variables
# source toy_common.sh
#
# Author: Scott Christley
# Date: Aug 17, 2020
#

# required global variables:
# PYTHON
# AGAVE_JOB_ID
# and...
# The agave app input and parameters

# the app
export APP_NAME=cellranger

# ----------------------------------------------------------------------------
function expandfile () {
fileBasename="${1%.*}" # file.txt.gz -> file.txt
fileExtension="${1##*.}" # file.txt.gz -> gz

if [ ! -f $1 ]; then
echo "Could not find input file $1" 1>&2
exit 1
fi

if [ "$fileExtension" == "gz" ]; then
gunzip $1
export file=$fileBasename
# don't archive the intermediate file
elif [ "$fileExtension" == "bz2" ]; then
bunzip2 $1
export file=$fileBasename
elif [ "$fileExtension" == "zip" ]; then
unzip -o $1
export file=$fileBasename
else
export file=$1
fi
}

# prevent Agave from archiving the file
function noArchive() {
echo $1 >> .agave.archive
}

# ----------------------------------------------------------------------------
# Analysis provenance
function initProvenance() {
# nothing yet
echo "initProvenance"
}

# ----------------------------------------------------------------------------
# Toy workflow

function print_versions() {
echo "VERSIONS:"
#echo " $(DefineClones.py --version 2>&1)"
singularity exec ${singularity_image} cellranger --version
echo -e "\nSTART at $(date)"
}

function print_parameters() {
echo "Input files:"
echo "singularity_image=${singularity_image}"
echo "input_file=${input_file}"
echo "input_file=${input_csv}"
echo ""
echo "Application parameters:"
echo "single_flag=${single_flag}"
echo "optional_number=${optional_number}"
echo "optional_enum=${optional_enum}"
}

function run_cellranger_workflow() {
initProvenance

fileBasename=${input_file##*/}
# launcher job file
if [ -f joblist ]; then
echo "Warning: removing file 'joblist'. That filename is reserved." 1>&2
rm joblist
touch joblist
fi
noArchive "joblist"

singularity exec cellranger4-bcl.sif cellranger mkfastq --id=tutorial_walk_through \
--run=${fileBasename%.tar.gz} \
--csv=${input_csv}

#ARGS="--format airr --act set --model ham --sym min --norm len --dist 0.165"
#if [ -n "$define_clones_mode" ]; then
# ARGS="$ARGS --mode $define_clones_mode"
#fi
#if [ -n "$define_clones_nproc" ]; then
# ARGS="$ARGS --nproc $define_clones_nproc"
#fi

# Define Clones
#if [[ $define_clones -eq 1 ]]; then
# echo "DefineClones.py -d ${filename} -o ${fileOutname} $ARGS" >> joblist
#fi


# check number of jobs to be run
numJobs=$(cat joblist | wc -l)
export LAUNCHER_PPN=$LAUNCHER_LOW_PPN
if [ $numJobs -lt $LAUNCHER_PPN ]; then
export LAUNCHER_PPN=$numJobs
fi

# run launcher
#$LAUNCHER_DIR/paramrun

ls -l

}
185 changes: 185 additions & 0 deletions apps/cellranger/0.1/ls5/cellranger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"name": "irplus-cellranger-ls5-franasa",
"version": "0.1",
"label": "cellranger",
"defaultQueue": "normal",
"defaultNodeCount": 1,
"defaultProcessorsPerNode": 40,
"defaultRequestedTime": "1:00:00",
"shortDescription": "cellranger 4.0 on Lonestar5",
"longDescription": "iReceptor+ cellranger app",
"executionType": "HPC",
"executionSystem": "irplus-ls5.tacc.utexas.edu",
"parallelism": "PARALLEL",
"checkpointable": false,
"deploymentPath": "/irplus/apps/cellranger/franasa/ls5/",
"deploymentSystem": "data.vdjserver.org",
"templatePath": "cellranger.sh",
"testPath": "test/test.sh",
"ontology": [
"http://sswapmeet.sswap.info/agave/apps/Application"
],
"modules": [
"purge",
"load TACC"
],
"inputs": [
{
"id": "singularity_image",
"details": {
"label": "",
"description": "Singularity image file",
"showAttribute": false
},
"semantics": {
"minCardinality": 1,
"maxCardinality": 1,
"ontology": [
"http://sswapmeet.sswap.info/mime/application/Json"
],
"fileTypes": [
"text-0"
]
},
"value": {
"default": "",
"visible": true,
"required": true
}
},
{
"id": "input_file",
"details": {
"label": "",
"description": "Test file cellranger-tiny-bcl-1.2.0.tar.gz",
"showAttribute": false
},
"semantics": {
"minCardinality": 1,
"maxCardinality": 1,
"ontology": [
"http://sswapmeet.sswap.info/mime/application/Json"
],
"fileTypes": [
"text-0"
]
},
"value": {
"default": "",
"visible": true,
"required": true
}

},
{
"id": "input_csv",
"details": {
"label": "",
"description": "csv file cellranger-tiny-bcl-simple-1.2.0.csv",
"showAttribute": false
},
"semantics": {
"minCardinality": 1,
"maxCardinality": 1,
"ontology": [
"http://sswapmeet.sswap.info/mime/application/Json"
],
"fileTypes": [
"text-0"
]
},
"value": {
"default": "",
"visible": true,
"required": true
}
}
],
"parameters": [
{
"id": "creator",
"value": {
"visible": true,
"required": true,
"type": "string",
"default": ""
},
"details": {
"label": "Creator",
"description": "Username that created this job."
},
"semantics": {
"minCardinality": 1,
"maxCardinality": 1,
"ontology": [
"xsd:string"
]
}
},
{
"id": "single_flag",
"value": {
"visible": true,
"required": true,
"type": "bool",
"order": 0,
"enquote": false,
"default": false,
"validator": null
},
"details": {
"label": "",
"description": "Boolean flag parameter",
"argument": null,
"showArgument": false,
"repeatArgument": false
},
"semantics": {
"minCardinality": 1,
"maxCardinality": 1,
"ontology": [
"xsd:boolean"
]
}
},
{
"id": "optional_number",
"value": {
"visible": true,
"required": false,
"type": "number"
},
"details": {
"label": "",
"description": "Optional number parameter"
},
"semantics": {
"minCardinality": 0,
"maxCardinality": 1,
"ontology": [
"xsd:integer"
]
}
},
{
"id": "optional_enum",
"value": {
"visible": true,
"required": false,
"type": "enumeration",
"enumValues": [ "allele", "gene" ]
},
"details": {
"label": "",
"description": "Optional enum parameter"
},
"semantics": {
"minCardinality": 0,
"maxCardinality": 1,
"ontology": [
"xsd:string"
]
}
}
]
}
72 changes: 72 additions & 0 deletions apps/cellranger/0.1/ls5/cellranger.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#
# wrapper script
# for Lonestar5
#

# Configuration settings

# These get set by Tapis

# input files
singularity_image="${singularity_image}"
input_file="${input_file}"
input_csv="${input_csv}"

# application parameters
single_flag=${single_flag}
optional_number="${optional_number}"
optional_enum="${optional_enum}"

# Agave info
AGAVE_JOB_ID=${AGAVE_JOB_ID}
AGAVE_JOB_NAME=${AGAVE_JOB_NAME}
AGAVE_LOG_NAME=${AGAVE_JOB_NAME}-${AGAVE_JOB_ID}

# ----------------------------------------------------------------------------
# unpack tiny test folder
tar -zxvf ${input_file}
#cellranger-tiny-bcl-1.2.0.tar.gz


# modules
module load python3
module load launcher/3.4
module load tacc-singularity

PYTHON=python3

export PATH="$PWD/bin:${PATH}"
export PYTHONPATH=$PWD/lib/python3.7/site-packages:$PYTHONPATH

# bring in common functions
source ./cellranger_common.sh

# ----------------------------------------------------------------------------
# Launcher to use multicores on node
export LAUNCHER_WORKDIR=$PWD
export LAUNCHER_LOW_PPN=1
export LAUNCHER_MID_PPN=8
export LAUNCHER_MAX_PPN=25
export LAUNCHER_PPN=1
export LAUNCHER_JOB_FILE=joblist
export LAUNCHER_SCHED=interleaved

# Start
printf "START at $(date)\n\n"

# If you want to tell Tapis that the job failed
export JOB_ERROR=0

print_parameters
print_versions
run_cellranger_workflow

# End
printf "DONE at $(date)\n\n"

# remove binaries before archiving
rm -rf bin lib

if [[ $JOB_ERROR -eq 1 ]]; then
${AGAVE_JOB_CALLBACK_FAILURE}
fi
Loading