Commit 57f4f8cd authored by Schoorlemmer, Joran's avatar Schoorlemmer, Joran
Browse files

Replace extractcounts.py

parent 004b0591
......@@ -32,10 +32,11 @@ def parse_gtf(in_file, read_length = 100):
# turn into into int to do calculations
trans_len = abs(int(line_cont[4])-int(line_cont[3]))
gene_info = line_cont[8].split(' ')
if len(gene_info) == 16:
gene_name = gene_info[9].lstrip('"').rstrip('";')
cov = float(gene_info[11].lstrip('"').rstrip('";'))
genes[gene_name] = round(cov * trans_len /read_length)
if len(gene_info) == 12:
gene_name = gene_info[5].lstrip('"').rstrip('";')
cov = float(gene_info[7].lstrip('"').rstrip('";'))
if cov > 0.01:
genes[gene_name] = round(cov * trans_len /read_length)
return genes
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment