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
#!/bin/env python3 | |
#Usage: mstrg_prep.py merged.gtf > merged_prep.gtf | |
import re, fileinput | |
g={} #gene_id => {ref_gene_ids} | |
prep=[] #array of [line, mstrg_id] | |
for line in fileinput.input(): | |
line=line.rstrip() | |
t=line.split('\t') | |
if len(t)<9: | |
print(line) |
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
#!/bin/env perl | |
#Usage: mstrg_prep.pl merged.gtf > merged_prep.gtf | |
use strict; | |
my %g; # gene_id => \%ref_gene_ids (or gene_names) | |
my @prep; # array of [line, original_id] | |
while (<>) { | |
s/ +$//; | |
my @t=split(/\t/); | |
unless (@t>8) { print $_; next } | |
my ($gid)=($t[8]=~m/gene_id "(MSTRG\.\d+)"/); |
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
char* str=brec->tag_str("ZD"); //let's say the tag is "ZD" | |
GVec<int> vals; | |
char* p=str; //slice start | |
for (int i=0;;++i) { | |
char ch=str[i]; | |
if (ch==',') { | |
str[i]=0; | |
int v=atoi(p); //check for int parsing errors? | |
vals.Add(v); | |
p=str+i+1; |