コード例 #1
0
ファイル: apytram.py プロジェクト: msemon/apytram
        elif i >= 2:
            logger.info("Refind the \"parent\" contig from the previous contig for each contig and check they are different")
            # We use Exonerate 
            start_exo_time = time.time()
            ExonerateProcess = Aligner.Exonerate(FileteredTrinityFasta, "%s/Trinity_iter_%d.filtered.fasta" % (TmpDirName,i-1) )
            # We want to keep only the best hit for each contigs
            Exonerate = "%s/iter_%d_%d.exonerate" % (TmpDirName, i-1, i)
            ExonerateProcess.Bestn = 1
            ExonerateProcess.Model =  "est2genome"
            # We customize our output format
            ExonerateProcess.Ryo = "%ti\t%qi\t%ql\t%qal\t%tal\t%tl\t%pi\n"
            ExonerateResult = ExonerateProcess.get_output()
            ExonerateFile = open(Exonerate,"w")
            ExonerateFile.write(ExonerateResult)
            ExonerateFile.close()
            AlmostIdenticalResults = ApytramNeeds.check_almost_identical_exonerate_results(ExonerateResult)
            if AlmostIdenticalResults and not FinishAllIter:
                logger.info("Contigs are almost identical than the previous iteration (Same size (~98%), > 99% identity)")
                Stop =True
            StatsDict[i]["Exonerate2Time"] = time.time() - start_exo_time
            logger.debug("exonerate on previous iter --- %s seconds ---" % (StatsDict[(i)]["Exonerate2Time"]))
 
        # Check that the coverage has inscreased compared to the previous iteration
    
        logger.info("Check that the coverage has inscreased compared to the previous iteration")
        # We use Mafft
        start_mafft_time = time.time()
        MafftProcess = Aligner.Mafft(QueryFile)
        MafftProcess.QuietOption = True
        MafftProcess.AdjustdirectionOption = True
        MafftProcess.AddOption = FileteredTrinityFasta