My one-liner of the day:
Is there ERCC spiked into my sample?
This scans the fastq for reads that are not N's and have OK quality and have a minimum of 30 base pairs. Then it takes the first 100k reads of that sort and sends them to bowtie, which looks for non-ambiguous ERCC hits. ERCC's are alien enough that a count of 2 or more is sufficient for "detection" of ERCC.
This script is very fast (completing in <1 second, 2.474 seconds of CPU time), and informs downstream programs that ERCC is present and should be dealt with appropriately (quantified, reported on, subtracted, etc.)
Is there ERCC spiked into my sample?
Code:
fastq-mcf n/a -l 30 $fq1 | zhead -n 100000 | bowtie -p 4 -S -m 1 --best --strata ercc92.fa - 2>&1 > /dev/null | perl -ne '($c)=/Reported (\d+)/; $c+=0; END {print "$c\n"};'
This script is very fast (completing in <1 second, 2.474 seconds of CPU time), and informs downstream programs that ERCC is present and should be dealt with appropriately (quantified, reported on, subtracted, etc.)