One liners, snippets and small scripts

Often I use one liners or small scripts for useful task but I keep forgetting about those. So I’ll just put them here for future reference.

Count number occurrences in a column/field. In this case, how many lines in a GFF3 file exist for each chromosome.

 

cut -f1 hg19.GFF3 | sort | uniq  -c | sort

This can be further refined and count only genes per chromosome using a simple grep:

 

grep "gene" hg19.GFF3 | cut -f1 | sort | uniq  -c | sort

 

Advertisements
This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

One Response to One liners, snippets and small scripts

  1. Pingback: Coverage Plots for Chip Seq | aditiqamra

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s