Skip to content

Commit

Permalink
batchStr2IPD
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume DELEVOYE committed Jan 31, 2020
1 parent dbdb9c0 commit 795e0b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ipdtools/ipdModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ def __init__(self,sequence,name="NO_ID",model="SP2-C2"):
def predict(self,position,strand=0):
return self.predictfunc(position,strand)

class batchStr2IPD():
def __init__(self,sequences=[],names=[],model="SP2-C2"):
self.sequences = [Contig(name,sequence) for (x,y) in zip(sequences,names)]
for x in self.sequences:
x.cmph5ID = x.id
self.model = IpdModel(self.sequences,modelFile=transform_model_name(model))
self.predictfunc = {x:self.model.predictIpdFuncModel(refId=name) for x in names}
def predict(self,sequence,position,strand=0):
return self.predictfunc[sequence](position,strand)


def transform_model_name(modelname):
resources_dir = _getAbsPath("/resources/")
Expand Down

0 comments on commit 795e0b7

Please sign in to comment.