ncbi_companion帮助您通过genbank使用fasta和映射文件构建参考数据库

NCBI-Companion的Python项目详细描述


ncbi_同伴

简介

ncbi_companion的目标是使用genbank entrez实用程序构造数据库、生成fasta文件和分类映射。

Biopython版权属于Biopython团队 Entrez版权归NCBI Entrez团队所有


内容

类荷载种类

This class is to used fetch species name contains in csv file, text file, excel or fasta file.

函数

function namesparametersReturn
LoadSpeciesspecies_input, species_output, ifoutinitialize
ReadSpeciesFile_textNonea list (if specified, a table in local directory)
ReadSpeciesFile_excelsp_col, sheetname, header, fullnamea list (or a local file)
ReadSpeciesFile_csvsp_col, header, fullnamea list (or a local file )
ExtractSpeciesFromFastaranges, delimitera list (or a local file)

all those functions return a list of species names or ID list

用法

species=LoadSpecies(input_file,output_file,ifout=True)species.ReadSpeciesFile_excel(sp_col='act_sym_fullname',sheetname=0,header=0,fullname=False)

NCBIU类工具

This class implements Biopython Entrez to interact with NCBI/Genbank API to either get accession id, taxonomy id, sequences or taxonomy ranking, or converting them. Some of core functions return a tracker flag that can trace which functions have been called. This order will be used by Sqlite_Dumps class to generate fasta file and mapping file

函数

Functionsparametersreturndatabase table nameTracker Flag
NCBI_Toolsncbi_key, ncbi_email, sqlite_db, ncbi_db, idtypeinitializeNoneNone
Update_APIkey, emailupdated key and emailNoneNone
getTrackerNonea tracker listNoneNone
ncbi_Species2Genomespecies listaccession ID listSp2GenomeP9
ncbi_Search2Accsearch terms, howmany to quireSearch2AccIDsTrackerP1
ncbi_Species2Accspecies list, more terms (optional)Sp2AccIDsTrackerP2
ncbi_GetSeqsFromAcctable_name, column_nameAcc2SeqTrackerP3
ncbi_GetTaxIdFromAcctable_name, column_nameUid2TaxIDsTrackerP4
ncbi_eAcc2Seqaccession IDTrackerAcc2SeqP5
ncbi_eAcc2TaxIDaccession IDTrackerUid2TaxIDsP6
ncbi_Species2Taxaspecies list, style, levels_nTrackerSp2TaxaP7
ncbi_Id2Taxastyle, levels_nTrackerTaxId2RankingP8

用法

示例1:已知物种列表并搜索其trnl基因

跟踪器标志:P2--->;P3/P4--->;P4/P3--->;P8

fromNCBI_CompanionimportNCBI_Companioncompanion=NCBI_Companion.NCBI_Tools(key,email,'databasename','nuccore','acc')companion.ncbi_Species2Acc(species_list,'trnL')companion.ncbi_GetSeqsFromAcc('Sp2AccIDs','acc_id')companion.ncbi_GetTaxIdFromAcc('Sp2AccIDs','acc_id')companion.ncbi_Id2Taxa(style='qiime',levels_n=7)# 7 levels of taxonomy ranking qiime style D_0_..;

类sqlite_dumps

函数

functionsparametersreturn
Sqlite_Dumpssqlite_db, output_prefix, tracker, header_type = 'acc'initialize
sqlite_dumpNonea fasta and a mapping file in local

用法

# get trackertracker=companion.getTracker()dump=Sqlite_Dumps('database constructed by NCBI_Tools','fasta and mapping file name, not extension',tracker,header_type='acc')

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
使用liblinear(java)进行机器学习概率预测,在代码中直接使用分类器   java唯一回文的总和略大于预期值   java JaxRS:从REST调用获取错误消息?   swing如果使用java满足特定条件,如何设置特定行的颜色?   HTML部署中的java LibGDX未捕获运行时异常   mysql在Java中触发事件   java在WebFlux WebClient中测试状态代码时如何获取响应体?   面向协作流消费者的java设计思想?   使用hibernate条件的多条件java Case语句   java查询选择了错误的布尔值   java如何使用assert编写selenium webdriver脚本来验证登录凭据是否正确?   java禁用JFrame中的触摸指示灯   java Querydsl:如何编写“复杂”查询   什么时候Java API中会添加新的东西   用于检查数组是否为null或空的java If语句不起作用   java如何在jstl中为(inti=0,i<=collection.size()+1,i++)创建等价项   java jsp scriplet使用具有bean值的函数