Skip to content
This repository was archived by the owner on Oct 7, 2021. It is now read-only.

Commit e1b42fc

Browse files
committed
update main to be compatible in wf. update readme
1 parent a29d773 commit e1b42fc

4 files changed

Lines changed: 37 additions & 70 deletions

File tree

facets/README.md

Lines changed: 25 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,21 @@ Read more: [https://github.com/mskcc/facets/](https://github.com/mskcc/facets/)
66

77
## Usage
88

9-
The typical command for running the pipeline is as follows:
10-
11-
```
12-
nextflow run wes-postproc/modules/facets --input input.txt -profile cluster,singularity
13-
```
14-
159
Mandatory arguments:
1610
```
17-
--input Tab delimited file (no header), with paths to following files:
18-
tumor_ID normal_ID tumor.bam normal.bam target.dbsnp
11+
--pileup Pileup file produced by snp-pileup (.bc.gz)
12+
--out_prefix Output prefix
1913
```
2014

2115
Optional arguments:
2216
```
23-
--snp_pileup Full path to the folder containing the snp_pileup files (you might want to use this when re-running facets)
24-
--summaryPrefix Prefix for the summary files [all.geneCN]
25-
--q (snp-pileup) Sets the minimum threshold for mapping quality [1]
26-
--Q (snp-pileup) Sets the minimum threshold for base quality [13]
27-
--r (snp-pileup) Comma separated list of minimum read counts for a position to be output [25,0]
28-
--d (snp-pileup) Sets the maximum depth [1000]
2917
--genome Genome build (b37, GRCh37, hg19, mm9, mm10, GRCm38, hg38). [hg38]
3018
--seed [1234]
3119
--snp_nbhd Window size [250]
32-
--minNDepth Minimum depth in normal to keep the position [25]
33-
--maxNDepth Maximum depth in normal to keep the position [1000]
34-
--pre_cval Pre-processing critical value [cval1 - 50]
35-
--cval1 Critical value for estimating diploid log Ratio [200]
36-
--cval2 Starting critical value for segmentation (increases by 25 until success) [cval1 - 50]
37-
--max_cval Maximum critical value for segmentation (increases by 25 until success) [5000]
20+
--minNDepth Minimum depth in normal to keep the position [5]
21+
--maxNDepth Maximum depth in normal to keep the position [500]
22+
--pre_cval Pre-processing critical value [80]
23+
--cval Critical value for estimating diploid log Ratio [200]
3824
--min_nhet Minimum number of heterozygote snps in a segment used for bivariate t-statistic during clustering of segment [25]
3925
--unmatched Is it unmatched? [FALSE]
4026
--minGC Min GC of position [0]
@@ -43,41 +29,24 @@ Optional arguments:
4329

4430
## Output
4531
```
46-
./facets_out/snp_pileup .................. pileup files for every sample.
47-
{tumor_id}__{normal_id}__q{params.q}_Q{params.Q}_d{params.maxNDepth}_r{params.r}.bc.gz
48-
49-
50-
51-
./facets_out/cval1{params.cval1} .......... FACETS results for every sample.
52-
{tumor_id}__{normal_id}.cncf.pdf ...... genome-wide profile. Figures:
53-
log-ratio: logR with chromosomes alternating in blue and gray. The green line indicates the median logR in the sample. The purple line indicates the logR of the diploid state.
54-
log-odds-ratio: Segment means are ploted in red lines.
55-
copy number (em): plots the total (black) and minor (red) copy number for each segment.
56-
cf-em: shows the associated cellular fraction (cf). Dark blue indicates high cf. Light blue indicates low cf. Beige indicates a normal segment (total=2,minor=1).
57-
{tumor_id}__{normal_id}.cncf.txt ...... FACETS result table. The columns are:
58-
chrom: the chromosome to which the segment belongs.seg: the segment number.
59-
num.mark: the number of SNPs in the segment.
60-
nhet: the number of SNPs that are deemed heterozygous.
61-
cnlr.median: the median log-ratio of the segment.
62-
mafR: the log-odds-ratio summary for the segment (close to zero means the alleles are in balance).
63-
segclust: the segment cluster to which segment belongs.
64-
cnlr.median.clust: the median log-ratio of the segment cluster.
65-
mafR.clust: the log-odds-ratio summary for the segment cluster.
66-
cf.em: the cellular fraction of the segment.
67-
tcn.em: the total copy number of the segment.
68-
lcn.em: the minor copy number of the segment.
69-
{tumor_id}__{normal_id}.logR.pdf ...... genome-wide profile log-ratio only.
70-
{tumor_id}__{normal_id}.out ........... result summary file and log
71-
{tumor_id}__{normal_id}.Rdata ......... FACETS R session
32+
.cncf.pdf ...... genome-wide profile. Figures:
33+
log-ratio: logR with chromosomes alternating in blue and gray. The green line indicates the median logR in the sample. The purple line indicates the logR of the diploid state.
34+
log-odds-ratio: Segment means are ploted in red lines.
35+
copy number (em): plots the total (black) and minor (red) copy number for each segment.
36+
cf-em: shows the associated cellular fraction (cf). Dark blue indicates high cf. Light blue indicates low cf. Beige indicates a normal segment (total=2,minor=1).
37+
.cncf.txt ...... FACETS result table. The columns are:
38+
chrom: the chromosome to which the segment belongs.seg: the segment number.
39+
num.mark: the number of SNPs in the segment.
40+
nhet: the number of SNPs that are deemed heterozygous.
41+
cnlr.median: the median log-ratio of the segment.
42+
mafR: the log-odds-ratio summary for the segment (close to zero means the alleles are in balance).
43+
segclust: the segment cluster to which segment belongs.
44+
cnlr.median.clust: the median log-ratio of the segment cluster.
45+
mafR.clust: the log-odds-ratio summary for the segment cluster.
46+
cf.em: the cellular fraction of the segment.
47+
tcn.em: the total copy number of the segment.
48+
lcn.em: the minor copy number of the segment.
49+
.out ........... result summary file and log
50+
.Rdata ......... FACETS R session
7251
7352
```
74-
75-
## Fetching the singularity container
76-
```
77-
bash scripts/fetch_image.sh
78-
```
79-
80-
## Fetching resource files
81-
```
82-
bash scripts/fetch_resources.sh
83-
```

facets/main.nf

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ params.publish_dir = "" // set to empty string will disable publishDir
4949
params.help = null
5050

5151
// tool specific parmas go here, add / change as needed
52-
params.tumor_id = null
52+
params.out_prefix = null
5353
params.pileup = null
5454
params.genome = 'hg38'
5555
params.snp_nbhd = 500
@@ -74,8 +74,8 @@ The typical command for running the pipeline is as follows:
7474
nextflow run facets/main.nf --pileup <snp-pileup.bc.gz>
7575
7676
Mandatory arguments:
77-
--tumor_id Tumor ID
7877
--pileup Pileup file produced by snp-pileup (.bc.gz)
78+
--out_prefix Output prefix
7979
8080
Optional arguments:
8181
--genome Genome build (b37, GRCh37, hg19, mm9, mm10, GRCm38, hg38). [${params.genome}]
@@ -94,18 +94,16 @@ Optional arguments:
9494

9595
if (params.help) exit 0, helpMessage()
9696

97+
// Validate inputs
98+
if(params.out_prefix == null) error "Missing mandatory '--out_prefix' parameter"
99+
97100
log.info ""
98-
log.info "tumor_id=${params.tumor_id}"
101+
log.info "pileup=${params.out_prefix}"
99102
log.info "pileup=${params.pileup}"
100103
log.info "genome=${params.genome}"
101104
log.info ""
102105

103106

104-
// Validate inputs
105-
if(params.tumor_id == null) error "Missing mandatory '--tumor_id' parameter"
106-
if(params.pileup == null) error "Missing mandatory '--pileup' parameter"
107-
108-
109107
process facets {
110108
container "${params.container ?: container[params.container_registry ?: default_container_registry]}:${params.container_version ?: version}"
111109
publishDir "${params.publish_dir}/${task.process.replaceAll(':', '_')}", mode: "copy", enabled: params.publish_dir
@@ -124,10 +122,10 @@ process facets {
124122
shell:
125123
'''
126124
#run facets
127-
facetsRun.R --seed !{params.seed} --minNDepth !{params.minNDepth} --maxNDepth !{params.maxNDepth} --snp_nbhd !{params.snp_nbhd} --minGC !{params.minGC} --maxGC !{params.maxGC} --cval !{params.cval} --pre_cval !{params.pre_cval} --genome !{params.genome} --min_nhet !{params.min_nhet} --outPrefix !{params.tumor_id} --tumorName !{params.tumor_id} !{pileup}
125+
facetsRun.R --seed !{params.seed} --minNDepth !{params.minNDepth} --maxNDepth !{params.maxNDepth} --snp_nbhd !{params.snp_nbhd} --minGC !{params.minGC} --maxGC !{params.maxGC} --cval !{params.cval} --pre_cval !{params.pre_cval} --genome !{params.genome} --min_nhet !{params.min_nhet} --outPrefix !{params.out_prefix} --tumorName !{params.out_prefix} !{pileup}
128126
129127
#fetch results (cncf and plot can be missing from facets results, but if produced both will be available)
130-
facetsResults.sh -s !{params.tumor_id}.out $(if [[ -f !{params.tumor_id}.cncf.txt && -f !{params.tumor_id}.cncf.pdf ]]; then echo -c !{params.tumor_id}.cncf.txt -p !{params.tumor_id}.cncf.pdf; fi)
128+
facetsResults.sh -s !{params.out_prefix}.out $(if [[ -f !{params.out_prefix}.cncf.txt && -f !{params.out_prefix}.cncf.pdf ]]; then echo -c !{params.out_prefix}.cncf.txt -p !{params.out_prefix}.cncf.pdf; fi)
131129
'''
132130
}
133131

facets/tests/checker.nf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ params.container_version = ""
4848
params.container = ""
4949

5050
// tool specific parmas go here, add / change as needed
51-
params.tumor_id = ""
51+
params.out_prefix = ""
5252
params.pileup = ""
5353
params.genome = ""
5454
params.expected_output = ""
@@ -78,7 +78,7 @@ process file_smart_diff {
7878
workflow checker {
7979
take:
8080
pileup
81-
tumor_id
81+
out_prefix
8282
genome
8383
expected_output
8484

@@ -97,7 +97,7 @@ workflow checker {
9797
workflow {
9898
checker(
9999
file(params.pileup),
100-
params.tumor_id,
100+
params.out_prefix,
101101
params.genome,
102102
file(params.expected_output)
103103
)

facets/tests/test-job-1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"pileup": "input/test.bc.gz",
3-
"tumor_id": "test",
3+
"out_prefix": "test",
44
"genome": "hg19",
55
"expected_output": "expected/expected.out",
66
"publish_dir": "outdir",

0 commit comments

Comments
 (0)