Package: augmentRNA
augmentRNAAugmentRNA is a simple toolbox for RNA-seq based datasets which is compatible both with Pandas and PolarsFeaturesNormalize data based on read countsAugment new samples of data for different labels based on negative binomial distributions or generative adversarial models, with tuneable noiseDown-sample data data to equalize across class labelsInstallationaugmentRNA can be installed via the pip package manager for pythonpipinstallaugmentRNAFeaturesaugment_datadata=augment_data(data,num_samples,label,selected_label=0,evals=False,epochs=20,augment_type='nbinom',polars=False,normalize=False,noise=0)Augments new data samples for RNA-seq analysisInputsdata: polars df, pandas df, str
A dataframe containing the RNA-seq data, or a path to a .csv file of the dataframenum_samples: int
The additional numbers of samples that should be augmented from the datalabel: str
The label of the df column containing the classification labelselected_label: str, int
The selected label that should be amplified. 'all' will amplify all labels to the selected amountaugment_type: str
The type of augmentation that should be performed. A string containing 'nbinom' will sample from negative binomialwhere applicable, otherwise sampling from a normal distribution, or for genes with no expression in the sample, will just output zeroes. A string containing 'gan' will sample from a generative adversarial network to generate samples.
Defaults to nbinomnoise: int, float
The amount of noise that should be applied to the model (uniform noise based on the existing gene distribution). Defaults to zeropolars: bool
Whether a polars (True) or pandas dataframe (False) should be used as the input. dataframe. Defaults to Falsenormalize_data: bool
Whether the data should be normalized based on read counts. Defaults to Falseepochs: int
If a GAN is generated, how many epochs should the model be run for? Defaults to 20Outputsdata: polars df, pandas df
Output dataframe containing augmented data and old data.data=add_noise(data,label='RA',noise=0.1,noise_type=None,polars=True):Adds several different forms of noise to a dataframe of dataInputsdata: polars df, pandas df
A data containing the data that should have noise injectedlabel: str, int
The label column name containing classesnoise: float, int
The proportion of noise added (by the proportion of the dataset mean/inddividual sample noise) to the data. Default .1noise_type: string
The type of noise. Can either be mean (mean of the dataset noise) or uniform (across a uniform distribution of the maximum/minimum of the column). Defaults to uniformpolars: bool
Whether polars or pandas should be used. Defaults to TrueOutputsdata : polars df, pandas df
Originala dataframe with noise addednormalize_datadata =  normalize_data(data, polars = False, round_data = True)Inputsdata: polars df, pandas df
Input dataframe to normalizepolars: bool
Whether a polars dataframe (True) or pandas dataframe (False) should be usedround_data: bool
Whether the output values should be converted to integers or kept as floatsOutputsdata: polars df, pandas df
Output normalized dataframerelevant_genesdata = relevant_genes(data, label = 'RA', polars = False):Filters dataset to only contain genes that have non-zero values in all columns, or zero vaues in all columns for every label.Seeks to minimize bias from different sequencing/sampling methods for different labels, and make the training dataset more representative.Inputsdata: polars df, pandas df, str
RNA-seq expresison dataframelabel: str
Dataframe column containing labelspolars: bool
Whether pandas (False) or polars (True) dataframe is the inputOutputsdata: polars df, pandas df
An output dataframe containing only genes that are relevant across all samplesDevelopmentThis project is currently under active beta development. New features are being added, and if there is an additional processing feature that would fit the toolbox, please reach out the lead developer atchristian@defrondeville.com.LicenseMIT