https://github.com/arjunrajlaboratory/RajLabSeqTools
Revision f8c9a19610aa8468f312948d56928bd1bc6d54a5 authored by Ian Mellis on 07 January 2016, 18:58:37 UTC, committed by Ian Mellis on 07 January 2016, 18:58:37 UTC
1 parent f267e82
Raw File
Tip revision: f8c9a19610aa8468f312948d56928bd1bc6d54a5 authored by Ian Mellis on 07 January 2016, 18:58:37 UTC
Updates location of meltData.tsv to experiment folder rather than overall project folder
Tip revision: f8c9a19
unzipAndConcatenateZippedFastq.sh
#!/bin/bash

ZIPFILEDIRECTORY=$1

OUTFASTADIRECTORY=$2

for dirname in $ZIPFIELDIRECTORY/* ; do
    cd $dirname

    INPUT=`ls *001_R1*`
    SAMPLE=${INPUT%%_*}  # Cuts filename string after first '_'

    if [ ! -d $OUTFASTADIRECTORY/raw ]; then
        mkdir $OUTFASTADIRECTORY/raw
    fi

    if [ ! -d $OUTFASTADIRECTORY/raw/$SAMPLE ]; then
        mkdir $OUTFASTADIRECTORY/raw/$SAMPLE
    fi

    for i in *.gz; do
        gunzip -c $i > ${i%.*}
    done

    FASTQR1=${SAMPLE}_R1.fastq
    FASTQR2=${SAMPLE}_R2.fastq

    cat *R1*fastq > $OUTFASTADIRECTORY/raw/$SAMPLE/$FASTQR1
    cat *R2*fastq > $OUTFASTADIRECTORY/raw/$SAMPLE/$FASTQR2

done

back to top