Mercurial > repos > arkarachai-fungtammasan > microsatellite_ngs
diff test-data/changespacetounderscore_readname.py @ 4:ecfc9041bcc5
Deleted selected files
author | arkarachai-fungtammasan |
---|---|
date | Wed, 01 Apr 2015 14:05:54 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/changespacetounderscore_readname.py Wed Apr 01 14:05:54 2015 -0400 @@ -0,0 +1,15 @@ +import sys +fd=open(sys.argv[1]) +output=open(sys.argv[2],'w') +columntochange=int(sys.argv[3])-1 # default is 6-1=5 +lines=fd.xreadlines() +for line in lines: + temp=line.strip().split('\t') + temp=filter(None,temp) + temp2=temp[columntochange].replace(' ','_') + product=temp[:columntochange] + product.append(temp2) + product.extend(temp[columntochange+1:]) + output.writelines('\t'.join(product)+'\n') +fd.close() +output.close() \ No newline at end of file