Commit 0ffb5bcd authored by kai.b's avatar kai.b
Browse files

allowing WellList as input for ICELL8

parent 2e459e18
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -938,20 +938,21 @@ if [[ -n "$barcodefile" ]]; then
    else
        #getting absolute path
	barcodefile=$(readlink -f $barcodefile)
        #checking barcode file format (requires 1 column of barcodes)
        #allowing WellList from ICELL8
        if [[ "$technology" == "icell8" ]]; then
	    n_col_tsv=$(awk -F'\t' '{print NF}' $barcodefile | sort -nu | tail -n 1)
            n_col_csv=$(awk -F',' '{print NF}' $barcodefile | sort -nu | tail -n 1)
            if [[ $n_col_tsv -gt 1 ]]; then
                col_n=$(head -n 1 test/shared/icell8-test/WellList.txt | tr "\t" "\n" | grep -n "[Bb]arcode" | head -n 1 | cut -d":" -f1)
                tail -n $(($(wc -l $barcodefile | cut -d" " -f5)-1)) $barcodefile | cut -f$col_n > ${barcodefile}_barcod.txt
                barcodefile=${barcodefile}_barcode.txt
        fi
        n_col_csv=$(awk -F',' '{print NF}' $barcodefile | sort -nu | tail -n 1)
        if [[ $n_col_csv -gt 1 ]]; then
            elif [[ $n_col_csv -gt 1 ]]; then
                col_n=$(head -n 1 test/shared/icell8-test/WellList.txt | tr "," "\n" | grep -n "[Bb]arcode" | head -n 1 | cut -d":" -f1)
                tail -n $(($(wc -l $barcodefile | cut -d" " -f5)-1)) $barcodefile | cut -d"," -f$col_n > ${barcodefile}_barcode.txt
                barcodefile=${barcodefile}_barcode.txt
            fi
        fi
    fi
else
    if [[ "$technology" == "10x"* ]]; then
        barcodefile="default:10x"