From 4588a7b5934febbd23aa60ce3eeef926a4496af8 Mon Sep 17 00:00:00 2001 From: Adrian Tan Date: Mon, 8 Jun 2015 16:26:29 -0400 Subject: [PATCH] updated alternative header reading mechanism to only work for VCF files --- hts_utils.cpp | 4 +++- hts_utils.h | 1 + main.cpp | 4 ++++ paste.cpp | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hts_utils.cpp b/hts_utils.cpp index d302ed07..736f45a9 100644 --- a/hts_utils.cpp +++ b/hts_utils.cpp @@ -441,6 +441,7 @@ void bcf_print_lite_sorted(bcf_hdr_t *h, bcf1_t *v) * allow for an alternative header file to be read in. * * this searches for the alternative header saved as .hdr + * If the VCF files is BCF, any alternative header is ignored. */ bcf_hdr_t *bcf_alt_hdr_read(htsFile *fp) { @@ -451,7 +452,8 @@ bcf_hdr_t *bcf_alt_hdr_read(htsFile *fp) kputs(fp->fn, &alt_hdr_fn); kputs(".hdr", &alt_hdr_fn); FILE *file = fopen(alt_hdr_fn.s, "r"); - if (!file) + + if (fp->format.format ==bcf || !file) { h = bcf_hdr_read(fp); } diff --git a/hts_utils.h b/hts_utils.h index 23bc8f13..f2f245c0 100644 --- a/hts_utils.h +++ b/hts_utils.h @@ -254,6 +254,7 @@ int32_t bcf_hdr_get_n_sample(bcf_hdr_t *h); * allow for an alternative header file to be read in. * * this searches for the alternative header saved as .hdr + * If the VCF files is BCF, any alternative header is ignored. */ bcf_hdr_t *bcf_alt_hdr_read(htsFile *fp); diff --git a/main.cpp b/main.cpp index 6b841e9f..a5935a67 100644 --- a/main.cpp +++ b/main.cpp @@ -102,6 +102,7 @@ void help() std::clog << "view view vcf/vcf.gz/bcf files\n"; std::clog << "index index vcf.gz/bcf files\n"; std::clog << "normalize normalize variants\n"; + std::clog << "decompose decompose variants\n"; std::clog << "uniq drop duplicate variants\n"; std::clog << "cat concatenate VCF files\n"; std::clog << "paste paste VCF files\n"; @@ -110,7 +111,10 @@ void help() std::clog << "\n"; std::clog << "peek summary of variants in the vcf file\n"; std::clog << "partition partition variants\n"; + std::clog << "multi_partition partition variants from multiple VCF files\n"; std::clog << "annotate_variants annotate variants\n"; + std::clog << "annotate_db_rsid annotate variants with dbSNP rsid\n"; + std::clog << "annotate_1000g annotate variants with 1000 Genomes variants\n"; std::clog << "annotate_regions annotate regions\n"; std::clog << "compute_concordance compute genotype concordance between 2 call sets\n"; std::clog << "compute_features compute genotype likelihood based statistics\n"; diff --git a/paste.cpp b/paste.cpp index 6e9b8547..edb25d41 100644 --- a/paste.cpp +++ b/paste.cpp @@ -66,11 +66,12 @@ class Igor : Program try { std::string desc = "Pastes VCF files like the unix paste functions.\n" + " This is used after the per sample genotyping step in vt.\n" " Input requirements and assumptions:\n" " 1. Same variants are represented in the same order for each file (required)\n" " 2. Genotype fields are the same for corresponding records (required)\n" " 3. Sample names are different in all the files (warning will be given if not)\n" - " 4. Headers are the same for all the files (assumption, not checked, will fail if output is BCF)\n" + " 4. Headers (not including the samples) are the same for all the files (unchecked assumption, will fail if output is BCF)\n" " Outputs:\n" " 1. INFO fields output will be that of the first file\n" " 2. Genotype fields are the same for corresponding records\n";