Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Exercise: What is the total count of reads mapping to gene features other than Dubious?

Expand
titleHint
grep -v 'Dubious'


Expand
titleAnswer


Code Block
languagebash
grep -v 'Dubious' yeast_mrna_gene_counts.bed | awk '
 BEGIN{FS="\t";sum=0;tot=0}
 {if($9 > 0) { sum = sum + $9; tot = tot + 1 }}
 END{printf("%d overlapping reads in %d non-Dubious genes\n", sum, tot) }'

There are 1093140 overlapping reads in 5578 non-Dubious genes

...

For example, our sc_genes.bed file has a gene name in column 4, and for each (possibly merged) gene region, we want to know the number of gene regions that were collapsed into the region, and also which gene names were collapsed.

We can do this with -c 6,4,4 -o distinct,count,collapse, which says that three custom output columns should be added:

...