Skip to content
Snippets Groups Projects
Commit 299f5b74 authored by SimonBache's avatar SimonBache
Browse files

changes count_effectors.py and gff_sort.py

parent 0b379c8c
No related branches found
No related tags found
No related merge requests found
......@@ -36,9 +36,9 @@ def main(gff, output, fasta_file):
for lignes in f1:
ligne = lignes.rstrip("\n")
col = ligne.split("\t")
id_1 = re.sub("ID=", "", col[8])
id_2 = re.sub(";Name=\w+", "", id_1)
if col[2] =="gene":
if col[2] == "gene":
id_1 = re.sub("ID=", "", col[8])
id_2 = re.sub(";Name=\w+", "", id_1)
gff_parse.append(col[0]+" "+col[1]+" "+col[2]+" "+id_2)
dico_gff[col[0]].append(id_2)
......
......@@ -22,10 +22,10 @@ def main(gff, output, strain_name):
with open(gff, "r") as f1:
for lignes in f1:
col = lignes.split("\t")
if re.search("gene",col[2]):
id_strain = re.sub("ID=","ID="+strain_name+"_",col[8])
prot_gff = re.sub(";","T0;",id_strain)
gene_gff.append(col[0]+"\t"+col[1]+"\t"+col[2]+"\t"+col[3]+"\t"+col[4]+"\t"+col[5]+"\t"+col[6]+"\t"+col[7]+"\t"+prot_gff)
id_strain = re.sub("ID=","ID="+strain_name+"_",col[8])
prot_gff = re.sub(";","T0;",id_strain)
prot_gff = re.sub("T0T0", "T0", prot_gff)
gene_gff.append(col[0]+"\t"+col[1]+"\t"+col[2]+"\t"+col[3]+"\t"+col[4]+"\t"+col[5]+"\t"+col[6]+"\t"+col[7]+"\t"+prot_gff)
output_file = open(output,"w")
for elem in gene_gff:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment