Man pages for kevinmhadi/khtools
Making Mskilab Life Easier

aggregate_rocmake aggregated roc curve
alt_in_cisgrab edges from walk
ANDtest boolean AND across multiple vectors
appendEnvappendEnv
asdfcoerce to data frame
asdtcoerce to data table via setDT
asmasm
asn2version of utils::assignInNamespace
ave3modification of ave
avedmodification of ave
bcfindexbcfindex
bedpe2grlbedpe2grl
behomologybreakend exact homology
binom.confGet confidence intervals around fractions
boolClean Up Boolean Logic
bp2grlconvert table of paired string coordinates to GRangesList
cenvconcatenate environments
check_lstchecking list for elements that are errors checking a list...
classystatcalculates various scores from actual classes and predicted...
clobbersame as dplyr::coalesce
coalescesame as dplyr::coalesce, khtools:coalesce is an alias for...
col2rnalias for column_to_rownames
colexistsfind out if column is in data.table
colnames2robust colnames
colnames2-setrobust colnames() assignment
column_to_rownamesmaking column into rownames
complete.cases2complete.cases wrapper
conform_siconform_si
copymake deep copy, recursively
copy2make deep copy
copy3make deep copy, recursively
copydtcopy data frame/table columns to a new data table with forced...
copyr6make deep copy of all non-function public and private fields...
copys4make deep copy of all private slots in s4 object
dcast.countdcast.count
dcast.count2Counts up occurrences from a melted table
dcast.wrapwrapper around dcast or dcast2
debug.s4debug an S4 function
dedupdedup
dedup.colsapplies dedup to colnames
df2grdata frame to GRanges
df2grldata frame to GRangesList
dgalias of dynget
dig_dirdig into a file path's directory
dig_dir2dig into a file path's directory
diginjobDig into inputs Flow Job that generated an output
digjobDig into Flow Job that generated an output
dig_jobDig into Flow Job that generated an output
DIMNROW and NCOL convenience function
DIM2extending NROW and NCOL2
dir2dir with full grep
dirfindDig into outdir of flow job
do.assignassign columns or list elements
do.colsdo.cols
dodo.call2dodo.call+
do.ppdo caret preProcess
dot-filter_sv.filter_sv
dot-gc.gc
dt_any2lgconvert all columns to logical
dtapplymclapply on a table split by a column
dt_empty2naconvert columns with empty character to NA
dt_f2charconvert factor columns to character
dt_lg2intlogical to integer in data tables
dt_na2emptyconvert columns with NA to empty character
dt_na2falseconvert columns with NA to false
dt_na2trueconvert columns with NA to true
dt_na2zeroconvert columns with NA to zeros
dt_setallnaconvert all data.table entries to NA
dt_setcharconvert column to character
dt_setintconvert column to integer
dt_setnullset columnn to NULL in data.table
dunlist2unlist into a data.table
dupedduped
dyngetmodification of base::dynGet()
empty2naSet vector to NA
enframesame as tibble::enframe
enframe_listdata table-ize list elements and add name column
eNROWdoes vapply NROW
errrturn on verbose error tracing through call stack
est_snv_cnestimate snv cn
est_snv_cn_stubestimate snv cn stub
etshortcut for eval(parse(text = <string>))
extract_ggplothelper function to grab relevant ggplot_build outputs
ez_stringdon't use this. use base::dput()
f2intfactor to integer
false2nareplace FALSE with NA
feature_importancefeature_importance
file.exists2slightly more robust test for whether file exists
file.info2file.info2
file.mat.existsfile.mat.exists
file.not.existsslightly more robust test for whether file does not exist
fillbyfill in variables of data table by combos
find_dupsfind all duplicates in a vector
findovGenomicRanges::findOverlaps wrapper
fit_classifierfit classiifer
fit.cnv.sigfit battenberg copy number to CN signatures (Nature 2022)
fitcvglmnetfit cv.glmnet
fitglmnetfit glmnet
fitrandomforestfit randomForest
fitzscorecalculate z score
fix.colsFix messed up data frame/table column names
flag2intconvert bam flag to integer
force2force with a tryCatch
forceallforce objects (including functions) to evaluate from...
forcefunforce functions to load
forceloadforce functions to load from all libraries
fraccalculate fraction
galias for getdat2
g2alias for getdat2
gbar.errorbarplot with errorbars
gdalias for getdat
get_accuracycalculate accuracy based on contingency table
getbpget breakpoints
getcachegetcache
getdata method to get the "data" argument from a with/within...
getdat2getdat2
get_predget_pred
gg.histgenerate ggplot histogram
ggmrocggplot for multiROC
gg_mythemecustom theme for ggplot
gg.slinewrapper around geom_point and geom_smooth
glm.nb2glm.nb2
glmnet_aicglmnet_aic
globasnassign an object to global environment
good.fileDoes File exists and is file size greater than threshold
gr2bedgr2bed
gr2dfgranges to datatable via dataframe
grabcovconvenience function to pull out coverage data from table
grabggtrackconvenience function to pull out jabba model + coverage
grabhjabconvenience function to pull out jabba model with allelic cn
grab.hrdetect.featuresgrab hrdetect features from hrdetect results
grapes-equals-grapestest if two vectors are equal (uses conversion to character)
grapes-inn-grapesx %inn% table a logical vector Same as
grapes-K-grapessimilar to setkey except a general use utility
grapes-nin-grapesnot x %nin% table Not match
grapes-Q-grapesquery
grapes-Q-grapes-.CompressedGRangesListquery on CompressedGRangesList
grapes-Q-grapes-.GRangesquery on GRangesList
grapes-Q-grapes-.GRangesListquery on GRangesList
gr_calc_covoutput data structure for ski slope from anchorlifted SNV
gr_construct_byadding on by field to seqnames for more efficient by queries
gr_deconstruct_byremoving by field and random string barcode to seqnames for...
gr.disjoinupdated gr.disjoin from gUtils to work with GRangesList
grep_col_sortgrep_col_sort
grep_ordergrep_order
gr.fixseqget permissive seqlengths from multiple GRanges-like objects
gr.flipstrandworks with GRangesLists
gr.genomecreate GRanges of full genome coordinates
grg_subextract portions of matched substring
grl2bedpegrl2bedpe
grl.disjoindisjoin on grangeslist
grl.flipflip each GRangesList element
grl.flipstrandflip strand of grangeslist
grl_gapsgaps on GRangesList
grl.undfgrangeslist to data table via dataframe
gr.novalget rid of mcols on GRanges/GRangesLists
grok_vcfmodded grok_vcf
gr.orderorder granges, grangeslist
gr.patchsame as gr.fix basically
gr.resizeResize granges without running into negative width error
gr.roundround window to nearest unit
gr.setdiff2gr.setdiff that works with multiple by columns
gr.sortsort granges, grangeslist
gr.splgapsgaps on GRanges, splitting by values in a metadata field
gr.splitsplit a gr by field(s) in elementMetadata of GRanges or a...
gr.sprangeget range based on a field(s) to split by in elementMetadata...
gr.spreducereduce based on a field(s) to split by in elementMetadata of...
gr.strandspecify strand of granges or grangeslist
gr.sub2Substitute chr in GRanges or GRangesList
gr_withinwithin on GRanges
gr.withinwithin on GRanges, S3
gt.eachconvenience function to plot each element separately
gt.fixfix gtrack metadata elements for plotting
gw_edgespull edge metadata from gwalk
gxalias for getdat2(nm = "x")
iderrreturns ids of list elements that are errors
idjidj
integer_breaksmake integer breaks on axes
interaction2interaction but orders levels based on input vectors
interbp_distinterbp_dist
intercalatecollate two vectors together interleave vectors together
intercalate_lstcollate lists together
is.emptytest if object is empty
isNAis.na but also tests for "NA" character
isv2grlisv2grl
ix_sdiffsubset out indices
jitter2jitter with consistent seed
kcpdfopen Cairo pdf device with defaults
kpdfopen pdf device with defaults
kpngopen png device with defaults
ksvgopen svg device with defaults
lapply_dtFlexibly apply function to columns of data.table/frame
lbl.ggconvenience function to label the nodes and edges of gGraph
lensimilar to length except gets nrows for those items that have...
lenssimilar to lengths except gets nrows for those items that...
levelsinuseget the levels in use in a factor
lg2flogical to factor
log10plog10(x + 1)
loop_grepwraps grep in for loop
loop_greplwrapper around loop_grep
lst.emptylst.empty A logical vector to select which list elements are...
lst.empty2naempty list elements set to NA
lst.empty2nullempty list elements set to NULL
lst.empty2replacelength 0 elements of list to replace with a value set empty...
lst.empty2zeroConvert empty elements to zero.
lst.emptychar2naempty character elements of list to NA
lst.emptychar2nullempty character elements of list to NULL
lst.null2naNULL elements of list to NA
lst.zerochar2emptyzero length character elements to empty char set 0 length...
mainwrapper around cenv
make_chunksmake_chunks
make_dummymake table of dummy encodings
make_rocmake_roc
make_roc2make_roc2
make_ttsplitmake training/test splits
make_xfoldmake training/test splits
matchsimilar to setkey except a general use utility
match2matches x in terms of y
match3similar to setkey except a general use utility
match_sordered match
matrifytake a data.table/frame, shave first column into rownames,...
matrify2create matrix from table like obj with dplyr syntax
max.col.narmmaximum column per row (removing NA)
merge.replmerging data tables with collapsing columns with the same...
metanamesmetanames
min.col.narmminimum column per row (removing NA)
mkstMaKe STring making string out of vector for eval(parse(text =...
mrocdatcreate a data frame for ggplotting multiroc
mroclabcreate one hot table of labels for multiROC
mrocpredformat predicted scores for multiROC
mstrsplitmake matrix out of stringsplitted character vector
mylambdasmylambdas
na2emptyna2empty A convenience function to set a character vector...
na2falsereplace logical vector with NA to FALSE
na2truereplace logical vector with NA to TRUE
na2zerona2zero A convenience function to set a numeric vector with...
names2robust name()
names2-setrobust name() assignment
nan2zeronan2zero A convenience function to set a numeric vector with...
na.seqlNA out seqlevels
NCOL2extending NCOL
ne"no error"
ne.namark x with NA if it does not exist
nodimtesting if object is empty
nonacolno columns named "NA"
nonzero2nareplace 0 to with NA
normpathnormalize directory, but not basepath
normvnormalize a vector
normv_sepnormalize a vector, treating positives and negatives...
nottnegate a function
numeqtest equality between numeric values with some tolerance
off_diagget off diagonal values
one_vs_otherone level vs other
ORtest boolean OR across multiple vectors
output_colsoutput the union columns from a Flow output
overwritefunoverwrite a function in its namespace
overwriteR6overwrite a method in R6 class generator
pairs.collect.junctionscollect junctions from pairs as breakpoints
pairs.grab.hrdetect.featuresgrab hrdetect features from pairs table
pairs.grab.ot.featuresgrab oneness twoness features from pairs table
parasnassign parallel columns
parse.gr2a robust parse.gr
parse.grl2a robust parse.grl
parse_slurm_timeParse the slurm times into an R format
parsesnpeffparse snpeff output into granges
peepr6peepr6
pg_mythemeprint gg_mytheme output
pinchpinch a vector
pinch.fracpinch a vector
ppdfkevin's modification of ppdf
ppngkevin's modification of ppng
predict.pppredict preProcess
printerrprint error message from tryCatch
process_tblflexibly read in a field and append an id to the output
qmatquery a matrix with nonmatching entries as NA
qqget actual quantile values of vector
qtrimcut off vector by quantiles
ra.dedup6ra.dedup6
rand.stringmake a random string
ra.overlaps6ra.overlaps6
read.bam.headerread.bam.header
read_bedread bed or bedpe as a table
read.headerread header of file
readinflexible file opening
readinfastawrapper around readDNAStringSet to remove extraneous...
read_vcf2read_vcf2
reassignreassign elements of named list into environment
refactorrefactor
rematchrematch
rep_eachrecycle vector - shortcut for rep(x, each = each)
replace2function to replace elements of vector, can use "x" as...
replace_nareplace NAs
rep_lenrecycle vector - overload base::rep_len
rep_len2recycle vector along length OR nrow of object
reset.jobreset.job
ret_erra wrapper around check_lst
ret_na_errusing check_lst to return
ret_no_erra wrapper around check_lst
rg_subextracting substring match using regexpr
rintersectReduce intersect
rleseqnumbers up within repeating elements of a vector
rmcolrmcol
rm_mparenutility function for removing multiple parantheses
rn2colalias for rownames_to_column
robust.scaleflatten outliers by quantile
rownames2robust rownames
rownames2-setrobust rownames() assignment
rownames_to_columnmaking column out of rownames
rows.alltest whether all row entries are TRUE
rows.anytest whether any row entries are TRUE
row.sortsort rows of integer matrix
rrrepeatedRecursively repeat a function call
runionReduce union
samplersample elements of vector or rows of table
save.rsave R data session
seevarsee variables in environment
select.matrixselect.matrix
selfnamename a character vector to itself
seq_along2seq along either row of table or length of vector
setAllNamessetAllNames convenience function to set all names of a vector
setcolnamesconvenience function to set column names alias of setColnames
setColnamesconvenience function to set column names
setcolsconvenience function to set columns sets columns of an object
setNames2setNames2 convenience function to set all names of a vector
set_rngseedset random number generator AND seed
setrownaesconvenience function to set row names sets rownames of an...
setRownamesconvenience function to set row names sets rownames of an...
shift_downshift_downstream from plyranges package
shift_leftshift_left from plyranges package
shift_rightshift_right from plyranges package
shift_upshift_upstream from plyranges package
silentrun expression without any printed output
sim.bxsimulate 10x Barcoded reads off of collection of walks
softmaxcalculate softmax
somejitadd tiny jitter
split_bysplit data frame-like object based on columns
sssame as subset2
sstatKevin's implementation of sstat
stack.dtcollapse a named list of vectors into a data.table
stackenvstackenv
stackenv2stackenv2
subgrsubgr
subset2function to subset on a variable by using "x" as surrogate...
summ_glmtabular summary of glm model coefficients
sv_filterfilter sv by overlaps with another
symdiffdata.table of all setdiff items in X and in Y gives back data...
system3modified system2
table2wrapper around table(), show NA counts if there are any
table3wrapper around table, always show NA counts
tailfmodification of tailf from skitools
transtranspose a list
trans.dftranspose data.table or data.frame
transptranspose a list
try2wrapper around tryCatch - robust to parallel:: functions
unshortcut to check unique entries
uncutget upper and lower bounds of cut labels
undebug.s4undebug an S4 function
undupan alternative to base::unique() that preserves names
unIremove "AsIs" from class, i.e. undo I(obj) undo I(obj)
uniqfUnique factor
upset2wrapper around UpSetR::upset()
vcf_remove_sampletake vcf read in chunks and write clean vcf
viewtaskconvert job task to table
vmatchmake list of matches and nonmatches
whicherrsame as iderr
withvwithv
withxwithx
w.quantileweighted quantile
write_bedwrite bed or bedpe into canonical formatted table
write.ctabwriting a comma separated table with quotes
ws2undClean up whitespace from columns of data.frame-like object
wvalias for withv
zscorezscore a numeric vector
kevinmhadi/khtools documentation built on Jan. 16, 2025, 4:18 p.m.