当前位置: 首页>>代码示例>>Python>>正文


Python NGS_Util.createFilePath方法代码示例

本文整理汇总了Python中NGS_Util.createFilePath方法的典型用法代码示例。如果您正苦于以下问题:Python NGS_Util.createFilePath方法的具体用法?Python NGS_Util.createFilePath怎么用?Python NGS_Util.createFilePath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NGS_Util的用法示例。


在下文中一共展示了NGS_Util.createFilePath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run_Org_vs_Uniprot_ClusterBlast

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def run_Org_vs_Uniprot_ClusterBlast(self, organismName):
    
        try:
              
            splitFasta = MetabolicReconstructionPipeline_SplitFasta.MetabolicReconstructionPipeline_SplitFasta()
           
            ###############################################################################################################################################

            org_fasta = NGS_Util.createFilePath(self.orgFastaDir, organismName+".faa")

            splitFasta.splitOrganismDataFile(organismName, org_fasta, self.numberOfFragments)

            ###################################################################################################################################
            
            clusterArrayCall =  "qsub -t 1-" + str(self.numberOfFragments) + ":1 " + ScriptsDir.ClusterBlast
            
            blastP = NGS_Util.createFilePath(ScriptsDir.BlastDir,"blastp")
            
            outfmt = str(6)
            
            splitFile = splitFasta.organismSplitDataDir + organismName 

            org_vs_UniprotBlastDB =  NGS_Util.createFilePath(self.orgBlastResDir, organismName + "-vs-up" )
                

            call = clusterArrayCall + " "  + blastP  + " "  + self.uniprot_blast_db + " "  + splitFile + " " + outfmt + " " + org_vs_UniprotBlastDB  + " " + str(self.blastEValue)
                

            NGS_Util.executeCall(call)



        except Exception:
            
            print traceback.print_exc()
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:37,代码来源:MetabolicReconstructionPipeline_ClusterBlast.py

示例2: moveBLASTResults

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def moveBLASTResults(self):
    
        try:
                
            print "moveBLASTResults"

            orgListFile_fh = open(self.orgListFile)

            NGS_Util.zipDirectory(self.orgBlastResDir)
	    
            NGS_Util.moveDirectoryFiles(self.orgBlastResDir,self.moveToDir_orgBlastResDir)


	    for line in orgListFile_fh:

                organismNameID, organismName = line.strip().split()

		orgRectifyBlast = NGS_Util.createFilePath(self.jointBlastDir, organismName + ".joint.blast")
		moveto_orgRectifyBlast = NGS_Util.createFilePath(self.moveToDir_jointBlastDir, organismName + ".joint.blast")

		self.moveFile_createLink(orgRectifyBlast,moveto_orgRectifyBlast)
		    

            orgListFile_fh.close() 
     
        except Exception:
            
            print traceback.print_exc()
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:30,代码来源:MetabolicReconstructionPipeline_ClusterUtil.py

示例3: copySequenceFiles

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def copySequenceFiles(self, srcDataDir):
    
        try:
                
            print("Copy Fasta Files from %s to %s" %(srcDataDir,self.orgFastaDir))

            orgListFile_fh = open(self.orgListFile)

	    for line in orgListFile_fh:

                organismNameID, organismName = line.strip().split()

 		if not os.path.exists( NGS_Util.createFilePath(self.orgFastaDir, organismName + ".faa") ):

 		    orgFasta = NGS_Util.createFilePath(srcDataDir, organismName + ".faa")
		
		    NGS_Util.copyFile(orgFasta, self.orgFastaDir)		    
                    print("Copied fasta file for %s" % (organismName))
                else:
                    print("\tDoing nothing (files already copied) for %s" % (organismName))
                

            orgListFile_fh.close() 
     
        except Exception:
            
            print traceback.print_exc()
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:29,代码来源:MetabolicReconstructionPipeline_ClusterUtil.py

示例4: moveIPRScanResults

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def moveIPRScanResults(self):
    
        try:
                
            print "moveIPRScanResults"

            orgListFile_fh = open(self.orgListFile)

            NGS_Util.zipDirectory(self.orgIPRScanDir)
	    NGS_Util.moveDirectoryFiles(self.orgIPRScanDir,self.moveToDir_orgIPRScanDir)

            for line in orgListFile_fh:

                organismNameID, organismName = line.strip().split()

		organism_raw_final        = NGS_Util.createFilePath(self.InterProScan_EC_RAW_results, organismName + ".faa.raw.txt")
		moveto_organism_raw_final = NGS_Util.createFilePath(self.moveToDir_InterProScan_EC_RAW_results, organismName + ".faa.raw.txt")

		self.moveFile_createLink(organism_raw_final,moveto_organism_raw_final)


		organism_IPR_final        = NGS_Util.createFilePath(self.InterProScan_EC_RAW_results, organismName + ".faa.IPR.final.txt")
		moveto_organism_IPR_final = NGS_Util.createFilePath(self.moveToDir_InterProScan_EC_RAW_results, organismName + ".faa.IPR.final.txt")
		
		self.moveFile_createLink(organism_IPR_final,moveto_organism_IPR_final)
		    

            orgListFile_fh.close() 
     
        except Exception:
            
            print traceback.print_exc()
            
        return ""
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:36,代码来源:MetabolicReconstructionPipeline_ClusterUtil.py

示例5: moveGTGResults

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def moveGTGResults(self):
    
        try:
                
            print "moveGTGResults"

            orgListFile_fh = open(self.orgListFile)


            NGS_Util.zipDirectory(self.orgGTGBlastResDir)

	    NGS_Util.moveDirectoryFiles(self.orgGTGBlastResDir,self.moveToDir_orgGTGBlastResDir)

            NGS_Util.zipDirectory(self.GTGBestHitsDir)

	    NGS_Util.moveDirectoryFiles(self.GTGBestHitsDir,self.moveToDir_GTGBestHitsDir)
	    
	    
	    for line in orgListFile_fh:

                organismNameID, organismName = line.strip().split()

		org_gtg_knn_final        = NGS_Util.createFilePath(self.GTGKNNDir, organismNameID + ".gtg.knn")
		moveto_org_gtg_knn_final = NGS_Util.createFilePath(self.moveToDir_GTGKNNDir, organismNameID + ".gtg.knn")

		self.moveFile_createLink(org_gtg_knn_final,moveto_org_gtg_knn_final)
		    

            orgListFile_fh.close() 
     
        except Exception:
            
            print traceback.print_exc()
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:35,代码来源:MetabolicReconstructionPipeline_ClusterUtil.py

示例6: rawIPRScan

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def rawIPRScan(self, organismName, org_ipr_split_dir):
    
        try:
        
            print "rawIPRScan: " + organismName

	    
            for fragment in range(self.numberOfFragments):

		org_ipr_split_file = NGS_Util.createFilePath(self.splitFasta.organismSplitDataDir,organismName + "_" +  str(fragment+1) )

		self.raw_split_IPRScan(organismName, org_ipr_split_file, str(fragment+1))


            ipr_raw_file_split = NGS_Util.createFilePath(self.orgIPRScanDir, organismName + "_split_*")
            
            ipr_raw_file = NGS_Util.createFilePath(self.orgIPRScanDir, organismName + ".ipr.raw")
            
            call = "cat " + ipr_raw_file_split + " > " + ipr_raw_file

	    NGS_Util.executeCall(call)

            return ipr_raw_file
        
        except Exception:
            
            print traceback.print_exc()
        
        return ""
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:31,代码来源:MetabolicReconstructionPipeline_IPRScan.py

示例7: blast_org_vs_nr40_blast_formatted_11

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def blast_org_vs_nr40_blast_formatted_11(self, organismName):
    
        try:
           
            org_fasta = NGS_Util.createFilePath(self.orgFastaDir, organismName+".faa")

            clusterArrayCall =  "qsub -t 1-1 " + ScriptsDir.ClusterGTGBlast
            
            blastP = NGS_Util.createFilePath(ScriptsDir.BlastDir,"blastp")
            
            outfmt = str(11)
            
            org_vs_nr40BlastDB_f11 = NGS_Util.createFilePath(self.orgGTGBlastResDir, organismName + ".nrdb40_v2.txt")    

            call = clusterArrayCall + " "  + blastP  + " "  + self.nrdb40_blast_db + " "  + org_fasta + " " + outfmt + " " + org_vs_nr40BlastDB_f11  + " " + str(self.blastEValue)
                
            NGS_Util.executeCall(call)


            return org_vs_nr40BlastDB_f11
            	    
    
        except Exception:
            
            print traceback.print_exc()
            
        return ""
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:29,代码来源:MetabolicReconstructionPipeline_ClusterGTG.py

示例8: makeBlastDB

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def makeBlastDB(self, organismName):
    
        try:

            print "Make Blast Database: " + organismName
            
            org_fasta    = NGS_Util.createFilePath(self.orgFastaDir, organismName+".faa")
            
            org_dust     = NGS_Util.createFilePath(self.orgBlastDustDir, organismName+"_dust.asnb")
            
            org_blast_db = NGS_Util.createFilePath(self.orgBlastDBDir, organismName)
            
            if os.path.exists(org_fasta):

                if not os.path.exists(org_blast_db + ".phd") and not os.path.exists(org_blast_db + ".psq"):
                
                    self.ngsBlast.makeProteinBlastDBFromDustFile(org_fasta,org_dust,org_blast_db)
                
                return org_blast_db
            
        except Exception:
            
            print traceback.print_exc()
        
        return ""
开发者ID:BioinformaticsArchive,项目名称:CoReCo,代码行数:27,代码来源:MetabolicReconstructionPipeline_Blast.py

示例9: runClusterIPRScan

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def runClusterIPRScan(self, organismName):
    
        try:
           
            splitFasta = MetabolicReconstructionPipeline_SplitFasta.MetabolicReconstructionPipeline_SplitFasta()
           
            #numberOfFragments = 10
                       
            ###############################################################################################################################################

            org_fasta = NGS_Util.createFilePath(self.orgFastaDir, organismName+".faa")

            splitFasta.splitOrganismDataFile(organismName, org_fasta, self.numberOfFragments)

            ###################################################################################################################################
            
            clusterArrayCall =  "qsub -t 1-" + str(self.numberOfFragments) + ":1 " +  ScriptsDir.ClusterIprscan
            
            iprscan = NGS_Util.createFilePath(ScriptsDir.IprscanDir,"interproscan.sh ")
            
            splitFile = splitFasta.organismSplitDataDir + organismName
            
            ipr_raw_file_split = NGS_Util.createFilePath(self.orgIPRScanDir, organismName + "_split" )
                           
            call = clusterArrayCall + " "  + iprscan  + " "  + splitFile + " " + ipr_raw_file_split
            
            NGS_Util.executeCall(call)
            
    
        except Exception:
            
            print traceback.print_exc()
            
        return ""
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:36,代码来源:MetabolicReconstructionPipeline_ClusterIPRScan.py

示例10: concatenate_Org_vs_Uniprot_ClusterBlast_results

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
 def concatenate_Org_vs_Uniprot_ClusterBlast_results(self, organismName):
 
     try:
         
         clusterProcessing = True
         
         for fragment in range(self.numberOfFragments):
                                        
             org_vs_UniprotBlastDB =  NGS_Util.createFilePath(self.orgBlastResDir, organismName + "-vs-up_" + str(fragment+1) + ".blast" )
             
             if not os.path.exists(org_vs_UniprotBlastDB):
                 clusterProcessing = False
                 break
                 
                
         if (clusterProcessing):
                                
             org_vs_UniprotBlastDB =  NGS_Util.createFilePath(self.orgBlastResDir, organismName + "-vs-up.blast" )
 
             call = "cat " + NGS_Util.createFilePath(self.orgBlastResDir, organismName + "-vs-up_*") + " > " + org_vs_UniprotBlastDB
 
             NGS_Util.executeCall(call)
             
             
             return org_vs_UniprotBlastDB
         
         else:
             print organismName + "-vs-Uniprot BLAST incomplete"
         
 
     except Exception:
         
         print traceback.print_exc()
         
     return ""
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:37,代码来源:MetabolicReconstructionPipeline_ClusterBlast.py

示例11: getBlastScore

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def getBlastScore(self, mode):
    
            try:

                print "getBlastScores"

                orgListFile_fh = open(self.orgListFile)
    
                for line in orgListFile_fh:
                    
                    organismNameID, organismName = line.strip().split()
                    
                    orgJointBlast   = NGS_Util.createFilePath(self.orgBlastResDir, organismName + ".joint.blast")
                    orgRectifyBlast = NGS_Util.createFilePath(self.jointBlastDir, organismName + ".joint.blast")
                    
                    print "getBlastScore:" + organismName
                    if not os.path.exists(orgRectifyBlast):
                        
                        if os.path.exists(orgJointBlast):

                            orgRectifyBlast = self.rectifyBlast(organismName, orgJointBlast)
                        
                        else:

                            if (mode == 1):                                                        
                                
                                org_blast_db = self.makeBlastDB(organismName)
                                                       
                                self.run_Org_vs_Uniprot_ClusterBlast(organismName)
                                
                                time.sleep(1800) #wait for 15 minutes
                                    
                                self.run_Uniprot_vs_Org_ClusterBlast(organismName)

                                time.sleep(2400) #wait for 20 minutes

                            elif (mode == 2):
                                
                                org_vs_UniprotBlastDB = self.concatenate_Org_vs_Uniprot_ClusterBlast_results(organismName)
                                Uniprot_vs_orgBlastDB = self.concatenate_Uniprot_vs_Org_ClusterBlast_results(organismName)
                            
                                if (org_vs_UniprotBlastDB != "" and Uniprot_vs_orgBlastDB != ""):
                                    orgJointBlast = self.combineBlast(organismName, org_vs_UniprotBlastDB, Uniprot_vs_orgBlastDB)
                                
                                    if (orgJointBlast != ""):
                                        orgRectifyBlast = self.rectifyBlast(organismName, orgJointBlast)
                              
                orgListFile_fh.close() 
         
            except Exception:
                
                print traceback.print_exc()
                
            return ""
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:56,代码来源:MetabolicReconstructionPipeline_ClusterBlast.py

示例12: getIPRScanScore

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def getIPRScanScore(self, mode):
    
        try:
        
                
            print "getIPRScanScore"

            orgListFile_fh = open(self.orgListFile)

            for line in orgListFile_fh:
                
                organismNameID, organismName = line.strip().split()
                
                organism_IPR_final = NGS_Util.createFilePath(self.fungi_InterProScan_result, organismName + ".faa.IPR.final.txt")

               
                if not os.path.exists(organism_IPR_final):
                    
                    print "getIPRScanScore : " + organismName
                    
                    if mode == 1:

                        self.runClusterIPRScan(organismName)
                        
                        time.sleep(21600) # sleep for 6 hrs
                        
                    elif mode == 2:
                        
                        ipr_xml_file = self.concatenate_ClusterIPRScan_results(organismName)                        
                        ipr_raw_file = self.xmlIPRScanToRAWOutput(organismName, ipr_xml_file)
    
                        organism_ipr2go = self.extract_ipr2go_based_on_xml(organismName, ipr_xml_file)
                        organism_ipr2ec = self.map_ipr_to_specific_ecs(organismName, organism_ipr2go)
                        organism_seqid2ec = self.combine_iprscan_raw_result_with_ipr2ec( organismName, organism_ipr2ec, ipr_raw_file)
                        
                       
                        if os.path.exists(ipr_raw_file) and os.path.exists(organism_seqid2ec):
    
    
                            organism_raw_final = NGS_Util.createFilePath(self.fungi_InterProScan_result, organismName + ".faa.raw.txt")                        
                            organism_IPR_final = NGS_Util.createFilePath(self.fungi_InterProScan_result, organismName + ".faa.IPR.final.txt")
                            
                            NGS_Util.copyFile(ipr_raw_file, organism_raw_final)
                            NGS_Util.copyFile(organism_seqid2ec, organism_IPR_final)


            orgListFile_fh.close() 
     
        except Exception:
            
            print traceback.print_exc()
            
        return ""
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:55,代码来源:MetabolicReconstructionPipeline_ClusterIPRScan.py

示例13: getBlastScore

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def getBlastScore(self):
    
        try:
        
            orgListFile_fh = open(self.orgListFile)

            for line in orgListFile_fh:
                
                organismNameID, organismName = line.strip().split()
                
                orgRectifyBlast = NGS_Util.createFilePath(self.jointBlastDir, organismName + ".joint.blast")
                
                if not os.path.exists(orgRectifyBlast):
                    
                    print "getBlastScore:" + organismName
                    
                    org_blast_db = self.makeBlastDB(organismName)
                    
                    org_vs_UniprotBlastDB = self.blast_org_vs_uniprot(organismName)
                        
                    Uniprot_vs_orgBlastDB = self.blast_uniprot_vs_org(organismName)
                    
                    if (org_vs_UniprotBlastDB != "" and Uniprot_vs_orgBlastDB != ""):
                        orgJointBlast = self.combineBlast(organismName, org_vs_UniprotBlastDB, Uniprot_vs_orgBlastDB)
                    
                        if (orgJointBlast != ""):
                            orgRectifyBlast = self.rectifyBlast(organismName, orgJointBlast)
                          
            orgListFile_fh.close() 
     
        except Exception:
            
            print traceback.print_exc()
            
        return ""
开发者ID:BioinformaticsArchive,项目名称:CoReCo,代码行数:37,代码来源:MetabolicReconstructionPipeline_Blast.py

示例14: combineBlast

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def combineBlast(self, organismName, org_vs_UniprotBlastDB, Uniprot_vs_orgBlastDB):
    
        try:
        
            print "Combine Blast: " + organismName
            
            orgJointBlast            = NGS_Util.createFilePath(self.orgBlastResDir, organismName + ".joint.blast")
            
            org_vs_UniprotBlastDB_fh = open(org_vs_UniprotBlastDB)
            
            Uniprot_vs_orgBlastDB_fh = open(Uniprot_vs_orgBlastDB)
            
            ec_files_fh              = open(self.ec_files)
            
            orgJointBlast_fh         = open(orgJointBlast, "w")
            

            combineBlasts(ec_files_fh, org_vs_UniprotBlastDB_fh, Uniprot_vs_orgBlastDB_fh, orgJointBlast_fh)

            
            org_vs_UniprotBlastDB_fh.close()
            Uniprot_vs_orgBlastDB_fh.close()
            ec_files_fh.close()
            orgJointBlast_fh.close()
            
 
            return orgJointBlast
        
        except Exception:
            
            print traceback.print_exc()
            
        return ""
开发者ID:BioinformaticsArchive,项目名称:CoReCo,代码行数:35,代码来源:MetabolicReconstructionPipeline_Blast.py

示例15: concatenate_ClusterIPRScan_results

# 需要导入模块: import NGS_Util [as 别名]
# 或者: from NGS_Util import createFilePath [as 别名]
    def concatenate_ClusterIPRScan_results(self, organismName):
    
        try:          
          
            #numberOfFragments = 10
            
            clusterProcessing = True

            for fragment in range(self.numberOfFragments):
                                           
                ipr_raw_file_split = NGS_Util.createFilePath(self.orgIPRScanDir, organismName + "_split_" +  str(fragment+1) + ".xml")
                
                if not os.path.exists(ipr_raw_file_split):                   
                    clusterProcessing = False
                    break
            
            if clusterProcessing:
                
                ipr_xml_file = self.mergeXML(organismName)
                return ipr_xml_file
                
            
            else:
                print "Interpro incomplete for: " +  organismName
                
        except Exception:
            
            print traceback.print_exc()
            
        return ""
开发者ID:SandraCastilloPriego,项目名称:CoReCo,代码行数:32,代码来源:MetabolicReconstructionPipeline_ClusterIPRScan.py


注:本文中的NGS_Util.createFilePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。