-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from msk-access/develop
Automate to plot
- Loading branch information
Showing
10 changed files
with
283 additions
and
471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,8 +43,7 @@ vignettes/*.pdf | |
# R Environment Variables | ||
.Renviron | ||
|
||
# gitbook | ||
docs/* | ||
|
||
|
||
# MAC | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
description: Step 5 -- Create a report showing genomic alteration data for all samples of a patient. | ||
--- | ||
|
||
# Patient report | ||
|
||
The final step takes the processed data from the previous steps and plots the genomic alterations over all samples of each patient. The report includes several sections with interactive plots: | ||
|
||
### 1. Patient information | ||
The first section displays the patient ID, DMP id (if provided), tumor type (if provided), and each sample. Any provided sample meta-information is also display for each sample. | ||
|
||
### 2. Plot of SNV variant allele frequencies | ||
The second section shows SNV/INDEL events are plotted out by VAFs over timepoints. Above the panel it also display sample timepoint annotation, such as treatment information (if provided). If you provide IMPACT sample information, it will segregate each mutation by whether it is known to be clonal in IMPACT, subclonal in IMPACT, or is present in ACCESS only. There are additional tabs that display a table of mutation data and methods description. | ||
|
||
### 3. Plot of copy number alterations | ||
The third section shows CNAs that are plotted by fold-change\(fc\) for each ACCESS sample and gene. If there are no CNAs, then this section is not displayed. | ||
|
||
### 4. Plot of clonal SNV/INDEL VAFs adjusted for copy number | ||
If you provided an IMPACT sample, this last section will show SNV/INDEL events that are plotted out by VAFs over timepoints. However, the VAFs are corrected for IMPACT copy number information. Details of the method are shown under the `Description` tab in this section. Similar to section 2, sample timepoint annotations are shown above the plot. | ||
|
||
### Usage | ||
|
||
```text | ||
Rscript reports/create_report.R -h | ||
usage: create_report.R [-h] -t TEMPLATE -p PATIENT_ID -r RESULTS -rc | ||
CNA_RESULTS_DIR -tt TUMOR_TYPE -m METADATA [-d DMP_ID] | ||
[-ds DMP_SAMPLE_ID] [-dm DMP_MAF] [-o OUTPUT] | ||
optional arguments: | ||
-h, --help show this help message and exit | ||
-t TEMPLATE, --template TEMPLATE | ||
Path to Rmarkdown template file. | ||
-p PATIENT_ID, --patient-id PATIENT_ID | ||
Patient ID | ||
-r RESULTS, --results RESULTS | ||
Path to CSV file containing mutation and genotype | ||
results for the patient. | ||
-rc CNA_RESULTS_DIR, --cna-results-dir CNA_RESULTS_DIR | ||
Path to directory containing CNA results for the | ||
patient. | ||
-tt TUMOR_TYPE, --tumor-type TUMOR_TYPE | ||
Tumor type | ||
-m METADATA, --metadata METADATA | ||
Path to file containing meta data. Should contain a | ||
'cmo_sample_id_plasma', 'sex', and 'collection_date' | ||
columns. Can also optionally include a 'timepoint' | ||
column (e.g. for treatment information). | ||
-d DMP_ID, --dmp-id DMP_ID | ||
DMP patient ID (optional). | ||
-ds DMP_SAMPLE_ID, --dmp-sample-id DMP_SAMPLE_ID | ||
DMP sample ID (optional). | ||
-dm DMP_MAF, --dmp-maf DMP_MAF | ||
Path to DMP MAF file (optional). | ||
-o OUTPUT, --output OUTPUT | ||
Output file | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
library(knitr) | ||
library(rmarkdown) | ||
library(argparse) | ||
|
||
|
||
parser <- ArgumentParser() | ||
|
||
parser$add_argument("-t", "--template", required=T, help="Path to Rmarkdown template file.") | ||
parser$add_argument("-p", "--patient-id", required=T, help="Patient ID") | ||
parser$add_argument("-r", "--results", required=T, help="Path to CSV file containing mutation and genotype results for the patient.") | ||
parser$add_argument("-rc", "--cna-results-dir", required=T, help="Path to directory containing CNA results for the patient.") | ||
parser$add_argument("-tt", "--tumor-type", required=T, help="Tumor type") | ||
parser$add_argument("-m", "--metadata", required=T, help="Path to file containing meta data for each sample. Should contain a \'cmo_sample_id_plasma\', \'sex\', and \'collection_date\' columns. Can also optionally include a \'timepoint\' column (e.g. for treatment information).") | ||
parser$add_argument("-d", "--dmp-id", help="DMP patient ID (optional).") | ||
parser$add_argument("-ds", "--dmp-sample-id", help="DMP sample ID (optional).") | ||
parser$add_argument("-dm", "--dmp-maf", help="Path to DMP MAF file (optional).") | ||
parser$add_argument("-o", "--output", help="Output file") | ||
|
||
args <- parser$parse_args() | ||
|
||
dmp_maf <- NULL | ||
if (!is.null(args$dmp_maf)) { | ||
dmp_maf <- normalizePath(args$dmp_maf) | ||
} | ||
|
||
|
||
input_text <- knitr::knit_expand( | ||
normalizePath(args$template), | ||
PATIENT_ID=args$patient_id, | ||
RESULTS=normalizePath(args$results), | ||
CNA_RESULTS_DIR=normalizePath(args$cna_results_dir), | ||
TUMOR_TYPE=args$tumor_type, | ||
DMP_ID=args$dmp_id, | ||
DMP_SAMPLE_ID=args$dmp_sample_id, | ||
DMP_MAF_PATH=dmp_maf, | ||
METADATA=normalizePath(args$metadata) | ||
) | ||
|
||
tmp <- tempfile(fileext = ".Rmd") | ||
cat(input_text, file = tmp) | ||
|
||
rmarkdown::render( | ||
tmp, | ||
output_format = "html_document", | ||
output_dir = normalizePath(dirname(args$output)), | ||
output_file=args$output) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.