Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Count number of nucleotides in all the FASTQ files in the directory
# If, for some crazy reason, you want to know how many individual bases you have in your dataset.
for i in *.fastq; do
cat $i | paste - - - - | cut -f 2 | tr -d '\n' | wc -c >> char.txt
R -e 'sum(read.csv("char.txt"))'
# You can replace *.fastq with *.fastq.gz and cat with zcat if your data is compressed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment