Package: savemoney
Simple Algorithm for Very Efficient Multiplexing of Oxford Nanopore Experiments for You!OverviewSAVEMONEY guides researchers to mix multiple plasmids for submission as a single sample to a commercial long-read sequencing service (e.g., Oxford Nanopore Technology), reducing overall sequencing costs while maintaining fidelity of sequencing results. Following is the outline of the procedure:Step 1. pre-surveytakes plasmid maps as inputs and guides users which groupings of plasmids is optimal.Step 2. submit samplesaccording to the output of pre-survey.Step 3. post-analysisexecute computational deconvolution of the obtained results, and generate a consensus sequence for each plasmid constituent within the sample mixture. This step must be run separately for each sample mixture.An optional third step,Step 4. visualization of results (optional)provides a platform for the detailed examination of the alignments and consensus generated in the post-analysis.The algorithm permits mixing of six (or potentially even more) plasmids for sequencing with Oxford Nanopore Technology (e.g., Plasmidsaurus services) and permits mixing of plasmids with as few as two base differences. For more information, please check out our publication (coming soon).SAVEMONEY via Google Colab!SAVEMONEYSAVEMONEY_batch (coming soon!)SAVEMONEY for local environmentRequirementsVerified on macOS, Linux, and Windows10Python 3.10 or laterOne of the following C++ compiler (though I don't know the minimum required version number)Clang 14.0.0GCC 12.2.0Microsoft C++ Build Tools(for Windows)biopython>=1.83pandas>=1.5.3parasail>=1.3.4Pillow>=9.4.0PuLP>=2.7.0scipy>=1.11.4snapgene_reader>=0.1.20tqdm>=4.66.1Cython>=3.0.7matplotlib>=3.7.1numpy>=1.23.5pyspoa>=0.2.1pysam>=0.22.0 (optional)InstallationSAVEMONEY is available via pip.pipinstallsavemoneyIf installation via pip fails, please check the requirements above. If any of the package conflicts with those already present in your environment, I recommend creating a new virtual environment.If C++ compiler does not exist, install Xcode Command Line Tools using the following command (for macOS):xcode-select--installor downloadMicrosoft C++ Build Tools(for Windows).Quick usageSAVEMONEY can be executed either in the python script or via command line.Execute SAVEMONEY in python scriptTo import and execute SAVEMONEY in the python script. Follow the example below:importsavemoneysavemoney.pre_survey("path_to_sequence_directory","save_directory",**kwargs)savemoney.post_analysis("path_to_sequence_directory","save_directory",**kwargs)All of the plasmid map files with*.dnaand.fastaextension (and in addition*.fastqfiles for post analysis) in thepath_to_sequence_directorywill be used for the analysis. Results will be generated in thesave_directory.kwargsare optional parameters through which you can optimize the analysis:# pre-surveykwargs={'distance_threshold':5,# main parameter to be changed'number_of_groups':1,# main parameter to be changed'gap_open_penalty':3,# alignment parameter'gap_extend_penalty':1,# alignment parameter'match_score':1,# alignment parameter'mismatch_score':-2,# alignment parameter}# post-analysiskwargs={'score_threshold':0.3,# main parameter to be changed'gap_open_penalty':3,# alignment parameter'gap_extend_penalty':1,# alignment parameter'match_score':1,# alignment parameter'mismatch_score':-2,# alignment parameter'error_rate':0.00001,# prior probability for Bayesian analysis'del_mut_rate':0.0001/4,# prior probability for Bayesian analysis # e.g. "A -> T, C, G, del"'ins_rate':0.00001,# prior probability for Bayesian analysis'window':160,# maximum detectable length of repetitive sequences when wrong plasmid maps are provided: if region of 80 nt is repeated adjascently two times, put the value of 160}For the meaning of these parameters, please refer to theSAVEMONEY Google Colab pageor the reference below.Execute SAVEMONEY via command lineSAVEMONEY can also be executed via command line:python-msavemoney.pre_surveypath_to_sequence_directorysave_directory
python-msavemoney.post_analysispath_to_sequence_directorysave_directoryParameters can be specified as follows:# pre-surveypython-msavemoney.pre_survey-h
usage:__main__.py[-h][-gopGOP][-gepGEP][-msMS][-mmsMMS][-dtDT][-nogNOG]plasmid_map_dir_pathssave_dir_base
positionalarguments:plasmid_map_dir_pathspathtoplasmidmap_directorysave_dir_basesavedirectorypath
options:-h,--helpshowthishelpmessageandexit-gopGOPgap_open_penalty,optional,default_value=3-gepGEPgap_extend_penalty,optional,default_value=1-msMSmatch_score,optional,default_value=1-mmsMMSmismatch_score,optional,default_value=-2-dtDTdistance_threshold,optional,default_value=5-nogNOGnumber_of_groups,optional,default_value=1# post-analysispython-msavemoney.post_analysis-h
usage:__main__.py[-h][-gopGOP][-gepGEP][-msMS][-mmsMMS][-stST][-erER][-dmrDMR][-irIR]sequence_dir_pathssave_dir_base
positionalarguments:sequence_dir_pathssequence_dir_pathssave_dir_basesavedirectorypath
options:-h,--helpshowthishelpmessageandexit-gopGOPgap_open_penalty,optional,default_value=3-gepGEPgap_extend_penalty,optional,default_value=1-msMSmatch_score,optional,default_value=1-mmsMMSmismatch_score,optional,default_value=-2-stSTscore_threshold,optional,default_value=0.3-erERerror_rate,optional,default_value=0.0001-dmrDMRdel_mut_rate,optional,default_value=2.5e-05-irIRins_rate,optional,default_value=0.0001-wWwindow,optional,default_value=160OutputThe interpretation of output files are described onSAVEMONEY Google Colab pagein details. Other than that, you can visualize consensus alignment results by usingyour_plasmid_name.cafile generated by SAVEMONEY.From python script:importsavempneysavemoney.show_consensus(consensus_alignment_path,center=2000,seq_range=50,offset=0)From command line:python-msavemoney.show_consensuspath_to_consensus_alignment_fileParameters can be specified as follows:python-msavemoney.show_consensus-h
usage:__main__.py[-h][--centerCENTER][--seq_rangeSEQ_RANGE][--offsetOFFSET]consensus_alignment_path
positionalarguments:consensus_alignment_pathpathtoconsensus_alignment(*.ca)file
options:-h,--helpshowthishelpmessageandexit--centerCENTERcenter,optional,default_value=2000--seq_rangeSEQ_RANGEseq_range,optional,default_value=50--offsetOFFSEToffset,optional,default_value=0Conversion of consensus alignment results (*.ca) to*.bamand*.fastqformat is also supported. The conversion requirespysam>=0.22.0be installed in your environment. To convert the file, type the following code in a python script:importsavemoneysavemoney.ca2bam(consensus_alignment_path)If you want to convert it via command line, type the following commnad:python-msavemoney.ca2bampath_to_consensus_alignment_fileReferencesUematsu M., Baskin J. M., "Barcode-free multiplex plasmid sequencing using Bayesian analysis and nanopore sequencing."eLife.2023; 12: RP88794Slide from Weill Institute Science Workshop, May 22, 2023