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

Specify samples to include #12

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# dnanexus_ED_cnv_analysis_v1.3.0
# dnanexus_ED_cnv_analysis_v1.3.1
Performs CNV calling using ExomeDepth.

Exome depth is run in two stages. Firstly, read counts are calculated, before CNVs are called using the read counts. Read counts are calculated over the entire genome whereas the CNV calling can be performed using a subpanel.
Expand All @@ -19,6 +19,7 @@ For further details on the usage of the docker image please refer to https://git
- Readcount file generated using https://github.com/moka-guys/dnanexus\_ED\_readcount_analysis
- List of comma seperated pan numbers (Pan4127,Pan4129,Pan4130,Pan4049)
- Test specific BED file
- Optional: list of comma separated samples if want to run a specific sample or a list of samples only. Use the sample name before the Pan number (e.g. NGS629_01_xxxxxx_NA12878_U_VCP2R208ViaGP08,NGS629_02_xxxxxx_NA12878_U_VCP2R208ViaGP08)
Note: Transitional probability is set to 0.01, the default value is 0.001 (too many false positives during testing).
See CLI command below for an example of inputs.

Expand All @@ -34,7 +35,7 @@ See CLI command below for an example of inputs.
The app can be run from the dx CLI. The example below shows the code used to run test samples through this app:

```bash
dx run project-G0pKxX80pgqFk9Vy8p6vQbKv:applet-G7B5Zxj0pgq9Q8JfP0jpY3y4 -iproject_name=003_220103_exomeDepth_calling_test -ireadcount_file=project-G6jb1k807Xjj1J984K6kfP13:file-G6kg5q80gvvz37qZ4ZPbvZ8Q -ibamfile_pannumbers=Pan4127,Pan4129,Pan4130,Pan4049 -isubpanel_bed=project-ByfFPz00jy1fk6PjpZ95F27J:file-G6kZpqQ0jy1q1Zk94G3qbVyV
dx run project-G0pKxX80pgqFk9Vy8p6vQbKv:applet-G7B5Zxj0pgq9Q8JfP0jpY3y4 -iproject_name=003_220103_exomeDepth_calling_test -ireadcount_file=project-G6jb1k807Xjj1J984K6kfP13:file-G6kg5q80gvvz37qZ4ZPbvZ8Q -ibamfile_pannumbers=Pan4127,Pan4129,Pan4130,Pan4049 -isubpanel_bed=project-ByfFPz00jy1fk6PjpZ95F27J:file-G6kZpqQ0jy1q1Zk94G3qbVyV -iincluded_samples=NGS629_01_xxxxxx_NA12878_U_VCP2R208ViaGP08,NGS629_02_xxxxxx_NA12878_U_VCP2R208ViaGP08
```
# Debugging

Expand Down
15 changes: 11 additions & 4 deletions dxapp.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "ED_cnv_calling_v1.3.0",
"title": "ED_cnv_calling_v1.3.0",
"summary": "v1.3.0 - Performs CNV calling using ExomeDepth",
"name": "ED_cnv_calling_v1.3.1",
"title": "ED_cnv_calling_v1.3.1",
"summary": "v1.3.1 - Performs CNV calling using ExomeDepth",
"properties": {
"github release": "v1.3.0"
"github release": "v1.3.1"
},
"dxapi": "1.0.0",
"inputSpec": [
Expand Down Expand Up @@ -34,6 +34,13 @@
"class": "file",
"patterns": ["*.bed"],
"optional": false
},
{
"name": "included_samples",
"label": "included samples",
"class": "string",
"optional": true,
"help": "comma separated sample name(s) to be included. Use the sample name before the Pan number"
}
],
"outputSpec": [
Expand Down
16 changes: 11 additions & 5 deletions src/code.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# exomedepth_cnv_analysis_v1.3.0
# exomedepth_cnv_analysis_v1.3.1

# The following line causes bash to exit at any point if there is any error
# and to output each line as it is executed -- useful for debugging
Expand Down Expand Up @@ -50,10 +50,16 @@ mark-section "download bams files and indexes"
# split this into an array and loop through to download BAM and BAI files
IFS=',' read -ra pannum_array <<< $bamfile_pannumbers
for panel in "${pannum_array[@]}"; do

if [[ " ${pans_from_bams[*]} " =~ " ${panel} " ]]; then
# If requested pan number has matching bam files
if [[ " ${pans_from_bams[*]} " =~ " ${panel} " ]] && [[ ! "$included_samples" ]]; then
# If requested pan number has matching bam files and included_samples is not provided
dx download "$project_name":output/*"$panel"*001.ba* --auth "$API_KEY"
elif [[ " ${pans_from_bams[*]} " =~ " ${panel} " ]] && [[ "$included_samples" ]]; then
# If requested pan number has matching bam files and included_samples is provided
IFS=',' read -ra included_samples_array <<< $included_samples
for sample in ${included_samples_array[@]}
do
dx download "$project_name":output/"$sample"*"$panel"*001.ba* --auth "$API_KEY"
done
else
echo "WARNING: No bam/bai files found for ${panel}"
fi
Expand Down Expand Up @@ -114,7 +120,7 @@ echo "RDATA = " "$readcount_file_name"
docker run -v /home/dnanexus:/home/dnanexus/ \
--rm ${DOCKERIMAGENAME} \
exomeDepth.R \
'v1.3.0' \
'v1.3.1' \
/home/dnanexus/out/exomedepth_output/exomedepth_output/"$samplename"_output.pdf \
/home/dnanexus/in/subpanel_bed/"$subpanel_bed_name":"$subpanel_bed_prefix" \
/home/dnanexus/in/readcount_file/"$readcount_file_name" "$bam":"$samplename":0.01 $QC_file
Expand Down