rna_library.processing¶
Submodules¶
Package Contents¶
Classes¶
Composite class that represents a collection of JunctionEntry objects in an experiment. |
|
Represents a single junction entry from an RNA construct |
Functions¶
|
Builds the reactivity dataframe from the supplied arguments. Here each row reprsents a construct. |
|
Function that creates a motif dataframe from a reactivity dataframe. Here each row represents a Motif. |
|
Normalizes a reactivity pattern to a normalization hairpin. Creates fully normalize values |
|
-
class
rna_library.processing.JunctionData(**kwargs)¶ Composite class that represents a collection of JunctionEntry objects in an experiment.
-
get_active_data(self)¶
-
rebuild_data(self)¶ Method that rebuilds the internal data representation from the JunctionEntry objects.
- Return type
NoneType
-
is_symmetrical(self)¶ Getter that tells if the current JunctionData object models a symmetrical junction. :rtype: bool
-
plot(self, plot_dir, overwrite=False)¶ Method that saves a plot of the JunctionData’s data points to the supplied directory.
- Param
str plot_dir: The directory where the plot will be saved. Does not have to exist.
- Return type
NoneType
- Parameters
plot_dir (str) –
-
show(self)¶ Method that brings up a plot of the JunctionData’s data points
- Return type
NoneType
-
bind(self, ax)¶ Method that binds the JunctionData points to a supplied matplotlib Axes object.
- Param
matplotlib.axes.Axes ax: the Axes object which the plot will be bound to
- Return type
NoneType
- Parameters
ax (matplotlib.axes.Axes) –
-
measure_variance(self)¶ - Return type
Dict[str, float]
-
-
class
rna_library.processing.JunctionEntry(**kwargs)¶ Represents a single junction entry from an RNA construct
-
validate_arguments_(self)¶ Helper method that validates arguments in the constructor.
-
key(self)¶ Getter that accesses the (sequence, structure) key for the JunctionEntry
- Return type
Tuple[str,str]
-
is_symmetrical(self)¶ Getter that checks if the JunctionEntry is for a symmetrical unction.
- Return type
bool
-
__getitem__(self, idx)¶ - Parameters
idx (int) –
- Return type
float
-
-
rna_library.processing.process_histos(mut_hist_file, output_directory, remove_html=True)¶ Processes a mutational histogram file generated by dreem.
- Param
str mut_hist_file: path to the mutational histogram file
- Param
str output_directory: the output directory for the analysis files
- Param
bool remove_html: flag to remove .html files generated by DREEM, defaults to True
- Parameters
mut_hist_file (str) –
output_directory (str) –
remove_html (bool) –
- Return type
None
-
rna_library.processing.build_react_df(**kwargs)¶ - Builds the reactivity dataframe from the supplied arguments. Here each row reprsents a construct.
Note that all arguments are supplied as kwargs.
- Params
str out_dir: base output directory where rna_library.process_histos was called :params: str start_seq: common start sequence for the RNA constructs
- Params
str end_seq: common end sequence for the RNA constructs
- Params
str fasta_file: path to the fast file for the construct
- Params
str histos_file: path to histogram file from DREEM analysis :rtype: pd.DataFrame
- Return type
pandas.DataFrame
-
rna_library.processing.build_motif_df(df)¶ Function that creates a motif dataframe from a reactivity dataframe. Here each row represents a Motif.
- Param
pd.DataFrame df: reactivity dataframe which is generated from build_react_df() :rtype: pd.DataFrame
- Parameters
df (pandas.DataFrame) –
- Return type
pandas.DataFrame
-
rna_library.processing.normalize_hairpin(df, seq, ss, **kwargs)¶ Normalizes a reactivity pattern to a normalization hairpin. Creates fully normalize values for an entire pd.DataFrame
- Param
pd.DataFrame df: reactivity_df created from rna_library.build_react_df
- Param
str seq: reference hairpin sequence
- Param
str ss: reference hairpin structure
- Param
float factor: factor to set the hairpin values to, is a keyword argument
- Param
str nts: string of nucleotide’s to be used for calc, is a keywrod argument
- Parameters
df (pandas.DataFrame) –
seq (str) –
ss (str) –
- Return type
List[List[float]]
-
rna_library.processing.normalize_coeff_fit(reactivity_df)¶