Skip to content

Commit

Permalink
haplotypes_phase needs to be set to NULL if not initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcvicker committed Sep 13, 2018
1 parent 3f6a327 commit de82c31
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions snp2h5/snp2h5.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,14 +1169,16 @@ void parse_vcf(Arguments *args, Chromosome *all_chroms, int n_chrom,
vcf->sample_names, vcf->n_sample);
sample_tab_free(samp_tab);

/* initialize the phase matrix */
haplotypes_phase = my_malloc(vcf->n_sample * sizeof(char));
init_h5matrix(&haplotype_phase_info, haplotype_info->n_row,
vcf->n_sample,
HAPLOTYPE_DATATYPE, util_str_concat("phase_", chrom->name, NULL));
/* initialize the phase matrix */
haplotypes_phase = my_malloc(vcf->n_sample * sizeof(char));
init_h5matrix(&haplotype_phase_info, haplotype_info->n_row,
vcf->n_sample,
HAPLOTYPE_DATATYPE,
util_str_concat("phase_", chrom->name, NULL));
}
} else {
haplotypes = NULL;
haplotypes_phase = NULL;
}
if(args->snp_index_file) {
/* SNP index vector is same length as chromosome,
Expand Down

0 comments on commit de82c31

Please sign in to comment.