Skip to contents

All functions

AggregateMinhashes()
Aggregate frequency of minhashes across cells
AtrandiBarcodeStats()
Given a Bascet, produce a matrix showing for each combinatorial barcode, how many times it occurs across the cells. Presented as a 96-well plate matrix
BarnyardPlotMatrix()
Produce a matrix of Barnyard plots, i.e., counts for one species vs another, for all combinations of species.
Bascet-class
A bascet, along with all the shards
BascetAggregateAMRfinder()
Aggregate data from AMRfinder This is a thin wrapper around BascetAggregateMap
BascetAggregateAbricate()
Aggregate data from Abricate This is a thin wrapper around BascetAggregateMap
BascetAggregateAriba()
Aggregate data from Ariba This is a thin wrapper around BascetAggregateMap
BascetAggregateFASTQC()
Aggregate data from FASTQC This is a thin wrapper around BascetAggregateMap
BascetAggregateGECCO()
Aggregate data from GECCO This is a thin wrapper around BascetAggregateMap
BascetAggregateMap()
Aggregate data from previous Map call
BascetAggregateQUAST()
Aggregate data from QUAST This is a thin wrapper around BascetAggregateMap
BascetAlignToReference()
Align from FASTQ, generate sorted and indexed BAM file
BascetAlignmentToBigwig()
Generate a bigwig out of all reads in a sorted BAM. Note that the caller is responsible for sorting the BAM first
BascetBam2Fragments()
Take aligned BAM file and produce Fragments.tsv.gz, compatible with Signac ATAC-seq style analysis
BascetCacheComputation()
A wrapper to cache a computation. Put your function in as an argument, as R will only compute its value if needed. If the cache file exist, it will not be run again
BascetCellNames()
Get list of cells in a Bascet
BascetCellNames_withstreamer()
Get list of cells in a Bascet – streamer provided
BascetComputeCountSketch()
Compute count sketch for each cell. This is a thin wrapper around BascetMapCell
BascetComputeMinhash()
Compute minhashes for each cell. This is a thin wrapper around BascetMapCell
BascetCountChrom()
From aligned BAM file, compute counts per chromosome
BascetCountFeature()
From aligned BAM file, compute counts per feature
BascetDumpContigs()
Store all contigs in an output directory, as cell_id.fa
BascetFilterAlignment()
Filter an alignment (BAM-file).
BascetGatherCountSketch()
Gather all count sketches into a single count sketch matrix
BascetGetRaw()
Extract barcodes and trim input raw FASTQ
BascetIndexGenomeBWA()
Index a genome using BWA such that it can be used for alignment
BascetIndexGenomeSTAR()
Index a genome using STAR such that it can be used for alignment
BascetInstance()
Create a new bascet instance. For advanced users only
BascetListFilesForCell()
List files for a cell in a Bascet
BascetLoadCountSketchMatrix()
Load count sketch matrix as Seurat object
BascetMakeKrakenCountMatrix()
Produce a count matrix of taxonomy IDs from KRAKEN output
BascetMakeMinhashHistogram()
Gather all minhashes into a single histogram file
BascetMapCell()
Call a MAP function for all cells
BascetMapCellAMRfinder()
Run AMRfinder on contigs of all cells. This is a thin wrapper around BascetMapCell
BascetMapCellAbricate()
Run Abricate on contigs of all cells. This is a thin wrapper around BascetMapCell
BascetMapCellAriba()
Run Ariba on reads of all cells. This is a thin wrapper around BascetMapCell
BascetMapCellBakta()
Run Bakta on contigs of all cells. This is a thin wrapper around BascetMapCell
BascetMapCellFASTQC()
Run FASTQC on reads of all cells. This is a thin wrapper around BascetMapCell
BascetMapCellGECCO()
Run GEECCO on contigs of all cells. This is a thin wrapper around BascetMapCell
BascetMapCellQUAST()
Run QUAST on reads of all cells. This is a thin wrapper around BascetMapCell
BascetMapTransform()
Transform data
BascetQueryFq()
Build count table from FASTQ reads and a list of selected kmers
BascetReadFile()
Read one file from a Bascet
BascetReadMinhashHistogram()
Read histogram of KMERs, the output of BascetMakeMinhashHistogram
BascetRunCellSNP()
Align from FASTQ, generate sorted and indexed BAM file
BascetRunFASTP()
Run FASTP for each cell. Input must be in FASTQ file format
BascetRunKraken()
Run KRAKEN2 for each cell
BascetShardify()
Take debarcoded reads, merge them, and split them into suitable numbers of shards.
ChooseInformativeKMERs()
Pick random KMERs from KMC3 database. The choice is among KMERs within a frequency range
ChromToSpeciesCount()
Produce a count matrix on strain level
CloseBascet()
Close a Bascet file.
CountDataFrameToSparseMatrix()
Count entries in long format data frame and return as a sparse matrix
CountGrangeFeatures()
Obtain a feature matrix (as seurat object) given an seurat object having Fragments associated
CreateSeuratObjectWithReduction()
Create a seurat object from e.g. count sketch reduction
DebarcodedKneePlot()
Produce summary kneeplot given debarcoded statistics
DetectRawFileMeta()
Detect metadata for raw input FASTQ files
DownloadDatabaseAMRfinder()
Download a database for AMRfinder
DownloadDatabaseAriba()
Download database for Ariba
DownloadDatabaseBakta()
Download a database for Bakta
FragmentCountsPerChrom()
From a Signac chromatin assay with fragments, for each cell, count how many reads per chromosome
FragmentCountsPerChromAssay()
From a Signac chromatin assay with fragments, for each cell, count how many reads per chromosome. This function directly returns an assay that can be added to a Seurat multimodal object
FragmentsToSignac()
From a fragments file, get a chromatin assay for Signac.
GetBascetTempDir()
Get a temp directory to use; need to be created
GetDefaultBascetInstance()
Get default Bascet instance from global variable (bascetInstance.default)
GetDefaultBascetRunner()
Get the current default runner
GetFASTQCassembledDF()
Get a data frame for one type of FASTQ statistics across across all cells
GetFASTQCbasicStats()
From aggregated FASTQC data, get basic statistics for overlay on UMAP etc
GetFASTQCpassfailStats()
From aggregated FASTQC data, get overall pass-fail statistics for overlay on UMAP etc
KneeplotPerSpecies()
Produce a kneeplot
KrakenFindConsensusTaxonomy()
For a KRAKEN2 count matrix, return consensus taxID for each cell as metadata
KrakenKneePlot()
Take a KRAKEN2 adata object and generate per-species kneeplots
KrakenSpeciesDistribution()
Using a KRAKEN2 count matrix, produce a "kneeplot" of species
ListDatabaseAbricate()
List installed databases available for Abricate
LocalRunner()
Create new local runner instance
MapCellMultiListAsDataFrame()
Convenience function; alternative is to somehow implement as.data.frame
MapListAsDataFrame()
Convenience function; alternative is to somehow implement as.data.frame.
NoRunner()
Create new no-runner instance, used for debugging
OpenBascet()
Open a Bascet, prepare it for reading individual files
PlotFASTQCadapterContent()
From aggregated FASTQC data, plot adapter content
PlotHistogram()
Plot a histogram, loaded by ReadHistogram
PlotJohnsonLindenstraussMinDim()
Plot minimum number of dimensions needed to retain distance between samples
PrepareSharding()
Prepare to shard reads by collecting statistics about each barcode, and filtering out cells with few reads
ReadBascetCountMatrix()
Read a count matrix as produced by Bascet (hdf5 format). This can be output from both BascetQueryFq and BascetCountChrom
ReadCellSNPmatrix()
Read a count matrix as produced by CellSNP, but as shards
ReadHistogram()
Read the count histogram associated with a Bascet. Not all Bascets have one, but it is typically produced after debarcoding
SetTaxonomyNamesFeatures()
Take a KRAKEN2 count matrix where the column is the taxonomyID. Convert to a matrix where the columns instead are the names of each taxonomy. Unused taxonomyID columns will not be kept
ShowFASTQCforCell()
Show the FASTQC HTML report for a cell, in the available web browser
SlurmRunner()
Create a runner that submits jobs to SLURM
SpeciesCorrMatrix()
TODO is this function used? export
TabixGetFragmentsSeqs()
Using Tabix, get list of sequences in a fragment file
TestBascetInstance()
Check if a Bascet instance works
aggr.abricate()
Callback function for aggregating ABRicate data for each cell. To be called from BascetAggregateMap
aggr.amrfinder()
Callback function for aggregating ABRicate data for each cell. To be called from BascetAggregateMap
aggr.ariba()
Callback function for aggregating ARIBA data for each cell. To be called from BascetAggregateMap
aggr.fastqc()
Callback function for aggregating FASTQC data for each cell. To be called from BascetAggregateMap
aggr.gecco()
Callback function for aggregating GECCO data for each cell. To be called from BascetAggregateMap
aggr.minhash()
Callback function for aggregating min-hashes for each cell. To be called from BascetAggregateMap
aggr.quast()
Callback function for aggregating QUAST data. To be called from BascetAggregateMap
aggr.rawtext()
Callback function for just getting raw file contents To be called from BascetAggregateMap
assembleBascetCommand()
Prepare Bascet command given arguments
bascetCheckOverwriteOutput()
Detect metadata for raw input FASTQ files
createSlurmJobFromExisting()
This creates a job object, linking to a running command. Mainly used for development but can be used in case a Zorn session died and you want to create a new monitor
detectShardsForFile()
Helper function: Figure out which shards belong together given root input name and extension i.e. root/name.##.ext
extractstreamerExit()
extract streamer: end an instance. the object should no longer be used after calling this function
extractstreamerExtractTo()
extract streamer: extract to external file
extractstreamerListCellsAnyFile()
extract streamer: list all cells in a given file
extractstreamerLs()
extract streamer: list all files in current Bascet zip-file
extractstreamerOpen()
extract streamer: set which file is open
extractstreamerReadNLines()
extract streamer: helper function to read N lines
extractstreamerReadOneLine()
extract streamer: helper function to read one line
extractstreamerShowtext()
extract streamer: get content of file, assumed to be text (or this function crashes)
extractstreamerStart()
extract streamer: create an instance
getBascetDockerImage()
Get and install a Bascet docker image. It will be cached to avoid downloading it each the time the function is called
getBascetSingularityImage()
Get a Bascet image (singularity or docker). It will be cached in the provided directory to avoid downloading it each the time the function is called
getFastqR2fromR1()
Get corresponding R2 file. Assumes that the input file is R1
is.bascet.file()
Check that parameter is a valid bascet file
is.bascet.instance()
Check that parameter is a valid bascet instance
is.existing.fasta()
Check that parameter is a valid shard name
is.integer.like()
Check that parameter is castable to an integer
is.numeric(<range01>)
Check that parameter is a number between 0..1
is.positive.integer()
Check that parameter is an integer and >0
is.runner()
Check that parameter is a valid runner
is.streamer()
Check that parameter is a valid streamer
is.valid.env.variable()
Check that parameter is a valid environment variable name
is.valid.listcells()
Check that parameter is a valid list of cells
is.valid.shardname()
Check that parameter is a valid shard name
is.valid.threadcount()
Check that parameter is a valid thread count
isBamPairedAlignment()
Figure out if a BAM-file is a paired alignment or not
isFastq()
Check if a file is a FASTQ file
isPairedFastq()
Check if a file is a paired FASTQ file. Panics if the file is not a FASTQ at all
lseq()
logarithmic spaced sequence; taken from emdbook library
makeOutputShardNames()
Helper function: Generate suitable output filenames according to shard system i.e. root/name.##.ext
new_no_job()
Create an empty job. It is considered to have terminated from the start
parse_size_to_bytes()
Parse a string with a size, such as 1g, 1m, 1k, or just 123 (bytes)
removeBascetDockerImage()
Remove current Bascet docker image
safeDownloadMD5()
Download a file, check MD5 to ensure success. This assumes a file.md5 is stored on the server
shellscriptCancelJobIfFileExists()
Create a piece of script to exit a job early if file exists
shellscriptMakeBashArray()
Helper function: Create array of values in bash scripts example: myArray=("cat" "dog" "mouse" "frog")
shellscriptMakeCommalist()
Helper function, taking a list of elements such as a,b, and returning "a,b"
shellscriptMakeFilesExpander()
Generate a shell script command to produce a file of list of strings
shellscriptMakeOneFileExpander()
Helper function that takes content of a list and generates a BASH script that stores the content in a temporary file during execution
shellscriptSplitArrayIntoListRandomly()
Helper function to take an array of elements and split it randomly into a number of subset lists