Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aberrant expression #67

Merged
merged 113 commits into from
Oct 9, 2024
Merged

Aberrant expression #67

merged 113 commits into from
Oct 9, 2024

Conversation

AEstebanMar
Copy link
Collaborator

First merge

…onDbi and keepStandardChromosmes from GenomeInfoDb to imports
…s, estimateThetaWithoutAutoCorrect, get_base_ID, get_counts and get_unique_rownames to exports. Renamed process_gtf to preprocess_gtf
…ore each big step of preprocess_gtf function. Fixed makeTxDbFromGFF call, was taking opt$database_gtf as input, now takes gtf. Specified namespace of exonsBy function (GenomicFeatures package). Fixed gene_name_mapping, was being called with no argument, now gtf path passed as input. Fixed call to write.table, was write_table. Fixed typo in map_genes documentation, was "map_gnes". Removed subsetting of gtf_df object, result of map_genes function. Removed empty examples from roxygen blocks across all functions. Removed check for existing file from map_genes function. Fixed import namespace, was specifying "tracklayer" package instead of "rtracklayer". Fixed indentation along map_genes function, as the file.exists conditional block no longer exists and its commands now exist independently. Added and documented add_HPO_cols function, importing add_HPO_cols script no longer needed. Added and documented get_counts, get_unique_rownames, get_base_ID and add_base_IDs functions from aberrant expression mergeCounts script. Added and documented estimateThetaWithoutAutoCorrect function from Aberrant Expression Outrider_Summary script. Added and documented AE_Sample_Overview and AE_Gene_Overview functions from OUTRIDER_Overview script.
…delete once it is installed. Changed call to process_gtf to preprocess_gtf, as the function has been renamed
…vs_imported, get_aberrants and format_aberrants functions
…and format_aberrants definitions, now contained in package (DROP_functions.R file under R/)
… Added saveDB import from AnnotationDbi, file_path_sans_ext import from tools, and import import from rtracklayer to map_genes function. Added fread and setnames imports from data.table and removed require(data.table) from add_HPO_cols function. Added OUTRIDER, OutriderDataSet, normalizationFactors, counts, fit and theta imports from OUTRIDER and colData import from SummarizedExperiment to estimateThetaWithoutAutoCorrect function. In that same function, specified OUTRIDER namespace in OutriderDataSet, counts, normalizationFactors, fit and theta calls. Added plotVolcano import from OUTRIDER to AE_Sample_Overview function. Fixed description of format_aberrants function. Added plotExpressionRank and plotExpectedVsObservedCounts imports from OUTRIDER to AE_Gene_Overview function.
…rns a list with the generated objects. Renamed get_counts to get_file_counts. AE_Sample_Overview and AE_Gene_Overview now take dataset and cfg as arguments. format_aberrants argument df renamed to input_table, it now admits data frames and data tables. Added data.table package import to format_aberrants.
…ion, as it is an object that it generates and not an input. Added left_join import from dplyr. Fixed yaml read_yaml import, it was "read.yaml" which does not exist. count_files no longer tries to access optparse objects, instead taking the count_files main argument. Renamed assays_table to merged_counts_table. Specified data.table namespace in data.table call for col_data generation. Specified dplyr namespace in left_join call for col_data modification. Removed reading of RDS when generating "counts" object, now takes "total_counts" argument from main. Changed namespace of colData calls in external data check, now SummarizedExperiment (was OUTRIDER, wrong package). Removed reading of ods_unfitted rds file. Specified SummarizedExperiment in rowRanges endoapply call. Updated input of OUTRIDER::OUTRIDER call in OUTRIDER fitting step, was "ods" and now is "ods_unfitted", more descriptive name (script version called ods_unfitted loaded object ods, therefore the mixup). Removed lines meant for RMarkdown and wBuild. Updated "colGroups" argument value of heatmap functions from "isExternal" to "EXTERNAL". Many lines were trying to access optparse objects, they now access function arguments. Renamed expTable to bam_coverage. Indentation fixes in counting_Summary block. In format_for_report block, updated generation of "aberrants" object, lapply call to get_aberrants now includes zScoreCutoff and padjCutoff arguments. Created final_results list, containing total_counts, ods_unfitted, ods, OUTRIDER complete results, OUTRIDER results table, bam coverage and formatted report tables. Function now returns final_results list
…handler to options, it prints traceback to standard output. Reordered optparse flags, they now reflect order of function arguments. Count_ranges short flag now r, count_files short flag now c, config_file short flag now o, sample_bam_stats now b. Removed merged_bam_stats option. Removed Aberrant Expression workflow from script, now it calls main_aberrant_expression function and stores its output in final_results object. Changed file mode to 755
… takes a second argument. Writing of files to disk now handled by script. Output_dir now argument of script option parser. If it is NULL, saves to default Hunter DROP directory (recommended)
… optparse and main tags to corresponding code blocks.
…ernal is a boolean that affects behaviour of some plots, local_columns is used to define cnts_mtx_local object and store it in plotter$hash_vars. Switches var_attr and smp_attr, as well as varOverlays and smpOverlays, new htmlreportR behaviour that properly follows CanvasXpress structure. quant no longer defined, hard-coded as .95 (might add a way to define it in the future). Unused plots commented to use as reference, will be deleted in the future
…for filter_df creation. Added call to filter_matrix, stores result in filter_df, which is then stored in final_results. counts_matrix, local_counts_matrix, size_factors and localsize_factors also not stored in final_results, as they are stored in filter_df, which is actually where they are used. Removed migrated code from placeholder function.
…e creation when it is not necessary in the inst/ folder. Uncommented results generation and temporary RDS saving
…names to Counting_Summary code blocks. Added commented OUTRIDER graphics generation blocks for reference. Divided Counting_Summary scatter2D and countRanks plots in two separate divs.
…ned "quant" variable to 0.95. Changed magrittr pipe to base R pipe. Added get_expressed_genes function, briefly explained it (not proper documentation)
…ated, saved in final_results list. Removed migrated code from placeholder function. filter_df and expressed_genes passed to write_abgenes_report function, removed size_factors arguments.
…ta tables. Retitled report from "Aberrantly Expressed Genes Report" to "Aberrant Expression Report". Renamed blocks, now more informative and compact names. Added Expressed_genes_dt block, prints a data table of statistics of expressed genes.
…get_expressed_genes, was trying to call "nrownames" function instead of "rownames"
…n in plot_enc_dim_search function. Removed rownames_as_col function. Added format_sample_volcano, plot_expression_rank and plot_expected_vs_observed functions. Reformatted call to plotter$table in Expressed_genes_dt block. Added OUTRIDER Overview section, with OUTRIDER_Overview_table and OUTRIDER_Overview_Samples blocks. Table is finished, samples still in testing stage. Added OUTRIDER_Overview_Genes block, but still commented (just a guide for now)
…ctions, now included in report template. Specified data.table namespace in fread call in .parse_externals function. Removed .add_base_IDs call in .get_metadata function, it was useful for a very specific test in another project, does not belong in package. Simplified that entire function. Minor formatting fixes in merge_counts function. Improved max_dim_proportion conditional behaviour in run_outrider function. Simplified get_ods_results function.
…ining of main_abgenes_Hunter function, using sample annotation file instead of ods object. Removed report placeholder reference function. Added compress_obj and type_index arguments to plotter object generation.
…up block to "format_volcano". Added format_aberrants_heatmap function to setup block. Section titles now created with plotter$create_title, and set as clickable menu objects. Finished migrating OUTRIDER report, might rewrite some plots in CanvasXpress
…tead of inside function, makes more sense this way
… algorithm as aberrant expression clustering and led to confusion, as well as unnecessary processing. Will import clustering once we figure out how to do it. OUTRIVER Overview section disabled if no aberrants have been found. Diagnostics section paragraphs now also dependent on the same conditional that controlls section activation (will no longer be present if section is disabled).
…ts_heatmap function, as it was coercing to single digit when only one aberrant gene had been detected. Now it is kept as data frame. Removed commented line in that same function, improved renaming of colnames to gene IDs
… .get_file_counts, and added importFrom roxygen field. Did the same in filter_counts. Added imports for OtriderDataSet and FilterExpression from OUTRIDER package and colData, rowData and assay from package SummarizedExperiment to merge_counts function.
@seoanezonjic seoanezonjic merged commit 0322a18 into master Oct 9, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants