Package: pyLLS
pyLLSa Python library for missing gene value imputation using local least square algorithmThe Local Least Square (LLS) algorithm is an algorithm that is particularly effective at imputing missing values.We developed pyLLS by implementing the LLS into python framework.Our pyLLS offers more options and is significantly faster than LLS in R.pyLLS is subjected to the MIT License, which guarantees free and commercial use for industry as well as the research community.Please report bugs to Sejin Oh, at <sejin.ohtheragenbio.com> or athttps://github.com/Theragen-Bio/pyLLS/issues.InstallationYou can install the pyLLS frompypiwith:pipinstallpyLLSExampleIf you run 'impute_missing_gene()' without any data,it will return its description.importpyLLSpyLLS.impute_missing_gene()>>>pyLLS.impute_missing_gene()Thisfunctionestimatesmissingvaluesofthespecifiedtargetprobes.# parametersref(pd.DataFrame):referencedata.genexsample(nxp)DataFrame.target(pd.DataFrame):Targettablecontainingmissingvalues.genexsample(ixk)DataFrame.metric(str):['correlation'(default),'L1','L2']Similaritymetrictoprioritizetheprobesforeachtarget.maxK:maximumnumberofprobetobeusedinmissingvalueestimation.useKneedle:ItdetermineswhetherKneedlealgorithmshouldbeused(True)ornot(False).IfuseKneedle==False,thenmaxKprobeswillbeusedtoestimatemissingvalues.verbose:IfTrue,progressisreported.Otherwise,noprogressisreported.n_jobs:Useallthreads('all')orspeicifiednumberofthreads(int)addK=IntengerthataddedtoKneedle's K to prevent underfitting.This will use K+addK probes to estimate missing values of a gene. (default=1)return_probes = if true, 'target-tableandmgcp' will be returned else 'target'will be returned.# Return*target:tablewithestimatedvaluesofmissinggenesthatarenotpresentinoriginaltargettable.matrixshapewillbe(nxk).*mgcp:missinggenecorrelativeprobes.IfuseKneedle==True,mgcpwillhaveR2-squarecolumn.# tutorial<------omit-------->Parametersref(pd.DataFrame):referencedata.genexsample(nxp)DataFrame.target(pd.DataFrame):Targettablecontainingmissingvalues.genexsample(ixk)DataFrame.metric(str):['correlation'(default),'L1','L2']Similaritymetrictoprioritizetheprobesforeachtarget.maxK:maximumnumberofprobetobeusedinmissingvalueestimation.useKneedle:ItdetermineswhetherKneedlealgorithmshouldbeused(True)ornot(False).IfuseKneedle==False,thenmaxKprobeswillbeusedtoestimatemissingvalues.verbose:IfTrue,progressisreported.Otherwise,noprogressisreported.n_jobs:Useallthreads('all')orspeicifiednumberofthreads(int)addK=IntengerthataddedtoKneedle's K to prevent underfitting.This will use K+addK probes to estimate missing values of a gene.return_probes = if true, 'target-tableandmgcp' will be returned else 'target'will be returned.Returns*target:tablewithestimatedvaluesofmissinggenesthatarenotpresentinoriginaltargettable.matrixshapewillbe(nxk).*mgcp:missinggenecorrelativeprobes.IfuseKneedle==True,mgcpwillhaveR2-squarecolumn.TutorialYou can simply run the following tutorial codes.importpyLLSimportpandasaspdimportnumpyasnpimportrandomtmp=pd.DataFrame(np.array(random.sample(range(1000),1000)).reshape(100,10))tmp.index=['g'+str(i)foriintmp.index]tmp.columns=['s'+str(i)foriintmp.columns]tmp2=tmp.iloc[:90,:5]tmp3=pyLLS.impute_missing_gene(ref=tmp,target=tmp2)If you want experience more sophisticated tutorial,please refer the notebook.