Opened 9 months ago

Closed 6 months ago

#1500 closed task (fixed)

Implement ASCAT analysis for WGS data

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: Reggie v4.49
Component: net.sf.basedb.reggie Keywords:
Cc:

Description

The input is two BAM files, one from tumor and one from normal (blood) tissue and a given list of genomic positions. Output is several plots as well as copy number, BAF and other information for each of the given positions. There are also some summary statistics for average ploidy, normal cell contamination, etc.

Inspection of the final result is needed since there may be more than one possible solution and it should be possible to re-do the analysis with different starting values for the ploidy and purity parameters.

A starting point for getting the software is the AscatNGS package https://github.com/cancerit/ascatNgs

There is a pre-build docker image (https://github.com/cancerit/dockstore-cgpwgs) that can be used as a template for a Singularity container. The ASCAT version is a bit old (2.5.1), but it should be possible to update this to the latest (3.1.2) in our Singularity build process. We need to apply some minor modifications to the wrapper scripts in the docker container.

Change History (31)

comment:1 by Nicklas Nordborg, 9 months ago

In 7262:

References #1500: Implement ASCAT analysis for WGS data

Added first version of a Singularity definition file for the ASCAT analysis.

comment:2 by Nicklas Nordborg, 9 months ago

In 7263:

References #1500: Implement ASCAT analysis for WGS data

Added the original runASCAT.R file from https://github.com/cancerit/ascatNgs that is included in the dockstore image.

comment:3 by Nicklas Nordborg, 9 months ago

In 7264:

References #1500: Implement ASCAT analysis for WGS data

Modified the wrapper script runASCAT.R so that it load the new ASCAT version instead of older version. The updated wrapper script is copied into the container during the build process. The original script is saved as runASCAT_orig.R.

comment:4 by Nicklas Nordborg, 9 months ago

In 7265:

References #1500: Implement ASCAT analysis for WGS data

Modified the wrapper script runASCAT.R so that it calls ascat.aspcf() with penalty=100.

comment:5 by Nicklas Nordborg, 9 months ago

In 7266:

References #1500: Implement ASCAT analysis for WGS data

Added an item list for the ASCAT pipeline and two new wizards to index page:

  • Start ASCAT
  • Confirm ASCAT

No functionality there yet.

comment:6 by Nicklas Nordborg, 9 months ago

In 7267:

References #1500: Implement ASCAT analysis for WGS data

Started to implement the "Start ASCAT" wizard.

comment:7 by Nicklas Nordborg, 9 months ago

In 7268:

References #1500: Implement ASCAT analysis for WGS data

A job can now be submitted to the cluster but the ascat.sh script doens't do anything.

comment:8 by Nicklas Nordborg, 8 months ago

In 7269:

References #1500: Implement ASCAT analysis for WGS data

Implemented functionality for finding the paired normal alignment from a given tumor alignment.

comment:9 by Nicklas Nordborg, 8 months ago

In 7270:

References #1500: Implement ASCAT analysis for WGS data

Started to implement the actual ASCAT pipeline. The first step is to get LogR and BAF data from the BAM files.

comment:10 by Nicklas Nordborg, 8 months ago

In 7271:

References #1500: Implement ASCAT analysis for WGS data

Added the remaining steps to the pipeline. There are still things that need to be fixed. Some parameters are hard-coded. Result files should be renamed so that the external name is not part of the file name (it will make things a lot easier on the database side). Some final values also need to be exported to a text file so that we can import them as annotations.

comment:11 by Nicklas Nordborg, 8 months ago

In 7272:

References #1500: Implement ASCAT analysis for WGS data

Changed the ASCAT container to not be based on the AscatNGS docker images. Instead, we use the same type of container based on Rocky linux and conda as all of our other containers. We are installing the modified ASCAT from https://github.com/nnordborg/ascat

comment:12 by Nicklas Nordborg, 7 months ago

In 7278:

References #1500: Implement ASCAT analysis for WGS data

Modified the wrapper R scripts to use "argparser" for parsing command line arguments. This will make it a lot easier to supply custom options since we can simply skip parameters to use the default values.

comment:13 by Nicklas Nordborg, 7 months ago

In 7279:

References #1500: Implement ASCAT analysis for WGS data

Added support for manually setting some parameters for ASCAT.

comment:14 by Nicklas Nordborg, 7 months ago

In 7280:

References #1500: Implement ASCAT analysis for WGS data

Generate a file with results (same as AscatNGS)

comment:15 by Nicklas Nordborg, 7 months ago

In 7281:

References #1500: Implement ASCAT analysis for WGS data

Rename result files so that the tumor name is not part of the filenames.

comment:16 by Nicklas Nordborg, 7 months ago

In 7287:

References #1500: Implement ASCAT analysis for WGS data

Implemented linking and parsing of result files. Some values are imported as annotations. Also added annotations for parameters that has been manually changed from the default values.

comment:17 by Nicklas Nordborg, 7 months ago

In 7288:

References #1500: Implement ASCAT analysis for WGS data

Added the sunrise plot as a thumbnail to the view page for Ascat derived bioassays.

Added the sunrise, segmentation and profile plots as thumbnails to the derived bioassay list page.

comment:18 by Nicklas Nordborg, 7 months ago

In 7289:

References #1500: Implement ASCAT analysis for WGS data

Started to work with the "Confirm ASCAT" wizard. It will list completed results including thumbnail images of some plots. Registration has not been implemented yet, since it has not been decided how to handle re-analyzing with different parameters and then selecting the "best" solution (or solutions).

comment:19 by Nicklas Nordborg, 7 months ago

In 7290:

References #1500: Implement ASCAT analysis for WGS data

Disabled the auto-confirm option since the results need to be manually inspected.

If a single item is selected when starting ASCAT, there is a check for existing results and a button is enabled. The intention is to open a popup window with the existing results to make it easier to select new parameters for the re-run. The popup is not yet implemented.

comment:20 by Nicklas Nordborg, 7 months ago

In 7291:

References #1500: Implement ASCAT analysis for WGS data

Added the popup for viewing existing ASCAT results. It is very similar to the confirm wizard.

comment:21 by Nicklas Nordborg, 7 months ago

In 7292:

References #1500: Implement ASCAT analysis for WGS data

Added a counter for unconfirmed ASCAT results.

comment:22 by Nicklas Nordborg, 6 months ago

In 7293:

References #1500: Implement ASCAT analysis for WGS data

Started to implement the registration of ASCAT results. All results need to be manually inspected and a new annotation AscatResult has been added. It can take the following values:

  • Accepted: The results are good. No further action is required.
  • NotAccepted: The results are not trusted, but we keep them in the database. Another option would be to Delete the results. The Re-analyze option can be used to start a new analysis with manual parameters.
  • Undecided: We don't know yet if the results are good or not. The Re-analyze option can be used to start a new analysis with manual parameters so that we can compare the outcomes.
  • Failed: This value can't be set manually. It is only set if the job fails with an error.

The intended workflow is something like this:

  1. Start ASCAT with default parameters
  2. Inspect the result and either accept it or schedule a re-processing with manual parameters (keep the Undecided option selected).
  3. When the new result is available it is possible to compare them. Decide if one of the result can be Accepted or not. If so, then set the other result as NotAccepted. If not result is acceptable keep the Undecided option and try some other parameters.

comment:23 by Nicklas Nordborg, 6 months ago

In 7294:

References #1500: Implement ASCAT analysis for WGS data

Tumor alignments are added to the ASCAT pipeline after confirmation. Auto-confirmation will not start ASCAT since it also requires a normal alignment (we could implement a check for this, but since all current alignements are already completed there is no use for it).

comment:24 by Nicklas Nordborg, 6 months ago

In 7295:

References #1500: Implement ASCAT analysis for WGS data

Use preset height and width in popup for ASCAT plots.

comment:25 by Nicklas Nordborg, 6 months ago

In 7296:

References #1500: Implement ASCAT analysis for WGS data

Added ASCAT results to the case summary.

comment:26 by Nicklas Nordborg, 6 months ago

In 7297:

References #1500: Implement ASCAT analysis for WGS data

Minor adjustments to the ascat results display.

comment:27 by Nicklas Nordborg, 6 months ago

In 7298:

References #1500: Implement ASCAT analysis for WGS data

Added information about manual parameters to the case summary.

comment:28 by Nicklas Nordborg, 6 months ago

In 7299:

References #1500: Implement ASCAT analysis for WGS data

Added a small border to the icons.

comment:29 by Nicklas Nordborg, 6 months ago

In 7313:

References #1500: Implement ASCAT analysis for WGS data

Modified the confirmation wizard to first display a list with items waiting for confirmation where the user must select the items to review. By default, the first 10 items are selected. This change is made so that the second step doesn't have to display too much information at the same time.

comment:30 by Nicklas Nordborg, 6 months ago

In 7314:

References #1500: Implement ASCAT analysis for WGS data

Do not display empty result.

comment:31 by Nicklas Nordborg, 6 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.