comparison mircounts.py @ 9:2a08a6eb471c draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/mircounts commit 6013aaf29ff7aa2d1aab434f2355da327c7ef102
author artbio
date Wed, 25 Apr 2018 12:48:27 -0400
parents da1aa7de2b19
children b045c30fb768
comparison
equal deleted inserted replaced
8:3f62272192f9 9:2a08a6eb471c
62 for line in open(gff_file, 'r'): 62 for line in open(gff_file, 'r'):
63 if line[0] != '#': 63 if line[0] != '#':
64 gff_fields = line[:-1].split("\t") 64 gff_fields = line[:-1].split("\t")
65 if gff_fields[2] == 'miRNA': 65 if gff_fields[2] == 'miRNA':
66 mir_name = gff_fields[0] 66 mir_name = gff_fields[0]
67 premir_name = gff_fields[8].split('=')[-1] 67 premir_name = gff_fields[8].split('Parent_mir_Name=')[-1]
68 mir_start = int(gff_fields[3]) 68 mir_start = int(gff_fields[3])
69 mir_end = int(gff_fields[4]) 69 mir_end = int(gff_fields[4])
70 # GFF is 1-based, pysam is 0-based. 70 # GFF is 1-based, pysam is 0-based.
71 counts[mir_name] = bamfile.count(reference=premir_name, 71 counts[mir_name] = bamfile.count(reference=premir_name,
72 start=mir_start-1, 72 start=mir_start-1,