Skip to content

Instantly share code, notes, and snippets.

@gpratt
Created April 24, 2015 20:53
Show Gist options
  • Save gpratt/a747b8f559cb1db392dc to your computer and use it in GitHub Desktop.
Save gpratt/a747b8f559cb1db392dc to your computer and use it in GitHub Desktop.
count_to_rpkm_function
def counts_to_rpkm(featureCountsTable):
counts = featureCountsTable.ix[:,5:]
lengths = featureCountsTable['Length']
mapped_reads = counts.sum()
return (counts * pow(10,9)).div(mapped_reads, axis=1).div(lengths, axis=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment