bin/snp-search in snp-search-0.23.0 vs bin/snp-search in snp-search-0.26.0

- old
+ new

@@ -20,21 +20,29 @@ puts help end end opts.parse - puts "You must supply the -n option, it's a required field" and exit unless opts[:name] - puts "You must supply the -r option, it's a required field" and exit unless opts[:reference_file] - puts "You must supply the -v option, it's a required field" and exit unless opts[:vcf_file] + error_msg = "" + + error_msg += "You must supply the -n option, it's a required field\n" unless opts[:name] + error_msg += "You must supply the -r option, it's a required field\n" unless opts[:reference_file] + error_msg += "You must supply the -v option, it's a required field" unless opts[:vcf_file] + + unless error_msg == "" + puts error_msg + puts opts.help unless opts.empty? + exit + end begin - puts "#{opts[:reference_file]} file does not exist!" and exit unless File.exist?(opts[:reference_file]) + abort "#{opts[:reference_file]} file does not exist!" unless File.exist?(opts[:reference_file]) rescue end begin - puts "#{opts[:vcf_file]} file does not exist!" and exit unless File.exist?(opts[:vcf_file]) + abort "#{opts[:vcf_file]} file does not exist!" unless File.exist?(opts[:vcf_file]) rescue end begin # Enter the name of your database @@ -60,10 +68,10 @@ # path for vcf file here vcf_mpileup_file = opts[:vcf_file] # The populate_features_and_annotations method populates the features and annotations. It uses the embl/gbk file. -populate_features_and_annotations(sequence_flatfile) +# populate_features_and_annotations(sequence_flatfile) #The populate_snps_alleles_genotypes method populates the snps, alleles and genotypes. It uses the vcf file, and if specified, the SNP quality cutoff and genotype quality cutoff populate_snps_alleles_genotypes(vcf_mpileup_file, opts[:cuttoff_snp].to_i, opts[:cuttoff_genotype].to_i) rescue