Commit 4bbe6cb9 authored by kai.b's avatar kai.b
Browse files

sorted options

parent 3b41e6ce
Loading
Loading
Loading
Loading
+52 −45
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ cellrangerversion=`cellranger count --version | head -n 2 | tail -n 1 | cut -f2



#####locate launch_universc.sh for importing barcodes######
#####locate launch_universc.sh, barcode sources, and other tools######
SOURCE="${BASH_SOURCE[0]}"
SDIR=""
RDIR=""
@@ -50,28 +50,29 @@ PERCELLSTATS=${SDIR}/ExtractBasicStats.pl
#####usage statement#####
help='
Usage:
  bash '$(basename $0)' --testrun -t THECHNOLOGY
  bash '$(basename $0)' -t TECHNOLOGY --setup
  bash '$(basename $0)' -R1 FILE1 -R2 FILE2 -t TECHNOLOGY -i ID -r REFERENCE [--option OPT]
  bash '$(basename $0)' -R1 READ1_LANE1 READ1_LANE2 -R2 READ2_LANE1 READ2_LANE2 -t TECHNOLOGY -i ID -r REFERENCE [--option OPT]
  bash '$(basename $0)' -f SAMPLE_LANE -t TECHNOLOGY -i ID -r REFERENCE [--option OPT]
  bash '$(basename $0)' -f SAMPLE_LANE1 SAMPLE_LANE2 -t TECHNOLOGY -i ID -r REFERENCE [--option OPT]
  bash '$(basename $0)' -v
  bash '$(basename $0)' -h
  bash '$(basename $0)' -t TECHNOLOGY --setup

Convert sequencing data (FASTQ) from Nadia or iCELL8 platforms for compatibility with 10x Genomics and run cellranger count

Mandatory arguments to long options are mandatory for short options too.
  -t,  --technology PLATFORM    Name of technology used to generate data (10x, nadia, icell8, or custom)
                                e.g. custom_16_10
       --testrun                Initiates a test trun with the test dataset
  -R1, --read1 FILE             Read 1 FASTQ file to pass to cellranger (cell barcodes and umi)
  -R2, --read2 FILE             Read 2 FASTQ file to pass to cellranger
  -f,  --file NAME              Path and the name of FASTQ files to pass to cellranger (prefix before R1 or R2)
                                e.g. /path/to/files/Example_S1_L001
  -b,  --barcodefile FILE       Custom barcode list in plain text
  
  -i,  --id ID                  A unique run id, used to name output folder
  -d,  --description TEXT       Sample description to embed in output files.
  -r,  --reference DIR          Path of directory containing 10x-compatible reference.
  -t,  --technology PLATFORM    Name of technology used to generate data (10x, nadia, icell8, or custom)
                                e.g. custom_16_10
  -b,  --barcodefile FILE       Custom barcode list in plain text  
  
  -c,  --chemistry CHEM         Assay configuration, autodetection is not possible for converted files: 'SC3Pv2' (default), 'SC5P-PE', or 'SC5P-R2'
  -n,  --force-cells NUM        Force pipeline to use this number of cells, bypassing the cell detection algorithm.
@@ -120,7 +121,8 @@ lastcall=`[ -e $lastcallfile ] && cat $lastcallfile || echo ""`
barcodedir=${cellrangerpath}-cs/${cellrangerversion}/lib/python/cellranger/barcodes #folder within cellranger with the whitelist barcodes
barcodefile=""
crIN=input4cellranger #name of the directory with all FASTQ files given to cellranger
percellfile="outs/basic_stats.txt"
whitelistfile="outs/whitelist.txt" #name of the whitelist file added to the cellranger output
percellfile="outs/basic_stats.txt" #name of the file with the basic statistics of the run added to the cellranger output

#variable options
setup=false
@@ -147,37 +149,11 @@ for op in "$@"; do
        continue;
    fi
    case "$op" in
        -v|--version)
            echo "launch_universc.sh version ${convertversion}"
            echo "cellranger version ${cellrangerversion}"
            exit 0
            ;;
        -h|--help)
            echo "$help"
            exit 0
            ;;
        -s|--setup)
            setup=true
            next=false
            shift
            ;;
        --testrun)
            testrun=true
            next=false
            shift
            ;;
        -t|--technology)
        shift
            if [[ $1 != "" ]]; then
                technology="${1/%\//}"
                technology=`echo "$technology" | tr '[:upper:]' '[:lower:]'`
                next=true
                shift
            else
                echo "Error: value missing for --technology"
                exit 1
            fi
            ;;
        -R1|--read1)
            shift
            if [[ "$1" != "" ]]; then
@@ -224,17 +200,6 @@ for op in "$@"; do
                exit 1
            fi
            ;;
        -b|--barcodefile)
            shift
            if [[ "$1" != "" ]]; then
                barcodefile="${1/%\//}"
                next=true
                shift
            else
                echo "Error: value missing for --barcodefile"
                exit 1
            fi
            ;;
        -i|--id)
            shift
            if [[ "$1" != "" ]]; then
@@ -268,6 +233,29 @@ for op in "$@"; do
                exit 1
            fi
            ;;
        -t|--technology)
            shift
            if [[ $1 != "" ]]; then
                technology="${1/%\//}"
                technology=`echo "$technology" | tr '[:upper:]' '[:lower:]'`
                next=true
                shift
            else
                echo "Error: value missing for --technology"
                exit 1
            fi
            ;;
        -b|--barcodefile)
            shift
            if [[ "$1" != "" ]]; then
                barcodefile="${1/%\//}"
                next=true
                shift
            else
                echo "Error: value missing for --barcodefile"
                exit 1
            fi
            ;;
        -c|--chemistry)
            shift
            if [[ "$1" != "" ]]; then
@@ -339,11 +327,25 @@ for op in "$@"; do
            next=false
            shift
            ;;
        -s|--setup)
            setup=true
            next=false
            shift
            ;;
        -a|--as-is)
            convert=false
            next=false
            shift
            ;;
        -h|--help)
            echo "$help"
            exit 0
            ;;
        -v|--version)
            echo "launch_universc.sh version ${convertversion}"
            echo "cellranger version ${cellrangerversion}"
            exit 0
            ;;
       --verbose)
            echo "debugging mode activated"
            verbose=true
@@ -367,6 +369,11 @@ fi

#check if this is a test run
if [[ $testrun == "true" ]]; then
    if [[ ]] || [[ ]]; then
        echo "Error: for test run, no R1 or R2 file can be selected."
        exit 1
    fi
    
    reference=${SDIR}/test/cellranger_reference/cellranger-tiny-ref/3.0.0
    if [[ -z $id ]]; then
        id=test-tiny-${technology}