/usr/bin/discoSnp_to_csv is in discosnp 1.2.6-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | #!/usr/bin/env python
import sys
if len(sys.argv) !=2:
print "Mandatory: python discoSnp_to_csv.py prefix_coherent_k_kval_c_cval.fa"
print "This program formats the .fa to .csv format by puting each couple of .fa sequence (4 lines = 2 comments + 2 nucleotide sequences) into one line, replacing the '|' character by spaces and removing the CX_ formating"
sys.exit(1)
f=open(sys.argv[1], "r")
while 1:
com1_1=f.readline()
if not com1_1:
break
data1_1=f.readline()
if not data1_1:
break
com1_2=f.readline()
if not com1_2:
break
data1_2=f.readline()
if not data1_2:
break
com1_tab=com1_1.split("|")
# prints all before coverages
for i in range(0,4):
print com1_tab[i],
# prints coverages
i=4
while com1_tab[i][0:1]!="C" and i<len(com1_tab):
i+=1
while com1_tab[i][0:1]=="C":
print com1_tab[i].split("_")[1],
i+=1
# prints all remaining
while i<len(com1_tab)-1:
print com1_tab[i],
i+=1
print com1_tab[i][:-1],
print data1_1[:-1],
com2_tab=com1_2.split("|")
# prints all before coverages
for i in range(0,4):
print com2_tab[i],
# prints coverages
i=4
while com1_tab[i][0:1]!="C" and i<len(com1_tab):
i+=1
while com2_tab[i][0:1]=="C":
print com2_tab[i].split("_")[1],
i+=1
# prints all remaining
while i<len(com2_tab)-1:
print com2_tab[i],
i+=1
print com2_tab[i][:-1],
print data1_2,
|