Skip to content

Instantly share code, notes, and snippets.

@cyklee
Created September 29, 2018 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyklee/f6fdbf8d60ed92159d61f9151efa5a74 to your computer and use it in GitHub Desktop.
Save cyklee/f6fdbf8d60ed92159d61f9151efa5a74 to your computer and use it in GitHub Desktop.
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
done
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