Created
August 22, 2019 10:35
-
-
Save ag1805x/c4957a36f9debfc7d967854561c171ab to your computer and use it in GitHub Desktop.
Code to extract GC% of genes from GFF file using bedtools
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
########################################### | |
# Code to extract GC% of genes from GFF file | |
# using bedtools | |
# - Arindam Ghosh (22 August 2019) | |
########################################### | |
bedtools nuc -fi Homo_sapiens.GRCh38.dna.primary_assembly.fa -bed Homo_sapiens.GRCh38.84.gff3 | grep ID=gene:ENSG > temp.txt | |
echo -e "GeneID\tpct_GC" > GRCh38_GeneGC.txt | |
paste <(cut -d: -f2 temp.txt | cut -d';' -f1) <(cut -f11 temp.txt) >> GRCh38_GeneGC.txt | |
rm temp.txt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment