Commit 45bba403 authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

update syntax for renaming files automatically

parent f9c79676
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1445,9 +1445,9 @@ for key in ${keys[@]}; do
                    echo "  renaming $read ..."
                fi
                k=$((${j} + 1))
                rename -f "s/_L([0-9][0123456789][0123456789])/_S${k}_L\$1/" ${read}*
                rename -f "s/_L\([0123456789][0123456789][0123456789]\)/_S${k}_L\1/" ${read}*
                #update file variable
                read=`echo $read | perl -pn -e "s/_L([0-9][0123456789][0123456789])/_S${k}_L\$1/g"`
                read=`echo $read | perl -pn -e "s/_L\([0123456789][0123456789][0123456789]\)/_S${k}_L\1/g"`
                list[$j]=$read
            ;;
        esac
+2 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ bash launch_universc.sh --id "test-icell8-72618_KU812-2-lanes" --technology "iCe
 --read1 "test/shared/icell8-test/72618_KU812_L001_R1_001.fastq" "test/shared/icell8-test/72618_KU812_L002_R1_001.fastq" \
 --read2 "test/shared/icell8-test/72618_KU812_L001_R2_001.fastq" "test/shared/icell8-test/72618_KU812_L002_R2_001.fastq" \
 --barcodefile "test/shared/icell8-test/WellList.txt" \
 --per-cell-data --jobmode "local" --localcores 2 --localmem 4
 --per-cell-data --jobmode "local" --localcores 2 --localmem 4 --verbose

if [ -f test/shared/icell8-test/72618_KU812_S1_L001_R1_001.fastq ]; then
    rename "s/_S1_L001/_L001/" test/shared/icell8-test/72618_KU812_S1_L001_R1_001.fastq*
@@ -93,7 +93,7 @@ bash launch_universc.sh --id "test-icell8-72618_KU812-1-lane" --technology "iCel
 --read1 "test/shared/icell8-test/72618_KU812_L001_R1_001.fastq" \
 --read2 "test/shared/icell8-test/72618_KU812_L001_R2_001.fastq" \
 --barcodefile "test/shared/icell8-test/WellList.txt" \
 --per-cell-data --jobmode "local" --localcores 2 --localmem 4
 --per-cell-data --jobmode "local" --localcores 2 --localmem 4 --verbose

if [ -f test/shared/icell8-test/72618_KU812_S1_L001_R1_001.fastq ]; then
    rename "s/_S1_L001/_L001/" test/shared/icell8-test/72618_KU812_S1_L001_R1_001.fastq*
+0 −60
Original line number Diff line number Diff line

#!/bin/bash
bash ~/.bashrc

# run tests in universc directory (parent of test directory)
cd $(dirname ${BASH_SOURCE[0]})/..
pwd
##git pull --ff-only origin $(git branch --show-current) 

# used to export to PATH for testing on SGE server
export PATH=${HOME}/local/bin/cellranger-3.0.2:$PATH

cellrangerversion=`cellranger count --version | head -n 2 | tail -n 1 | cut -f2 -d'(' | cut -f1 -d')'`
cellrangerpath=`which cellranger`

# set up cellranger reference
if [[ ! -f test/cellranger_reference/cellranger-tiny-ref/3.0.0/star/SA ]] && [[ -f $(dirname $cellrangerpath)/cellranger-tiny-ref/3.0.0/star/SA ]]; then
    rsync $(dirname $cellrangerpath)/cellranger-tiny-ref/3.0.0/star/SA test/cellranger_reference/cellranger-tiny-ref/3.0.0/star/SA
fi
if [[ ! -f test/cellranger_reference/cellranger-tiny-ref/1.2.0/star/SA ]] && [[ -f $(dirname $cellrangerpath)/cellranger-tiny-ref/1.2.0/star/SA ]]; then
    rsync $(dirname $cellrangerpath)/cellranger-tiny-ref/1.2.0/star/SA test/cellranger_reference/cellranger-tiny-ref/1.2.0/star/SA
fi

# compress all input files
if [[ -f test/shared/smartseq3-test/Smartseq3_diySpike_S1_L001_S1_R1_001.fastq ]]; then
echo    gzip test/shared/smartseq3-test/Smartseq3_diySpike_S1_L00?_S1_[IR][12]_001.fastq.gz
fi

#rename "s/Smartseq3.diySpike./Smartseq3_diySpike_/g"  test/shared/smartseq3-test/Smartseq3.diySpike.[IR][12].fastq
#rename "s/Smartseq3.diySpike./Smartseq3_diySpike_/g"  test/shared/smartseq3-test/Smartseq3.diySpike.L001.[IR][12].fastq

while [[ ! -f /home/tom/repos/universc/test-10x-hek293t/outs/metrics_summary.csv  ]]; do
    echo "wait ..."
    sleep 60
done

# test manual setup
bash launch_universc.sh -t "smartseq3" --setup  --barcodefile "whitelists/test_bcs_smartseq3_full.txt"

if [[ -d input4cellranger_test-smartseq3-diyspike-hg38 ]]; then
    rm -rf input4cellranger_test-smartseq3-diyspike-hg38
fi
if [[ -d test-smartseq3-diyspike-hg38 ]]; then
    rm -rf test-smartseq3-diyspike-hg38
fi

if [[ ! -f whitelists/SmartSeq3_test_barcodes.txt ]]; then
    gunzip -k whitelists/SmartSeq3_test_barcodes.txt.gz
fi

 # call on smartseq3 with files
bash launch_universc.sh --id "test-smartseq3-diyspike-hg38" --technology "smartseq3" \
 --chemistry "SC5P-PE" \
 --reference "~/reference/cellranger/refdata-cellranger-GRCh38-3.0.0" \
 --barcodefile "whitelists/test_bcs_smartseq3_full.txt" \
 --read1 "test/shared/smartseq3-test/Smartseq3_diySpike_S1_L001_R1_001.fastq" \
 --read2 "test/shared/smartseq3-test/Smartseq3_diySpike_S1_L001_R2_001.fastq" \
 --index1 "test/shared/smartseq3-test/Smartseq3_diySpike_S1_L001_I1_001.fastq" \
 --index2 "test/shared/smartseq3-test/Smartseq3_diySpike_S1_L001_I2_001.fastq" \
 --per-cell-data --jobmode "local" --verbose #--as-is # "local" --localcores 1
−131 B

File deleted.

−131 B

File deleted.

Loading