Created
September 18, 2013 18:01
-
-
Save nachocab/6612983 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a file with the awk code | |
echo ' | |
$6 == "protein_coding" { | |
gene_counter[$10] += 1 | |
} | |
END { | |
for (gene_name in gene_counter){ | |
print gene_name, gene_counter[gene_name] | |
} | |
}' > gene_counter.awk | |
# run the code again | |
awk -F "\t" '$3 == "exon" { print $9 }' transcriptome.gtf | \ | |
tr -d ";\"" | \ | |
awk -F " " -f gene_counter.awk > number_of_exons_by_gene.txt | |
# see if it works now | |
head number_of_exons_by_gene.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment