Skip to content

Commit

Permalink
cna bug and docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
sigven committed Apr 14, 2017
1 parent e870177 commit 5e5b507
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 41 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ A local installation of Python (it has been tested with [version 2.7.13](https:/

#### STEP 2: Download PCGR

<font color="red"><b>April 12th 2017</b>: New release (v0.3)</font>
1. Download and unpack the [latest release (v0.3)](https://github.com/sigven/pcgr/releases/latest)
<font color="red"><b>April 12th 2017</b>: New release (0.3.1)</font>

1. Download and unpack the [latest release (0.3.1)](https://github.com/sigven/pcgr/releases/latest)
2. Download and unpack the data bundle (approx. 17Gb) in the PCGR directory
* Download [the latest data bundle](https://drive.google.com/file/d/0B8aYD2TJ472mQjZOMmg4djZfT1k/) from Google Drive to `~/pcgr-X.X` (replace _X.X_ with the version number, e.g `~/pcgr-0.3`)
* Download [the latest data bundle](https://drive.google.com/file/d/0B8aYD2TJ472mQjZOMmg4djZfT1k/) from Google Drive to `~/pcgr-X.X` (replace _X.X_ with the version number, e.g `~/pcgr-0.3.1`)
* Unpack the data bundle, e.g. through the following Unix command: `gzip -dc pcgr.databundle.GRCh37.YYYYMMDD.tgz | tar xvf -`

A _data/_ folder within the _pcgr-X.X_ software folder should now have been produced
3. Pull the [PCGR Docker image (v0.3)](https://hub.docker.com/r/sigven/pcgr/) from DockerHub (3.1Gb):
* `docker pull sigven/pcgr:0.3` (PCGR annotation engine)
3. Pull the [PCGR Docker image (0.3.1)](https://hub.docker.com/r/sigven/pcgr/) from DockerHub (3.1Gb):
* `docker pull sigven/pcgr:0.3.1` (PCGR annotation engine)

#### STEP 3: Input preprocessing

Expand Down Expand Up @@ -111,7 +112,7 @@ A tumor sample report is generated by calling the Python script __pcgr.py__ in t

positional arguments:
pcgr_dir PCGR base directory with accompanying data directory,
e.g. ~/pcgr-0.3
e.g. ~/pcgr-0.3.1
output_dir Output directory
sample_id Tumor sample/cancer genome identifier - prefix for
output files
Expand Down Expand Up @@ -145,7 +146,7 @@ A tumor sample report is generated by calling the Python script __pcgr.py__ in t

The _examples_ folder contain sample files from TCGA. A report for a colorectal tumor case can be generated through the following command:

`python pcgr.py --input_vcf tumor_sample.COAD.vcf.gz --input_cna_segments tumor_sample.COAD.cna.tsv ~/pcgr-0.3 ~/pcgr-0.3/examples tumor_sample.COAD`
`python pcgr.py --input_vcf tumor_sample.COAD.vcf.gz --input_cna_segments tumor_sample.COAD.cna.tsv ~/pcgr-0.3.1 ~/pcgr-0.3.1/examples tumor_sample.COAD`

This command will run the Docker-based PCGR workflow and produce the following output files in the _examples_ folder:

Expand Down
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/getting_started.doctree
Binary file not shown.
12 changes: 6 additions & 6 deletions docs/_build/html/_sources/getting_started.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ terminal window.
Download PCGR
^^^^^^^^^^^^^

**April 12th 2017**: New release (v0.3)
**April 14th 2017**: New release (0.3.1)

- Download and unpack the `latest release
(v0.3) <https://github.com/sigven/pcgr/releases/latest>`__
(0.3.1) <https://github.com/sigven/pcgr/releases/latest>`__

- Download and unpack the data bundle (approx. 17Gb) in the PCGR
directory

- Download `the latest data
bundle <https://drive.google.com/file/d/0B8aYD2TJ472mQjZOMmg4djZfT1k/>`__
from Google Drive to ``~/pcgr-X.X`` (replace *X.X* with the
version number, e.g. ``~/pcgr-0.3``)
version number, e.g. ``~/pcgr-0.3.1``)
- Decompress and untar the bundle, e.g. through the following Unix
command:
``gzip -dc pcgr.databundle.GRCh37.YYYYMMDD.tgz | tar xvf -``
Expand All @@ -62,10 +62,10 @@ Download PCGR
have been produced

- Pull the `PCGR Docker image -
v0.3 <https://hub.docker.com/r/sigven/pcgr/>`__ from DockerHub
0.3.1 <https://hub.docker.com/r/sigven/pcgr/>`__ from DockerHub
(3.1Gb) :

- ``docker pull sigven/pcgr:0.3`` (PCGR annotation engine)
- ``docker pull sigven/pcgr:0.3.1`` (PCGR annotation engine)

Run test - generation of clinical report for a cancer genome
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -125,7 +125,7 @@ sequenced within TCGA. A report for a colorectal tumor case can be
generated by running the following command in your terminal window:

``python pcgr.py --input_vcf examples/tumor_sample.COAD.vcf.gz --input_cna_segments``
``examples/tumor_sample.COAD.cna.tsv ~/pcgr-0.3 ~/pcgr-0.3/examples tumor_sample.COAD``
``examples/tumor_sample.COAD.cna.tsv ~/pcgr-0.3.1 ~/pcgr-0.3.1/examples tumor_sample.COAD``

This command will run the Docker-based PCGR workflow and produce the
following output files in the *examples* folder:
Expand Down
12 changes: 6 additions & 6 deletions docs/_build/html/getting_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,18 @@ <h3>Python<a class="headerlink" href="#python" title="Permalink to this headline
</div>
<div class="section" id="download-pcgr">
<h3>Download PCGR<a class="headerlink" href="#download-pcgr" title="Permalink to this headline"></a></h3>
<p><strong>April 12th 2017</strong>: New release (v0.3)</p>
<p><strong>April 14th 2017</strong>: New release (0.3.1)</p>
<ul>
<li><p class="first">Download and unpack the <a class="reference external" href="https://github.com/sigven/pcgr/releases/latest">latest release
(v0.3)</a></p>
(0.3.1)</a></p>
</li>
<li><p class="first">Download and unpack the data bundle (approx. 17Gb) in the PCGR
directory</p>
<ul class="simple">
<li>Download <a class="reference external" href="https://drive.google.com/file/d/0B8aYD2TJ472mQjZOMmg4djZfT1k/">the latest data
bundle</a>
from Google Drive to <code class="docutils literal"><span class="pre">~/pcgr-X.X</span></code> (replace <em>X.X</em> with the
version number, e.g. <code class="docutils literal"><span class="pre">~/pcgr-0.3</span></code>)</li>
version number, e.g. <code class="docutils literal"><span class="pre">~/pcgr-0.3.1</span></code>)</li>
<li>Decompress and untar the bundle, e.g. through the following Unix
command:
<code class="docutils literal"><span class="pre">gzip</span> <span class="pre">-dc</span> <span class="pre">pcgr.databundle.GRCh37.YYYYMMDD.tgz</span> <span class="pre">|</span> <span class="pre">tar</span> <span class="pre">xvf</span> <span class="pre">-</span></code></li>
Expand All @@ -209,10 +209,10 @@ <h3>Download PCGR<a class="headerlink" href="#download-pcgr" title="Permalink to
have been produced</p>
</li>
<li><p class="first">Pull the <a class="reference external" href="https://hub.docker.com/r/sigven/pcgr/">PCGR Docker image -
v0.3</a> from DockerHub
0.3.1</a> from DockerHub
(3.1Gb) :</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">docker</span> <span class="pre">pull</span> <span class="pre">sigven/pcgr:0.3</span></code> (PCGR annotation engine)</li>
<li><code class="docutils literal"><span class="pre">docker</span> <span class="pre">pull</span> <span class="pre">sigven/pcgr:0.3.1</span></code> (PCGR annotation engine)</li>
</ul>
</li>
</ul>
Expand Down Expand Up @@ -272,7 +272,7 @@ <h2>Run test - generation of clinical report for a cancer genome<a class="header
sequenced within TCGA. A report for a colorectal tumor case can be
generated by running the following command in your terminal window:</p>
<p><code class="docutils literal"><span class="pre">python</span> <span class="pre">pcgr.py</span> <span class="pre">--input_vcf</span> <span class="pre">examples/tumor_sample.COAD.vcf.gz</span> <span class="pre">--input_cna_segments</span></code>
<code class="docutils literal"><span class="pre">examples/tumor_sample.COAD.cna.tsv</span> <span class="pre">~/pcgr-0.3</span> <span class="pre">~/pcgr-0.3/examples</span> <span class="pre">tumor_sample.COAD</span></code></p>
<code class="docutils literal"><span class="pre">examples/tumor_sample.COAD.cna.tsv</span> <span class="pre">~/pcgr-0.3.1</span> <span class="pre">~/pcgr-0.3.1/examples</span> <span class="pre">tumor_sample.COAD</span></code></p>
<p>This command will run the Docker-based PCGR workflow and produce the
following output files in the <em>examples</em> folder:</p>
<ol class="arabic simple">
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/searchindex.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ An installation of Python (version 2.7.13) is required to run PCGR. Check that P

#### Download PCGR

__April 12th 2017__: New release (v0.3)</font>
__April 14th 2017__: New release (0.3.1)</font>

* Download and unpack the [latest release (v0.3)](https://github.com/sigven/pcgr/releases/latest)
* Download and unpack the [latest release (0.3.1)](https://github.com/sigven/pcgr/releases/latest)

* Download and unpack the data bundle (approx. 17Gb) in the PCGR directory
* Download [the latest data bundle](https://drive.google.com/file/d/0B8aYD2TJ472mQjZOMmg4djZfT1k/) from Google Drive to `~/pcgr-X.X` (replace _X.X_ with the version number, e.g. `~/pcgr-0.3`)
* Download [the latest data bundle](https://drive.google.com/file/d/0B8aYD2TJ472mQjZOMmg4djZfT1k/) from Google Drive to `~/pcgr-X.X` (replace _X.X_ with the version number, e.g. `~/pcgr-0.3.1`)
* Decompress and untar the bundle, e.g. through the following Unix command: `gzip -dc pcgr.databundle.GRCh37.YYYYMMDD.tgz | tar xvf -`

A _data/_ folder within the _pcgr-X.X_ software folder should now have been produced

* Pull the [PCGR Docker image - v0.3](https://hub.docker.com/r/sigven/pcgr/) from DockerHub (3.1Gb) :
* `docker pull sigven/pcgr:0.3` (PCGR annotation engine)
* Pull the [PCGR Docker image - 0.3.1](https://hub.docker.com/r/sigven/pcgr/) from DockerHub (3.1Gb) :
* `docker pull sigven/pcgr:0.3.1` (PCGR annotation engine)


### Run test - generation of clinical report for a cancer genome
Expand Down Expand Up @@ -90,7 +90,7 @@ A tumor sample report is generated by calling the Python script __pcgr.py__, whi
The _examples_ folder contain input files from two tumor samples sequenced within TCGA. A report for a colorectal tumor case can be generated by running the following command in your terminal window:

`python pcgr.py --input_vcf examples/tumor_sample.COAD.vcf.gz --input_cna_segments `
`examples/tumor_sample.COAD.cna.tsv ~/pcgr-0.3 ~/pcgr-0.3/examples tumor_sample.COAD`
`examples/tumor_sample.COAD.cna.tsv ~/pcgr-0.3.1 ~/pcgr-0.3.1/examples tumor_sample.COAD`

This command will run the Docker-based PCGR workflow and produce the following output files in the _examples_ folder:

Expand Down
12 changes: 6 additions & 6 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ terminal window.
Download PCGR
^^^^^^^^^^^^^

**April 12th 2017**: New release (v0.3)
**April 14th 2017**: New release (0.3.1)

- Download and unpack the `latest release
(v0.3) <https://github.com/sigven/pcgr/releases/latest>`__
(0.3.1) <https://github.com/sigven/pcgr/releases/latest>`__

- Download and unpack the data bundle (approx. 17Gb) in the PCGR
directory

- Download `the latest data
bundle <https://drive.google.com/file/d/0B8aYD2TJ472mQjZOMmg4djZfT1k/>`__
from Google Drive to ``~/pcgr-X.X`` (replace *X.X* with the
version number, e.g. ``~/pcgr-0.3``)
version number, e.g. ``~/pcgr-0.3.1``)
- Decompress and untar the bundle, e.g. through the following Unix
command:
``gzip -dc pcgr.databundle.GRCh37.YYYYMMDD.tgz | tar xvf -``
Expand All @@ -62,10 +62,10 @@ Download PCGR
have been produced

- Pull the `PCGR Docker image -
v0.3 <https://hub.docker.com/r/sigven/pcgr/>`__ from DockerHub
0.3.1 <https://hub.docker.com/r/sigven/pcgr/>`__ from DockerHub
(3.1Gb) :

- ``docker pull sigven/pcgr:0.3`` (PCGR annotation engine)
- ``docker pull sigven/pcgr:0.3.1`` (PCGR annotation engine)

Run test - generation of clinical report for a cancer genome
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -125,7 +125,7 @@ sequenced within TCGA. A report for a colorectal tumor case can be
generated by running the following command in your terminal window:

``python pcgr.py --input_vcf examples/tumor_sample.COAD.vcf.gz --input_cna_segments``
``examples/tumor_sample.COAD.cna.tsv ~/pcgr-0.3 ~/pcgr-0.3/examples tumor_sample.COAD``
``examples/tumor_sample.COAD.cna.tsv ~/pcgr-0.3.1 ~/pcgr-0.3.1/examples tumor_sample.COAD``

This command will run the Docker-based PCGR workflow and produce the
following output files in the *examples* folder:
Expand Down
6 changes: 3 additions & 3 deletions pcgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def __main__():
parser.add_argument('--num_vcfanno_processes', dest = "num_vcfanno_processes", default=4, type=int, help='Number of processes used during vcfanno annotation')
parser.add_argument('--num_vep_forks', dest = "num_vep_forks", default=4, type=int, help='Number of forks (--forks option in VEP) used during VEP annotation')
parser.add_argument('--force_overwrite', action = "store_true", help='By default, the script will fail with an error if any output file already exists. You can force the overwrite of existing result files by using this flag')
parser.add_argument('--version', action='version', version='%(prog)s 0.3')
parser.add_argument('pcgr_dir',help='PCGR base directory with accompanying data directory, e.g. ~/pcgr-0.3')
parser.add_argument('--version', action='version', version='%(prog)s 0.3.1')
parser.add_argument('pcgr_dir',help='PCGR base directory with accompanying data directory, e.g. ~/pcgr-0.3.1')
parser.add_argument('output_dir',help='Output directory')
parser.add_argument('sample_id',help="Tumor sample/cancer genome identifier - prefix for output files")

docker_image_version = 'sigven/pcgr:0.3'
docker_image_version = 'sigven/pcgr:0.3.1'
args = parser.parse_args()

overwrite = 0
Expand Down
2 changes: 1 addition & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENV PACKAGE_BIO="tabix samtools libhts1 bedtools"
ENV PACKAGE_DEV="perl debconf-utils build-essential gfortran python-dev python-pip gcc-multilib autoconf zlib1g-dev git libncurses5-dev libblas-dev liblapack-dev cpanminus libcurl4-gnutls-dev libssh2-1-dev libxml2-dev vim libssl-dev openssl libcairo2-dev"
ENV PYTHON_MODULES="numpy cython scipy transvar bx-python pyvcf cyvcf cyvcf2 biopython crossmap pandas"

ENV R_BASE_VERSION 3.3.2
ENV R_BASE_VERSION 3.3.3

USER root
WORKDIR /
Expand Down
12 changes: 7 additions & 5 deletions src/R/pcgrr2/R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ cna_segment_annotation <- function(cna_file, logR_threshold_amplification, logR_
names(civic_cna_biomarkers) <- toupper(names(civic_cna_biomarkers))
civic_cna_biomarkers <- dplyr::rename(civic_cna_biomarkers, GENE = GENESYMBOL, CNA_TYPE = CIVIC_CONSEQUENCE, DESCRIPTION = EVIDENCE_DESCRIPTION, CITATION = PUBMED_HTML_LINK)

cna_biomarkers <- NULL
cna_biomarker_segments <- NULL
cna_biomarkers <- data.frame()
cna_biomarker_segments <- data.frame()
if(!is.null(tsgene_homozygous_deletion)){
if(nrow(tsgene_homozygous_deletion) > 0){
civic_biomarker_hits1 <- dplyr::inner_join(tsgene_homozygous_deletion, civic_cna_biomarkers, by=c("GENE","CNA_TYPE"))
Expand All @@ -327,9 +327,11 @@ cna_segment_annotation <- function(cna_file, logR_threshold_amplification, logR_
}

if(!is.null(cna_biomarkers)){
cna_biomarkers <- cna_biomarkers[c("CHROMOSOME","GENE","CNA_TYPE","EVIDENCE_LEVEL","CLINICAL_SIGNIFICANCE","EVIDENCE_TYPE","DESCRIPTION","DISEASE_NAME","EVIDENCE_DIRECTION","DRUG_NAMES","CITATION","RATING","GENE_NAME","CANCER_CENSUS_SOMATIC","KEGG_PATHWAY","ANTINEOPLASTIC_DRUG_INTERACTIONS","SEGMENT_LENGTH", "SEGMENT","LogR")]
cna_biomarkers <- cna_biomarkers %>% dplyr::arrange(EVIDENCE_LEVEL,RATING)
cna_biomarker_segments <- dplyr::select(cna_biomarkers, SEGMENT, LogR) %>% dplyr::distinct()
if(nrow(cna_biomarkers) > 0){
cna_biomarkers <- cna_biomarkers[c("CHROMOSOME","GENE","CNA_TYPE","EVIDENCE_LEVEL","CLINICAL_SIGNIFICANCE","EVIDENCE_TYPE","DESCRIPTION","DISEASE_NAME","EVIDENCE_DIRECTION","DRUG_NAMES","CITATION","RATING","GENE_NAME","CANCER_CENSUS_SOMATIC","KEGG_PATHWAY","ANTINEOPLASTIC_DRUG_INTERACTIONS","SEGMENT_LENGTH", "SEGMENT","LogR")]
cna_biomarkers <- cna_biomarkers %>% dplyr::arrange(EVIDENCE_LEVEL,RATING)
cna_biomarker_segments <- dplyr::select(cna_biomarkers, SEGMENT, LogR) %>% dplyr::distinct()
}
}

cna_data <- list(ranked_segments = cna_segments_filtered, oncogene_amplified = oncogene_amplified, tsgene_homozygous_deletion = tsgene_homozygous_deletion,cna_df_for_print = df_print_sorted, cna_biomarkers = cna_biomarkers, cna_biomarker_segments = cna_biomarker_segments)
Expand Down
Binary file modified src/R/pcgrr2_0.1.0.tar.gz
Binary file not shown.
Binary file modified src/pcgr.tgz
Binary file not shown.

0 comments on commit 5e5b507

Please sign in to comment.