Example #1
0
 def doTestMapCds(self, contained):
     destAlns = loadPslFile(self.getInputFile("clonesWeird.psl"),
                            inclUnaln=True)
     srcAlns = loadPslFile(self.getInputFile("refseqWeird.psl"),
                           self.getInputFile("refseqWeird.cds"),
                           inclUnaln=True,
                           projectCds=True)
     mappedAlns = []
     for destAln in destAlns:
         for srcAln in srcAlns:
             if srcAln.qSeq.cds == None:
                 raise Exception("no qCDS: " + srcAln.qSeq.id + " <=> " + srcAln.tSeq.id)
             if srcAln.tSeq.cds == None:
                 raise Exception("no tCDS: " + srcAln.qSeq.id + " <=> " + srcAln.tSeq.id)
             if srcAln.targetOverlap(destAln):
                 ma = destAln.copy()
                 ma.mapCds(srcAln, srcAln.tSeq, ma.tSeq, contained=contained)
                 mappedAlns.append(WithSrcCds(srcAln, ma))
     self.__dumpNDiff(mappedAlns, ".out")
Example #2
0
 def testRevCmpl(self):
     alns = loadPslFile(self.getInputFile("hsRefSeq.psl"),
                        self.getInputFile("hsRefSeq.cds"))
     ralns = []
     rralns = []
     for pa in alns:
         rpa = pa.revCmpl()
         ralns.append(rpa)
         rralns.append(rpa.revCmpl())
     self.__dumpNDiff(ralns, ".rout")
     self.__dumpNDiff(rralns, ".rrout")
Example #3
0
 def testRevCmpl(self):
     alns = loadPslFile(self.getInputFile("hsRefSeq.psl"),
                            self.getInputFile("hsRefSeq.cds"))
     ralns = []
     rralns = []
     for pa in alns:
         rpa = pa.revCmpl()
         ralns.append(rpa)
         rralns.append(rpa.revCmpl())
     self.__dumpNDiff(ralns, ".rout")
     self.__dumpNDiff(rralns, ".rrout")
Example #4
0
 def doTestProjectCds(self, contained):
     alns = loadPslFile(self.getInputFile("refseqWeird.psl"),
                        self.getInputFile("refseqWeird.cds"),
                        inclUnaln=True)
     qalns = []
     for pa in alns:
         pa.projectCdsToTarget(contained=contained)
         # project back
         qpa = pa.copy()
         qpa.qSubSeqs.clearCds()
         qpa.projectCdsToQuery(contained=contained)
         qalns.append(qpa)
     self.__dumpNDiff(alns, ".tout")
     self.__dumpNDiff(qalns, ".qout")
Example #5
0
 def doTestProjectCds(self, contained):
     alns = loadPslFile(self.getInputFile("refseqWeird.psl"),
                        self.getInputFile("refseqWeird.cds"),
                        inclUnaln=True)
     qalns = []
     for pa in alns:
         pa.projectCdsToTarget(contained=contained)
         # project back
         qpa = pa.copy()
         qpa.qSubSeqs.clearCds()
         qpa.projectCdsToQuery(contained=contained)
         qalns.append(qpa)
     self.__dumpNDiff(alns, ".tout")
     self.__dumpNDiff(qalns, ".qout")
Example #6
0
 def doTestMapCds(self, contained):
     destAlns = loadPslFile(self.getInputFile("clonesWeird.psl"),
                            inclUnaln=True)
     srcAlns = loadPslFile(self.getInputFile("refseqWeird.psl"),
                           self.getInputFile("refseqWeird.cds"),
                           inclUnaln=True,
                           projectCds=True)
     mappedAlns = []
     for destAln in destAlns:
         for srcAln in srcAlns:
             if srcAln.qSeq.cds == None:
                 raise Exception("no qCDS: " + srcAln.qSeq.id + " <=> " +
                                 srcAln.tSeq.id)
             if srcAln.tSeq.cds == None:
                 raise Exception("no tCDS: " + srcAln.qSeq.id + " <=> " +
                                 srcAln.tSeq.id)
             if srcAln.targetOverlap(destAln):
                 ma = destAln.copy()
                 ma.mapCds(srcAln,
                           srcAln.tSeq,
                           ma.tSeq,
                           contained=contained)
                 mappedAlns.append(WithSrcCds(srcAln, ma))
     self.__dumpNDiff(mappedAlns, ".out")
Example #7
0
 def testLoadUnaln(self):
     alns = loadPslFile(self.getInputFile("hsRefSeq.psl"),
                        self.getInputFile("hsRefSeq.cds"),
                        inclUnaln=True)
     self.__dumpNDiff(alns, ".out")
Example #8
0
 def testLoad(self):
     alns = loadPslFile(self.getInputFile("hsRefSeq.psl"),
                        self.getInputFile("hsRefSeq.cds"))
     self.__dumpNDiff(alns, ".out")
Example #9
0
 def testLoadUnaln(self):
     alns = loadPslFile(self.getInputFile("hsRefSeq.psl"),
                        self.getInputFile("hsRefSeq.cds"),
                        inclUnaln=True)
     self.__dumpNDiff(alns, ".out")
Example #10
0
 def testLoad(self):
     alns = loadPslFile(self.getInputFile("hsRefSeq.psl"),
                        self.getInputFile("hsRefSeq.cds"))
     self.__dumpNDiff(alns, ".out")