Last active
December 19, 2016 21:28
-
-
Save mfcovington/547090be5b54782909bb2ec40d0b1c5d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
# Count reads and validate FASTQ files | |
FASTQ_DIR="$1" | |
if [ -z ${FASTQ_DIR+x} ]; then | |
echo "Usage: $0 /path/to/fastq/files/" | |
exit 1 | |
fi | |
echo -e "FILE\tLINES\tREADS" >> $FASTQ_DIR/counts | |
for FQ in $FASTQ_DIR/*.fastq.gz; do | |
LINES=`gunzip -c $FQ | wc -l` | |
READS=$((LINES / 4)) | |
RECORD="$FQ\t$LINES\t$READS" | |
# Warn if file is not a multiple of 4 lines | |
if (( $LINES % 4 != 0 )); then | |
RECORD="$RECORD\tERROR: Truncated File Detected" | |
fi | |
echo -e $RECORD >> $FASTQ_DIR/counts | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /bio/amaryllis/girihlet/fda/final-to-send/fq | |
echo -e "FILE\tLINES\tREADS" > ../counts | |
for FQ in *.fq.gz *.fastq.gz; do | |
LINES=`gunzip -c $FQ | wc -l` | |
READS=$((LINES / 4)) | |
RECORD="$FQ\t$LINES\t$READS" | |
# Warn if file is not a multiple of 4 lines | |
if (( $LINES % 4 != 0 )); then | |
RECORD="$RECORD\tERROR: Truncated File Detected" | |
fi | |
echo -e $RECORD >> ../counts | |
done & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment