Skip to content

Commit

Permalink
Merge branch 'feature/make_cff' of github.com:mskcc/forte into featur…
Browse files Browse the repository at this point in the history
…e/make_cff
  • Loading branch information
pintoa1-mskcc committed Aug 14, 2023
2 parents 694f369 + 301b395 commit f81c807
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
12 changes: 9 additions & 3 deletions bin/add_annotations_cff.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ usage <- function() {
args = commandArgs(TRUE)

if (is.null(args) | length(args)<1) {
usage()
usage()
quit()
}

Expand Down Expand Up @@ -58,9 +58,12 @@ cff_file = args_opt$cff
out_prefix = args_opt$out_prefix

cff = fread(cff_file)
final_cff_cols <- c(names(cff))
agfusion_tab = fread(agfusion_file) %>% select(c(`5'_transcript`,`3'_transcript`,`5'_breakpoint`,`3'_breakpoint`,Fusion_effect))
final_cff_cols <- c(final_cff_cols,"Fusion_effect")
if (!is.null(oncokb_file)){
oncokb_tab = fread(oncokb_file) %>% select(-Fusion)
final_cff_cols = c(final_cff_cols,names(oncokb_tab %>% select(-Tumor_Sample_Barcode)))
cff <- merge(
cff,
oncokb_tab,
Expand All @@ -71,7 +74,6 @@ if (!is.null(oncokb_file)){
)
}


cff <- merge(
cff,
agfusion_tab,
Expand All @@ -81,11 +83,15 @@ cff <- merge(
all.y = T
)

cff <- as.data.frame(cff)[,c(final_cff_cols)]
#cff <- cff %>% mutate(!!final_cff_cols[34] := Fusion_effect) %>% select(-c(Fusion_effect))

write.table(
cff,
paste0(out_prefix, ".cff"),
row.names = F,
quote = F,
sep = "\t"
sep = "\t",
col.names = ! "V1" %in% final_cff_cols
)

2 changes: 1 addition & 1 deletion conf/igenomes.config
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ params {
arriba_blacklist = "/usr/local/var/lib/arriba/blacklist_hg19_hs37d5_GRCh37_v2.3.0.tsv.gz"
arriba_known_fusions = "/usr/local/var/lib/arriba/known_fusions_hg19_hs37d5_GRCh37_v2.3.0.tsv.gz"
arriba_protein_domains = "/usr/local/var/lib/arriba/protein_domains_hg19_hs37d5_GRCh37_v2.3.0.gff3"
cdna = "https://ftp.ensembl.org/pub/release-75/fasta/homo_sapiens/cdna/Homo_sapiens.GRCh37.75.cdna.all.fa.gz"
cdna = "http://ftp.ensemblgenomes.org/pub/viruses/fasta/sars_cov_2/cdna/Sars_cov_2.ASM985889v3.cdna.all.fa.gz"
metafusion_blocklist = "https://raw.githubusercontent.com/anoronh4/forte-references/main/GRCh37_test/blocklist_breakpoints.bedpe"
metafusion_gene_bed = "https://raw.githubusercontent.com/anoronh4/forte-references/main/GRCh37_test/v75_gene.bed"
metafusion_gene_info = "https://raw.githubusercontent.com/anoronh4/forte-references/main/GRCh37_test/gene_info_20230714.txt"
Expand Down
16 changes: 16 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,22 @@ process {
ext.when = params.run_oncokb_fusionannotator
secret = ["ONCOKB_TOKEN"]
ext.args = "-b \$ONCOKB_TOKEN"
publishDir = [
path: { "${params.outdir}/analysis/${meta.id}/oncokb" },
mode: params.publish_dir_mode,
pattern: '*.oncokb.tsv',
enabled: false
]
}

withName: CFF_FINALIZE {
ext.prefix = { "${meta.id}.final" }
publishDir = [
path: { "${params.outdir}/analysis/${meta.id}/metafusion" },
mode: params.publish_dir_mode,
pattern: '*.final.cff',
enabled: true
]
}

withName: STAR_FOR_ARRIBA {
Expand Down
4 changes: 4 additions & 0 deletions tests/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ process {
cpus = 2
memory = 3.GB
time = 2.h

withName: '.*_TO_CFF|GUNZIP_METAFUSION.*|AGFUSION.*' {
ext.when = { ! (workflow.profile.toString().split(",").contains(["singularity"]) && workflow.profile.toString().split(",").contains(["test"])) }
}
}

if ("$PROFILE" == "singularity") {
Expand Down

0 comments on commit f81c807

Please sign in to comment.