From c3689d16bce03c36e12e1107fb73f882e64b9dc1 Mon Sep 17 00:00:00 2001
From: David Emms <david_emms@hotmail.com>
Date: Wed, 7 Sep 2016 10:28:54 +0100
Subject: [PATCH] Don't split accessions at '|' for gene trees

---
 orthofinder/scripts/get_orthologues.py | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/orthofinder/scripts/get_orthologues.py b/orthofinder/scripts/get_orthologues.py
index 3cf29a7..85786f6 100755
--- a/orthofinder/scripts/get_orthologues.py
+++ b/orthofinder/scripts/get_orthologues.py
@@ -104,20 +104,13 @@ class OrthoGroupsSet(object):
         d = self.speciesIDsEx.GetIDToNameDict()
         return {k:v.rsplit(".",1)[0] for k,v in d.items()}
         
-    def Spec_SeqDict(self, qSplitBar=True):
+    def Spec_SeqDict(self):
         if self._Spec_SeqIDs != None:
             return self._Spec_SeqIDs
-#        try:
         seqs = self.SequenceDict()
         specs = self.SpeciesDict()
-        self._Spec_SeqIDs = dict()
-        for seq in seqs:
-            iSpecies = seq.split("_")[0]
-            if iSpecies not in specs: continue
-            if qSplitBar:
-                self._Spec_SeqIDs[seq] = specs[iSpecies].replace(". ", "_").replace(" ", "_") + "_" + seqs[seq].split("|")[0]
-            else:
-                self._Spec_SeqIDs[seq] = specs[iSpecies].replace(". ", "_").replace(" ", "_") + "_" + seqs[seq]
+        specs_ed = {k:v.replace(".", "_").replace(" ", "_") for k,v in specs.items()}
+        self._Spec_SeqIDs = {seqID:specs_ed[seqID.split("_")[0]] + "_" + name for seqID, name in seqs.items()}
         return self._Spec_SeqIDs
     
     def OGs(self):
-- 
GitLab