Package: bioplotz
IntroductionThis is a package for plotting some images for bioinformatics.DependenciesPython modules:numpymatplotlibpandasInstallationInstall via pippipinstallbioplotzInstall from source codepipinstallgit+https://github.com/sc-zhang/bioplotz.git--userUsageManhattan Plotimportbioplotzasbpfig,ax=bp.manhattan(data,threshold=0,color=['orange','green'],threshold_line_color='blue',log_base=0,reverse=False,xtick_labels=True,ytick_labels=True,ax=None,marker='.',s=1,**kwargs)parametervalue typeexplaindatadictlistdictkey: block namevalue: [[x1,x2,...,xn], [y1,y2,...,yn]]listis a list like: [[x1,y1], [x2, y2], ..., [xn, yn]]thresholdvaluelistvalueif only one threshold line to plot, Notice: if log_base was set, threshold values should be calculated with same log_base manunally, if reverse is True, threshold values should be set to its opposite numberlistif more than one threshold line need to plot, a list can be used for different lines, like: [threshold_value1, threshol_value2]colorlistcoloris a list used for blocks, if the count of block greater than color count, it will be used circularlythreshold_line_colorvaluelistvalueifthresholdis a single valuelistifthresholdis a listthreshold_line_widthvaluevaluethe line width of threshold linesblock_line_widthvaluevalueif there are only one color, the block line will display as border, the width is set by this parameterlog_basevaluelog_base = 0 means not calucate value with loglog_base != 0 means log base for log values with itreverseBooleanif all data lower than 0, you may use it to show opposite valuesother parametersvaluesame with parameters used inpyplot.scatterChromosome Plotimportbioplotzasbpfig,ax,clb=bp.chromosome(chr_len_db,chr_order,bed_data,centro_pos,value_type="numeric",orientation="vertical",**kwargs)parametervalue typeOptionalDefaultexplainchr_len_dbdictNo-key: chromosome namevalue: chromosome lengthchr_orderlistYesNonelist: the custom chromosome order, like: ["Chr1", "Chr3", "Chr2"]must same with keys in chr_lenbed_datalistYesNonelist: two dimension list, like: [[chrome name, start pos, end pos, value/color]]centro_posdictYesNonekey: chromosome namevalue: middle position of centromerevalue_typestrYesnumericnumeric: the 4th column of bed_data should be valuecolor: the 4th column of bed_data is colormarker: different with other two types, it need 5 columns, the 4th column of bed_data is marker, the 5th column is color (marker is same with the parameter which be used inpyplot.scatter)orientationstrYesvertical"vertical" or "horizontal"cmapstrYesgist_rainbowcmapfor colorbarcmap_partsintYes100how many parts for splitting cmapsfloat or array-like, shape(n,)YesNonesame with parameter s use inpyplot.scatterother parametersvalueYesNonesame with parameters used inpyplot.plotIf value_type is numeric, the return value clb will be colorbar, else NoneGene Cluster Plotimportbioplotzasbpfig,ax=bp.genecluster(gene_list)parametervalue typeOptionalDefaultexplaingene_listlistNo-list: 2-dimension list, like [[gene name, start pos, end pos, direct(+/-), color], ..., [gene name, start pos, end pos, direct(+/-), color]]edgecolorliststrYesNonelist: same length with gene_list, like: ["green", "blue", ..., "red"]str: common edge color for all genesedgewidthintYes1edge width for all geneslwintYes3line width to show the genome backboneNotice, the best figsize should be (gene count, 1), for example: plt.figure(figsize=(16, 1)), and the bbox_inches parameter which in savefig should be 'tight'.Multi Alignment Plotimportbioplotzasbpfig,ax=bp.multialign(data)parametervalue typeOptionalDefaultexplaindatadictNo-key: gene namevalue: alignment sequencematch_colorstrYesbluecolor of matched basesmatch_background_colorstrYesNonebackground color of matched basesmismatch_colorstrYesredcolor of mismatched basesmismatch_background_colorstrYesNonebackground color of mismatched basesbase_per_lineintYes80base count to display for each linehighlight_positionslistYesNonepositions for highlighting, 0-basehighlight_colorstrYesgreencolor of highlighting positions in highlight_positionshighlight_background_colorstrYesNonebackground color of highlighting positions in highlight_positions**kwargsanyYes-same with which use in ax.textNotice, the figsize should be (base_per_line/10, x) where x=align_length/base_per_line*gene_count/5, and the font must be  monospaced,
like "Courier New", that sometimes user need add codes as following.importmatplotlibasmplimportbioplotzasbpbasefont=mpl.font_manager.FontProperties(fname="/path/to/font.ttf")fig,ax=bp.multialign(data,fontproperties=basefont)orplt.rcParams['font.sans-serif']='Courier New'