Commit faccfe25 authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

update syntax to call subroutines

parent f29f8698
Loading
Loading
Loading
Loading
+18 −18
Original line number Diff line number Diff line
@@ -2724,12 +2724,12 @@ else
                
                echo "  ...concatencate barcodes to R1 from I1 and I2 index files"
                # concatenate barcocdes from index to R1 as (bases 1-16 of the) barcode, moving (read to start at base 17-)
                perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI1} --additive=${convI2} --ref_fastq=${convR1} --out_dir $crIN
                perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI1} --additives ${convI2} --ref_fastq ${convR1} --out_dir $crIN
            else
                barcodelength=$indexlength
                echo "  ...concatencate barcodes to R1 from I1 index files"
                # concatenate barcocdes from index to R1 as (bases 1-6 of the) barcode, moving (read to start at base 7-)
                perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI1} --ref_fastq=${convR1} --out_dir $crIN
                perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI1} --ref_fastq ${convR1} --out_dir $crIN
            fi
            
            #returns a combined R1 file with I1-R1 concatenated (I1 is cell barcode)
@@ -2740,7 +2740,7 @@ else
                    echo "adding mock UMI"
                fi
                # add mock UMI (count reads instead of UMI) barcodelength=6, umi_default=10
                perl ${TOOLS}/AddMockUMI.pl --fastq=${convR1} --out_dir $crIN --head_length=$barcodelength --umi_length=$umi_default
                perl ${TOOLS}/AddMockUMI.pl --fastq ${convR1} --out_dir $crIN --head_length $barcodelength --umi_length $umi_default
                umilength=$umi_default
                umiadjust=0
                if [[ $chemistry == "SC3Pv3" ]]; then
@@ -2799,7 +2799,7 @@ else
                    # filter UMI reads by matching tag sequence ATTGCGCAATG (bases 1-11 of R1) and remove as an adapters 
                    
                    #same as SmartSeq2
                    perl ${TOOLS}/FilterSmartSeqReadUMI.pl --r1=${convR1} --r2=${convR2} --tag="AAGCAGTGGTATCAACGCAGAGTAC" --out_dir $crIN
                    perl ${TOOLS}/FilterSmartSeqReadUMI.pl --r1 ${convR1} --r2 ${convR2} --tag "AAGCAGTGGTATCAACGCAGAGTAC" --out_dir $crIN
                    echo "  ...trim tag sequence from R1"
                    
                    # returns R1 with tag sequence removed (left trim) starting with 8pbp UMI and corresponding reads for I1, I2, and R2
@@ -2831,7 +2831,7 @@ else
                    echo "adding mock UMI"
                fi
                # add mock UMI (count reads instead of UMI) barcodelength=10 or 11, umi_default=10 <- default for "icell8-5-prime" and "icell8-full-length"
                perl ${TOOLS}/AddMockUMI.pl --fastq=${convR1} --out_dir $crIN --head_length=$barcodelength --umi_length=$umi_default
                perl ${TOOLS}/AddMockUMI.pl --fastq ${convR1} --out_dir $crIN --head_length $barcodelength --umi_length $umi_default
                umilength=$umi_default
                umiadjust=0
                if [[ $chemistry == "SC3Pv3" ]]; then
@@ -2934,7 +2934,7 @@ else
            echo "  ...concatencate barcodes to R1 from I1 index file"
            # concatenate barcocdes from dual indexes to R1 as (bases 1-8 of the) barcode (bases 1-16), moving UMI to (17-22)
            # filter UMI reads by matching tag sequence ATTGCGCAATG (bases 1-11 of R1) and remove as an adapters
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI1} --ref_fastq=${convR1} --out_dir $crIN
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI1} --ref_fastq ${convR1} --out_dir $crIN
            
            #returns a combined R1 file with I1-I2-R1 concatenated (I1 and I2 are R1 barcode)
            mv $crIN/Concatenated_File.fastq ${convR1}
@@ -3015,7 +3015,7 @@ else
            echo "  ...concatencate barcodes to R1 from I1 and I2 index files"
            # concatenate barcocdes from dual indexes to R1 as (bases 1-20 of the) barcode, moving RT barcode (21-30) UMI to (31-38)
            # filter UMI reads by matching tag sequence ATTGCGCAATG (bases 1-11 of R1) and remove as an adapters
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI1} --additive=${convI2} --ref_fastq=${convR1} --out_dir $crIN
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI1} --additives ${convI2} --ref_fastq ${convR1} --out_dir $crIN

            #returns a combined R1 file with I1-I2-R1 concatenated (I1 and I2 are R1 barcode)
            mv $crIN/Concatenated_File.fastq ${convR1}
@@ -3067,7 +3067,7 @@ else
            echo "  ...concatencate barcodes to R1 from I1 and I2 index files"
            # concatenate barcocdes from dual indexes to R1 as (bases 1-20 of the) barcode, moving RT barcode (21-30) UMI to (31-38)
            # filter UMI reads by matching tag sequence ATTGCGCAATG (bases 1-11 of R1) and remove as an adapters
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI1} --additive=${convI2} --ref_fastq=${convR1} --out_dir $crIN
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI1} --additives ${convI2} --ref_fastq ${convR1} --out_dir $crIN
            
            #returns a combined R1 file with I1-I2-R1 concatenated (I1 and I2 are R1 barcode)
            mv $crIN/Concatenated_File.fastq ${convR1}
@@ -3107,7 +3107,7 @@ else
            echo "  ...concatencate 10x ATAC barcodes to R1 from I2 index files"
            # concatenate barcocdes from dual indexes to R1 as (bases 1-16 of the 27 bp) barcode, moving RT barcode (17-27) UMI to (28-35)
            # filter UMI reads by matching tag sequence ATTGCGCAATG (bases 1-11 of R1) and remove as an adapters
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI2} --ref_fastq=${convR1} --out_dir $crIN
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI2} --ref_fastq ${convR1} --out_dir $crIN

            #returns a combined R1 file with I1-I2-R1 concatenated (I1 and I2 are R1 barcode)
            mv $crIN/Concatenated_File.fastq ${convR1}
@@ -3129,7 +3129,7 @@ else
            if [[ "$technology" == "strt-seq" ]]; then
                # add mock UMI (count reads instead of UMI) barcodelength=6, umi_default=10
                echo "  ...generate mock UMI for compatibility"
                perl ${TOOLS}/AddMockUMI.pl --fastq=${convR1} --out_dir $crIN --head_length=$barcodelength --umi_length=$umi_default
                perl ${TOOLS}/AddMockUMI.pl --fastq ${convR1} --out_dir $crIN --head_length $barcodelength --umi_length $umi_default
                umilength=$umi_default
                umiadjust=0
                chemistry="SC5P-PE"
@@ -3143,7 +3143,7 @@ else
                chemistry="SC5P-R1"
                echo "  ...concatencate barcodes to R1 from I1 index files"
                # concatenate barcocdes from I1 index to R1 as barcode (bases 1-8)
                perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI1} --ref_fastq=${convR1} --out_dir $crIN
                perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI1} --ref_fastq ${convR1} --out_dir $crIN
            fi
            if [[ "$technology" == "strt-seq-2i" ]]; then
                convI1=$(echo $read | perl -pne 's/(.*)_R1/$1_I1/' )
@@ -3151,7 +3151,7 @@ else
                chemistry="SC5P-R1"
                echo "  ...concatencate barcodes to R1 from I1 and I2index files"
                # concatenate barcocdes from I1 index to R1 as barcode (bases 1-8)
                perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI1} --additive=${convI2} --ref_fastq=${convR1} --out_dir $crIN
                perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI1} --additives ${convI2} --ref_fastq ${convR1} --out_dir $crIN
            fi

            #convert TSO to expected length for 10x 5' (TSS in R1 from base 39)
@@ -3274,7 +3274,7 @@ else
            echo " ...remove internal reads for ${technology} by matching TSO sequence for UMI reads"
            # filter UMI reads by matching tag sequence ATTGCGCAATG (bases 1-11 of R1) and remove as an adapters 

            perl ${TOOLS}/FilterSmartSeqReadUMI.pl --r1=${convR1} --r2=${convR2} --i1=${convI1} --i2=${convI2}  --tag="AAGCAGTGGTATCAACGCAGAGTAC" --out_dir $crIN
            perl ${TOOLS}/FilterSmartSeqReadUMI.pl --r1 ${convR1} --r2 ${convR2} --i1 ${convI1} --i2 ${convI2}  --tag "AAGCAGTGGTATCAACGCAGAGTAC" --out_dir $crIN
            echo "  ...trim tag sequence from R1"

            # returns R1 with tag sequence removed (left trim) starting with 8pbp UMI and corresponding reads for I1, I2, and R2
@@ -3285,14 +3285,14 @@ else

            echo "  ...concatencate barcodes to R1 from I1 and I2 index files"
            # concatenate barcocdes from dual indexes to R1 as barcode (bases 1-16)
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI1} --additive=${convI2} --ref_fastq=${convR1} --out_dir $crIN
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI1} --additives ${convI2} --ref_fastq ${convR1} --out_dir $crIN

            #returns a combined R1 file with I1-I2-R1 concatenated (I1 and I2 are R1 barcode)
            ## 16 bp barcode, GGG for TSO, no UMI
            mv $crIN/Concatenated_File.fastq ${convR1}

            # add mock UMI (count reads instead of UMI) barcodelength=16, umi_default=10
            perl ${TOOLS}/AddMockUMI.pl --fastq=${convR1} --out_dir $crIN --head_length=$barcodelength --umi_length=$umi_default
            perl ${TOOLS}/AddMockUMI.pl --fastq ${convR1} --out_dir $crIN --head_length $barcodelength --umi_length $umi_default
            umilength=$umi_default
            umiadjust=0
            chemistry="SC3Pv2"
@@ -3340,7 +3340,7 @@ else
            
            echo "  ...remove internal for ${technology} by matching tag sequence for UMI reads"
            # filter UMI reads by matching tag sequence ATTGCGCAATG (bases 1-11 of R1) and remove as an adapters 
            perl ${TOOLS}/FilterSmartSeqReadUMI.pl --r1=${convR1} --r2=${convR2} --i1=${convI1} --i2=${convI2} --tag="ATTGCGCAATG" --out_dir=$crIN
            perl ${TOOLS}/FilterSmartSeqReadUMI.pl --r1 ${convR1} --r2 ${convR2} --i1 ${convI1} --i2 ${convI2} --tag "ATTGCGCAATG" --out_dir $crIN
            echo "  ...trim tag sequence from R1"
            
            # returns R1 with tag sequence removed (left trim) starting with 8pbp UMI and corresponding reads for I1, I2, and R2
@@ -3351,7 +3351,7 @@ else
            
            echo "  ...concatencate barcodes to R1 from I1 and I2 index files"
            # concatenate barcocdes from dual indexes to R1 as barcode (bases 1-16)
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additive=${convI1} --additive=${convI2} --ref_fastq=${convR1} --out_dir=$crIN
            perl ${TOOLS}/ConcatenateDualIndexBarcodes.pl --additives ${convI1} --additives ${convI2} --ref_fastq ${convR1} --out_dir $crIN
            
            #returns a combined R1 file with I1-I2-R1 concatenated (I1 and I2 are R1 barcode)
            mv $crIN/Concatenated_File.fastq ${convR1}
@@ -3428,7 +3428,7 @@ else
                if [[ $chemistry == "SC3Pv3" ]]; then
                     chemistry="SC3Pv2"
                fi
                perl ${TOOLS}/AddMockUMI.pl --fastq=${convR1} --out_dir $crIN --head_length=$barcodelength --umi_length=$umi_default
                perl ${TOOLS}/AddMockUMI.pl --fastq ${convR1} --out_dir $crIN --head_length $barcodelength --umi_length $umi_default
                umilength=$umi_default
                umiadjust=0
                if [[ $chemistry == "SC3Pv3" ]]; then