Commit 239c48e3 authored by TomKellyGenetics's avatar TomKellyGenetics
Browse files

migrates conversion step to Perl for memory efficiency without syntax errors

parent 184c7776
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -3653,7 +3653,7 @@ else
        if [[ $barcodeadjust -gt 0 ]]; then
            for convFile in "${convFiles[@]}"; do
                echo " handling $convFile ..."
                perl -pni -e "2~2s/^.{${barcodeadjust}}//" $convFile #Trim the first n characters from the beginning of the sequence and quality
                perl -pni -e "s/^.{${barcodeadjust}}//g unless (/^[@+]/)" $convFile #Trim the first n characters from the beginning of the sequence and quality
                echo "  ${convFile} adjusted"
            done
        elif [[ 0 -gt $barcodeadjust ]]; then
@@ -3661,8 +3661,7 @@ else
                echo " handling $convFile ..."
                toS=`printf '%0.sA' $(seq 1 $(($barcodeadjust * - 1)))`
                toQ=`printf '%0.sI' $(seq 1 $(($barcodeadjust * - 1)))`
                perl -pni -e "2~4s/^/$toS/" $convFile #Trim the first n characters from the beginning of the sequence
                perl -pni -e "4~4s/^/$toQ/" $convFile #Trim the first n characters from the beginning of the quality
                perl -pni -e "s/^/$toS/g unless (/^[@+]/)" $convFile #Trim the first n characters from the beginning of the sequence and quality
                echo "  ${convFile} adjusted"
            done
        fi