Skip to content

Documentation of real-world inputs #11

Description

@mwhamgenomics

The vignette provides an example on simulated data, but I think this project would benefit a lot from some documentation on how to run it on real data. I've just been working through this and have some notes for the benefit of anyone trying to do something similar, e.g. on results from Purple:

Somatic variants

I had a VCF of somatic variants, so I could just parse the ref and alt allele depths from AD, and select the right columns to get something that looks like:

#   CHROM       POS REF      ALT   var_counts ref_counts total_counts
#   <chr>     <int> <chr>    <chr>      <int>      <int>        <int>
# 1 chr1   10000005 G        A            400         10          410
# 2 chr1   20000010 G        T           1100        150         1250
# 2 chr1   20000020 T        C           1200        130         1330
# 3 chr2   10000050 C        T            250         20          270
...

total_counts is var_counts + ref_counts.

CNVs

I had a file of copy number alterations per region, including major and minor allele copy number:

#  chromosome    start      end minor_cn major_cn
1        chr1        1 10000000   0.0000   1.9012
2        chr1 10000001 20000000   0.0000   1.6789
3        chr1 20000001 30000000   0.5678   1.3456
4        chr2        1  1000000   0.0000   0.2345
5        chr2  1000001  2000000   0.1000   0.3456
...

Purity estimate

In my case, I already had a single-number purity estimate from upstream analysis.

ssm input

The vignette creates a ssm dataframe that looks like:

# mutation_id ccf_true minor_cn major_cn total_cn purity normal_cn mult_true vaf_true total_counts var_counts ref_counts
# <chr>          <dbl>    <dbl>    <dbl>    <dbl>  <dbl>     <dbl>     <int>    <dbl>        <int>      <int>      <int>
1 ss_1             1          0        4        4    0.8         2         1    0.222           72         13         59
2 ss_2             0.3        1        2        3    0.8         2         2    0.172           76         10         66
3 ss_3             0.3        1        1        2    0.8         2         1    0.121           37          2         35
...

To get a real one, I took my somatic variants, added purity estimate as a column, and joined it onto my CNVs by position, so that each variant is assigned a CNV region that it coincides with:

# mutation_id   minor_cn major_cn total_cn purity normal_cn total_counts var_counts ref_counts
# <chr>            <dbl>    <dbl>    <dbl>  <dbl>     <dbl>        <int>      <int>      <int>
1 chr1_10000005        0   1.6789   1.6789    0.8         2          410        400         10
2 chr1_20000010   0.5678   1.3456   1.9134    0.8         2         1250       1100        150
3 chr1_20000020   0.5678   1.3456   1.9134    0.8         2         1300       1200        130
4 chr2_10000050   0.1000   0.3456   0.4456    0.8         2          270        250         20
...

A few notes:

  • mutation_id MUST consist of two parts, separated by an underscore _. I just took chromosome and position.
  • don't need ccf_true, mult_true or vaf_true, they're not used
  • total_cn is minor_cn + major_cn
  • normal_cn will just be 2 for diploid organisms

Running ccube

Once you've massaged the input data into the right shape:

RunCcubePipeline(
  ssm=ssm,
  sampleName='some_sample_id',
  runAnalysis=TRUE,
  runQC=TRUE,
  writeOutput=TRUE,
  basicFormats=TRUE,
  numOfClusterPool=1:6,
  numOfRepeat=1 
)

Is there any further information on some of the other options to RunCcubePipeline? Some of them I could leave on defaults like cnaCaller, epi, tol and maxiter, but I had to set something for clearnumOfClusterPool and numOfRepeat and I'm not clear on what these are.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions