Last active
August 29, 2015 14:26
-
-
Save genomewalker/089690cc59795ae73125 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
#Read a hist file from bedtools coverage -hist and create a coverage per orf file. | |
#Coverage per each gene is calculated as: coverage_orfA = sum(depth_of_coverage * fraction_covered) | |
{ | |
if ($0 i ~ /^all/){ | |
next; | |
}else{ | |
split($4,a,"_"); | |
b=$1"_"$6"_"$2+1"_"$3"_orf-"a[2]"\t"$13; | |
c[b]=c[b] + ($11*$14) | |
} | |
}END{ | |
for (var in c){ | |
print var"\t"c[var] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment