Package: ncbi-counts
ncbi_countsDownload theNCBI-generated RNA-seq count databy specifying the Series accession number(s), and the regular expression of the Sample attributes.If you just need a count matrix for all samples (GSM) in a series (GSE), this library is not needed. However, if you need a count matrix for each GSE, specifying only the control group samples and treatment group samples, this library may be useful.InstallationFromPyPI:pipinstallncbi-countsUsagepython-mncbi_counts[-h][-nNORM][-aANNOT_VER][-k[KEEP_ANNOT...]][-sSRC_DIR][-oOUTPUT][-q][-SSEP][-yGSM_YAML][-c]FILEOptionspositionalarguments:FILEPathtoinputfile(.yaml,.yml)whichrepresentseachGSEaccessionnumber(s)whichcontainsasequenceofmapswithtwokeys:'control'and'treatment'.Eachofthesemapsfurthercontainskey(s)(e.g.,'title','characteristics_ch1').

options:-h,--helpshowthishelpmessageandexit-nNORM,--norm-typeNORMNormalizationtypeofcounts(choices:None,fpkm,tpm,default:None)-aANNOT_VER,--annot-verANNOT_VERAnnotationversionofcounts(default:GRCh38.p13)-k[KEEP_ANNOT...],--keep-annot[KEEP_ANNOT...]Annotationcolumn(s)tokeep(choices:Symbol,Description,Synonyms,GeneType,EnsemblGeneID,Status,ChrAcc,ChrStart,ChrStop,Orientation,Length,GOFunctionID,GOProcessID,GOComponentID,GOFunction,GOProcess,GOComponent,default:None)-sSRC_DIR,--src-dirSRC_DIRAdirectorytosavethesourceobtainedfromNCBI(default:./)-oOUTPUT,--outputOUTPUTAdirectorytosavethecountmatrix(ormatrices)(default:./)-q,--silentIfTrue,suppresswarnings(default:False)-SSEP,--sepSEPSeparatorbetweengroupandGSMincolumn(default:-)-yGSM_YAML,--yamlGSM_YAMLPathtosaveYAMLfilewhichcontainsGSMs(default:None)-c,--cleanupIfTrue,removesourcefiles(default:False)Command-line ExampleTo create a mock vs. CoV2 comparison pair for each tissues fromGSE164073, please prepare the following yaml file (but do not need words beginning with "!!" as they are type hints):[!NOTE]
The acceptable options for Sample attributes (such as 'title' and 'characteristics_ch1') can be found on theSample Attributestable orSOFT downloadsection inSOFT submission instructionspage.
You can use the values in the 'Label' column of the table as a key in the YAML file. Also, please exclude the string '!Sample_'.If you want a comprehensive list of attributes for all samples in a series,GEOparselibraryis useful.importGEOparseGEOparse.get_GEO("GSExxxxx").phenotype_dataGSE164073: !!seq
- control: !!map
    title: !!str Cornea
    characteristics_ch1: !!str mock
  treatment: !!map
    title: !!str Cornea
    characteristics_ch1: !!str SARS-CoV-2
- control: !!map
    title: !!str Limbus
    characteristics_ch1: !!str mock
  treatment: !!map
    title: !!str Limbus
    characteristics_ch1: !!str SARS-CoV-2
- control: !!map
    title: !!str Sclera
    characteristics_ch1: !!str mock
  treatment: !!map
    title: !!str Sclera
    characteristics_ch1: !!str SARS-CoV-2or if you would like to specify the GSM directly, please prepare the following yaml file:GSE164073: !!seq
- control: !!map
    geo_accession: !!str ^GSM4996084$|^GSM4996085$|^GSM4996086$
  treatment: !!map
    geo_accession: !!str ^GSM4996087$|^GSM4996088$|^GSM4996089$
- control: !!map
    geo_accession: !!str ^GSM4996090$|^GSM4996091$|^GSM4996092$
  treatment: !!map
    geo_accession: !!str ^GSM4996093$|^GSM4996094$|^GSM4996095$
- control: !!map
    geo_accession: !!str ^GSM4996096$|^GSM4996097$|^GSM4996098$
  treatment: !!map
    geo_accession: !!str ^GSM4996099$|^GSM4996100$|^GSM4996101$and run the following command ("Symbol" column is kept in this expample):python-mncbi_countssample_regex.yaml-kSymbol-cthen you will get the following files:GSE164073-1.tsvGeneIDSymbolcontrol-GSM4996084control-GSM4996085control-GSM4996086treatment-GSM4996088treatment-GSM4996087treatment-GSM49960891A1BG1441971571561331222A2M2542762621781531783A2MP11020009NAT197133103839388........................GSE164073-2.tsvGeneIDSymbolcontrol-GSM4996092control-GSM4996091control-GSM4996090treatment-GSM4996095treatment-GSM4996094treatment-GSM49960931A1BG1751672031431451452A2M2611584272151451693A2MP10000029NAT1122100133907880........................GSE164073-3.tsvGeneIDSymbolcontrol-GSM4996098control-GSM4996097control-GSM4996096treatment-GSM4996099treatment-GSM4996100treatment-GSM49961011A1BG1581151401361241452A2M3337226125361524128818073A2MP10000009NAT1836468655279........................If you don't need source files from NCBI, please delete the following files:Example in PythonTo get the output as a pandas DataFrame, please refer to the following code:fromncbi_countsimportSeriesseries=Series("GSE164073",[{"control":{"title":"Cornea","characteristics_ch1":"mock"},"treatment":{"title":"Cornea","characteristics_ch1":"SARS-CoV-2"},},{"control":{"title":"Limbus","characteristics_ch1":"mock"},"treatment":{"title":"Limbus","characteristics_ch1":"SARS-CoV-2"},},{"control":{"geo_accession":"^GSM499609[6-8]$"},"treatment":{"geo_accession":"^GSM4996099$|^GSM4996100$|^GSM4996101$"},},],keep_annot=["Symbol"],save_to=None,)series.generate_pair_matrix()# series.cleanup()  # remove source filesseries.pair_count_list[0]# Corresponds to GSE164073-1.tsvseries.pair_count_list[1]# Corresponds to GSE164073-2.tsvseries.pair_count_list[2]# Corresponds to GSE164073-3.tsvLicensencbi_counts is released under anMIT license.