Skip to content

Instantly share code, notes, and snippets.

@mbk0asis
Last active November 16, 2015 02:47
Show Gist options
  • Save mbk0asis/fda88ab6f8e8cea85023 to your computer and use it in GitHub Desktop.
Save mbk0asis/fda88ab6f8e8cea85023 to your computer and use it in GitHub Desktop.
counting CpG in every line
$ while read line; do echo $line | grep -o 'Any_Pattern' | wc -l; done < Input_File > Result_file
# Example
$ while read line; do echo $line | grep -o 'CG' | wc -l; done < Dlk1_mm10.txt > Dlk1_CpG_density
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment