Al-Murphy / MungeSumstats

Rapid standardisation and quality control of GWAS or QTL summary statistics
https://doi.org/doi:10.18129/B9.bioc.MungeSumstats
75 stars 16 forks source link

Account for sitations where there's a mismatch between write_vcf and save_path #34

Closed bschilder closed 3 years ago

bschilder commented 3 years ago

Now in check_save_path:

if(write_vcf){ 
        save_path <- gsub(paste(suffixes,collapse = "|"),".vcf.gz", save_path)
        sep = "\t"
        file_type = "vcf"
    } else {
       #### Account for mismatch between write_vcf and save_path ####
        suffixes.vcf <- supported_suffixes(tabular = FALSE, tabular_compressed = FALSE)
        if(any(endsWith(save_path,suffixes.vcf))){
            message("`write_vcf=FALSE` but `save_path` suggests VCF output format. ",
                    "Switching output to tabular format (.tsv.gz).")
            save_path <- gsub(paste(suffixes.vcf,collapse = "|"),".tsv.gz", save_path)
            sep = "\t"
            file_type = ".tsv"
        } 
    }