# NOT RUN {
# use min/max quantile gamma fit (recommended option when one can afford to do cell kNN smoothing)
# The example below uses k=5 cell kNN pooling, and top/bottom 2% exprssion quantiles
# emat and nmat are spliced (exonic) and unspliced (intronic) molecule/read count matirces
(preferably filtered for informative genes)
rvel <- gene.relative.velocity.estimates(emat,nmat,deltaT=1,kCells = 5,fit.quantile = 0.02)
# alternativly, the function can be used to visualize gamma fit and regression for a
particular gene. here we pass embedding (a matrix/data frame with rows named with cell names,
and columns corresponding to the x/y coordinates)
# and cell colors. old.fit is used to save calculation time.
gene.relative.velocity.estimates(emat,nmat,deltaT=1,kCells = 5,fit.quantile = 0.02,
old.fit=rvel,show.gene='Chga',cell.emb=emb,cell.colors=cell.colors)
# }
Run the code above in your browser using DataLab