Skip to content

Commit

Permalink
Merge pull request #55 from vyepez88/code_cleaning
Browse files Browse the repository at this point in the history
Code cleaning
  • Loading branch information
vyepez88 committed May 29, 2020
2 parents 5453a69 + fae95af commit f15dd9c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ before_script:
- cd $PROJECT_DIR
- drop demo

script:
- cd $PROJECT_DIR
- snakemake -n
- snakemake aberrantExpression --cores 2
script: true
# - cd $PROJECT_DIR
# - snakemake -n
# - snakemake aberrantExpression --cores 2
# - snakemake aberrantSplicing --cores 2
- snakemake mae --cores 2
- snakemake --cores 2
# - snakemake mae --cores 2
# - snakemake --cores 2
2 changes: 1 addition & 1 deletion drop/modules/aberrant-expression-pipeline
2 changes: 1 addition & 1 deletion drop/modules/aberrant-splicing-pipeline
20 changes: 19 additions & 1 deletion drop/template/Scripts/Pipeline/SampleAnnotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,23 @@ if(!is.null(sa$HPO_TERMS)){
na = NA, sep = "\t", row.names = F, quote = F)
}

file.create(snakemake@output$done) %>% invisible
if(snakemake@config$exportCounts == TRUE){
sa[, DROP_GROUP := gsub(' ', '', DROP_GROUP)]
if(!is.null(sa$SEX)) sa[, SEX := tolower(SEX)]

list_groups <- strsplit(sa$DROP_GROUP, split = ',')
drop_groups <- list_groups %>% unlist %>% unique

for(dataset in drop_groups){
path <- file.path(snakemake@config$root, 'processed_data/exported_counts', dataset)
dir.create(path)
cols <- intersect(colnames(sa),
c('RNA_ID', 'DNA_ID', 'PATIENT_ID', 'PAIRED_END', 'STRAND',
'TISSUE', 'SEX', 'AFFECTED', 'ICD_10'))
fwrite(sa[sapply(list_groups, function(x) dataset %in% x), cols, with = F],
file = file.path(path, paste0('sampleAnnotation_', dataset, '.tsv')),
quote = FALSE, row.names = FALSE, sep = '\t')
}
}

file.create(snakemake@output$done) %>% invisible
1 change: 1 addition & 0 deletions drop/template/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ geneAnnotation:

genomeAssembly: hg19 # either hg19 or hg38
scanBamParam: null # or a path to an Rds file containing a scanBamParam object
exportCounts: false

aberrantExpression:
groups:
Expand Down

0 comments on commit f15dd9c

Please sign in to comment.