Skip to content

Commit

Permalink
Fixed problem with MacOSX 10.7 compatible compile where INFs in polym…
Browse files Browse the repository at this point in the history
…orphism mode prevented predictions
  • Loading branch information
jeffreybarrick committed Nov 12, 2016
1 parent 00f27d3 commit 90766db
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
4 changes: 3 additions & 1 deletion binarydist.sh
Expand Up @@ -16,7 +16,9 @@ BINARYDIR=${PWD}/${BINARYLOCALDIR}
rm -r ${BINARYDIR} ${BINARYDIR}.tgz
./configure CFLAGS="${MYCFLAGS}" CXXFLAGS="${MYCFLAGS}" LDFLAGS="${MYCFLAGS}" --prefix="${BINARYDIR}"
make clean
make -j 6 install
make -j 6
make test
make install

#Documentation and information
if [ "$BINARYPLATFORM" == "Darwin" ]; then
Expand Down
8 changes: 4 additions & 4 deletions src/c/breseq/identify_mutations.cpp
Expand Up @@ -269,8 +269,8 @@ bool test_RA_evidence_CONSENSUS_mode(
// Decide if we are a polymorphism (or mixed base) prediction or a consensus prediction
ePredictionType prediction(unknown);

double consensus_score = from_string<double>(ra[CONSENSUS_SCORE]);
double polymorphism_score = (ra[POLYMORPHISM_SCORE]=="NA") ? numeric_limits<double>::quiet_NaN() : from_string<double>(ra[POLYMORPHISM_SCORE]);
double consensus_score = double_from_string(ra[CONSENSUS_SCORE]);
double polymorphism_score = double_from_string(ra[POLYMORPHISM_SCORE]);
double variant_frequency = from_string<double>(ra[POLYMORPHISM_FREQUENCY]);

// Score must be below one of the thresholds
Expand Down Expand Up @@ -346,8 +346,8 @@ bool test_RA_evidence_POLYMORPHISM_mode(
// Decide if we are a polymorphism (or mixed base) prediction or a consensus prediction
ePredictionType prediction(unknown);

double consensus_score = from_string<double>(ra[CONSENSUS_SCORE]);
double polymorphism_score = (ra[POLYMORPHISM_SCORE]=="NA") ? numeric_limits<double>::quiet_NaN() : from_string<double>(ra[POLYMORPHISM_SCORE]);
double consensus_score = double_from_string(ra[CONSENSUS_SCORE]);
double polymorphism_score = double_from_string(ra[POLYMORPHISM_SCORE]);
double variant_frequency = from_string<double>(ra[POLYMORPHISM_FREQUENCY]);

// Set up polymorphism as default
Expand Down
8 changes: 7 additions & 1 deletion src/c/breseq/libbreseq/common.h
Expand Up @@ -735,14 +735,20 @@ namespace breseq {
return "\"" + input + "\"";
}

//! special handling of NA and INF, compatible with C++ limits and R representations
// Special handling of NA and INF values in doubles
// Used in
// compatible with C++ limits and R representations
// Using this function prevents some incompatibilities
// In different compilers (MacOS 10.7 compilation, for example)
inline double double_from_string(const string& input)
{
string compare_string = to_upper(input);
if ((compare_string == "NA") || (compare_string == "#NA") || (compare_string == "NAN"))
return numeric_limits<double>::quiet_NaN();
if (compare_string == "INF")
return numeric_limits<double>::infinity();
if (compare_string == "-INF")
return -numeric_limits<double>::infinity();

return from_string<double>(input);
}
Expand Down
16 changes: 8 additions & 8 deletions tests/REL606_fragment_advanced_mobile_element/expected.gd
@@ -1,23 +1,23 @@
#=GENOME_DIFF 1.0
MOB 1 36,37 REL606-5 1000 IS1 -1 3 gene_name=dkgB gene_position=coding (400-402/804 nt) gene_product=2,5-diketo-D-gluconate reductase B gene_strand=> genes_inactivated=dkgB html_gene_name=<i>dkgB</i>&nbsp;&rarr; locus_tag=ECB_00200 locus_tags_inactivated=ECB_00200 mutation_category=mobile_element_insertion repeat_size=768
MOB 2 38,39 REL606-5 2000 IS1 1 7 gene_name=yafC gene_position=coding (310-316/915 nt) gene_product=predicted DNA-binding transcriptional regulator gene_strand=< genes_inactivated=yafC html_gene_name=<i>yafC</i>&nbsp;&larr; locus_tag=ECB_00201 locus_tags_inactivated=ECB_00201 mutation_category=mobile_element_insertion repeat_size=768
MOB 3 25,40,41 REL606-5 3000 IS1 -1 -3 gene_name=yafD gene_position=coding (445/801 nt) gene_product=hypothetical protein gene_strand=> genes_inactivated=yafD html_gene_name=<i>yafD</i>&nbsp;&rarr; locus_tag=ECB_00202 locus_tags_inactivated=ECB_00202 mutation_category=mobile_element_insertion repeat_size=768
MOB 4 26,42,43 REL606-5 4000 IS1 1 -7 gene_name=yafE/mltD gene_position=intergenic (+17/+31) gene_product=predicted S-adenosyl-L-methionine-dependent methyltransferase/predicted membrane-bound lytic murein transglycosylase D genes_promoter=mltD html_gene_name=<i>yafE</i>&nbsp;&rarr;&nbsp;/&nbsp;&larr;&nbsp;<i>mltD</i> locus_tag=ECB_00203/ECB_00204 locus_tags_promoter=ECB_00204 mutation_category=mobile_element_insertion repeat_size=768
MOB 3 25,40,41 REL606-5 3000 IS1 -1 -3 gene_name=yafD gene_position=coding (445-447/801 nt) gene_product=hypothetical protein gene_strand=> genes_inactivated=yafD html_gene_name=<i>yafD</i>&nbsp;&rarr; locus_tag=ECB_00202 locus_tags_inactivated=ECB_00202 mutation_category=mobile_element_insertion repeat_size=768
MOB 4 26,42,43 REL606-5 4000 IS1 1 -7 gene_name=yafE/mltD gene_position=intergenic (+17/+25) gene_product=predicted S-adenosyl-L-methionine-dependent methyltransferase/predicted membrane-bound lytic murein transglycosylase D genes_promoter=mltD html_gene_name=<i>yafE</i>&nbsp;&rarr;&nbsp;/&nbsp;&larr;&nbsp;<i>mltD</i> locus_tag=ECB_00203/ECB_00204 locus_tags_promoter=ECB_00204 mutation_category=mobile_element_insertion repeat_size=768
MOB 5 44,45 REL606-5 5000 IS1 -1 6 del_start=3 gene_name=mltD gene_position=coding (385-390/1359 nt) gene_product=predicted membrane-bound lytic murein transglycosylase D gene_strand=< genes_inactivated=mltD html_gene_name=<i>mltD</i>&nbsp;&larr; locus_tag=ECB_00204 locus_tags_inactivated=ECB_00204 mutation_category=mobile_element_insertion repeat_size=768
MOB 6 46,47 REL606-5 6000 IS1 1 4 gene_name=gloB gene_position=coding (214-217/756 nt) gene_product=predicted hydroxyacylglutathione hydrolase gene_strand=< genes_inactivated=gloB html_gene_name=<i>gloB</i>&nbsp;&larr; ins_end=TG locus_tag=ECB_00205 locus_tags_inactivated=ECB_00205 mutation_category=mobile_element_insertion repeat_size=768
MOB 7 48,49 REL606-5 7000 IS1 -1 3 del_end=3 gene_name=rnhA gene_position=coding (435-437/468 nt) gene_product=ribonuclease H gene_strand=< genes_overlapping=rnhA html_gene_name=<i>rnhA</i>&nbsp;&larr; ins_end=CTT locus_tag=ECB_00207 locus_tags_overlapping=ECB_00207 mutation_category=mobile_element_insertion repeat_size=768
MOB 8 50,51 REL606-5 8000 IS1 1 3 gene_name=dnaQ gene_position=coding (500-502/732 nt) gene_product=DNA polymerase III subunit epsilon gene_strand=> genes_inactivated=dnaQ html_gene_name=<i>dnaQ</i>&nbsp;&rarr; ins_start=ATGGC locus_tag=ECB_00208 locus_tags_inactivated=ECB_00208 mutation_category=mobile_element_insertion repeat_size=768
MOB 9 27,57,63 REL606-5 15000 IS1 -1 -3 del_end=3 del_start=1 gene_name=fadE gene_position=coding (1385/2445 nt) gene_product=acyl-CoA dehydrogenase gene_strand=< genes_inactivated=fadE html_gene_name=<i>fadE</i>&nbsp;&larr; ins_end=TA ins_start=T locus_tag=ECB_00216 locus_tags_inactivated=ECB_00216 mutation_category=mobile_element_insertion repeat_size=768
MOB 10 28,56,61 REL606-5 16000 IS1 1 -7 del_end=2 del_start=2 gene_name=fadE gene_position=coding (385/2445 nt) gene_product=acyl-CoA dehydrogenase gene_strand=< genes_inactivated=fadE html_gene_name=<i>fadE</i>&nbsp;&larr; ins_end=GC ins_start=ATGGC locus_tag=ECB_00216 locus_tags_inactivated=ECB_00216 mutation_category=mobile_element_insertion repeat_size=768
MOB 11 29,55,60 REL606-5 17000 IS1 -1 -3 del_end=1 del_start=3 gene_name=lpcA gene_position=coding (377/579 nt) gene_product=phosphoheptose isomerase gene_strand=> genes_inactivated=lpcA html_gene_name=<i>lpcA</i>&nbsp;&rarr; ins_end=GGC ins_start=TGTA locus_tag=ECB_00217 locus_tags_inactivated=ECB_00217 mutation_category=mobile_element_insertion repeat_size=768
MOB 12 30,58,59 REL606-5 18000 IS1 1 -7 del_end=10 del_start=5 gene_name=yafJ gene_position=coding (593/768 nt) gene_product=predicted amidotransfease gene_strand=> genes_inactivated=yafJ html_gene_name=<i>yafJ</i>&nbsp;&rarr; ins_end=CA ins_start=G locus_tag=ECB_00218 locus_tags_inactivated=ECB_00218 mutation_category=mobile_element_insertion repeat_size=768
MOB 9 27,57,63 REL606-5 15000 IS1 -1 -3 del_end=3 del_start=1 gene_name=fadE gene_position=coding (1383-1385/2445 nt) gene_product=acyl-CoA dehydrogenase gene_strand=< genes_inactivated=fadE html_gene_name=<i>fadE</i>&nbsp;&larr; ins_end=TA ins_start=T locus_tag=ECB_00216 locus_tags_inactivated=ECB_00216 mutation_category=mobile_element_insertion repeat_size=768
MOB 10 28,56,61 REL606-5 16000 IS1 1 -7 del_end=2 del_start=2 gene_name=fadE gene_position=coding (379-385/2445 nt) gene_product=acyl-CoA dehydrogenase gene_strand=< genes_inactivated=fadE html_gene_name=<i>fadE</i>&nbsp;&larr; ins_end=GC ins_start=ATGGC locus_tag=ECB_00216 locus_tags_inactivated=ECB_00216 mutation_category=mobile_element_insertion repeat_size=768
MOB 11 29,55,60 REL606-5 17000 IS1 -1 -3 del_end=1 del_start=3 gene_name=lpcA gene_position=coding (377-379/579 nt) gene_product=phosphoheptose isomerase gene_strand=> genes_inactivated=lpcA html_gene_name=<i>lpcA</i>&nbsp;&rarr; ins_end=GGC ins_start=TGTA locus_tag=ECB_00217 locus_tags_inactivated=ECB_00217 mutation_category=mobile_element_insertion repeat_size=768
MOB 12 30,58,59 REL606-5 18000 IS1 1 -7 del_end=10 del_start=5 gene_name=yafJ gene_position=coding (593-599/768 nt) gene_product=predicted amidotransfease gene_strand=> genes_inactivated=yafJ html_gene_name=<i>yafJ</i>&nbsp;&rarr; ins_end=CA ins_start=G locus_tag=ECB_00218 locus_tags_inactivated=ECB_00218 mutation_category=mobile_element_insertion repeat_size=768
MOB 13 66,67 REL606-5 21000 IS1 -1 0 gene_name=yafM gene_position=coding (283/498 nt) gene_product=hypothetical protein gene_strand=> genes_inactivated=yafM html_gene_name=<i>yafM</i>&nbsp;&rarr; locus_tag=ECB_00223 locus_tags_inactivated=ECB_00223 mutation_category=mobile_element_insertion repeat_size=768
MOB 14 68,69 REL606-5 22000 IS1 1 1 gene_name=fhiA gene_position=pseudogene (1141/1710 nt) gene_product=b0229; flagellar system protein gene_strand=< html_gene_name=<i>fhiA</i>&nbsp;&larr; locus_tag=ECB_00224 mutation_category=mobile_element_insertion repeat_size=768
MOB 15 31,52,70 REL606-5 23000 IS1 -1 -1 gene_name=fhiA gene_position=pseudogene (141/1710 nt) gene_product=b0229; flagellar system protein gene_strand=< html_gene_name=<i>fhiA</i>&nbsp;&larr; locus_tag=ECB_00224 mutation_category=mobile_element_insertion repeat_size=768
MOB 16 32,53,71 REL606-5 24000 IS1 1 -2 gene_name=dinB gene_position=coding (30/1056 nt) gene_product=DNA polymerase IV gene_strand=> genes_inactivated=dinB html_gene_name=<i>dinB</i>&nbsp;&rarr; locus_tag=ECB_00226 locus_tags_inactivated=ECB_00226 mutation_category=mobile_element_insertion repeat_size=768
MOB 16 32,53,71 REL606-5 24000 IS1 1 -2 gene_name=dinB gene_position=coding (30-31/1056 nt) gene_product=DNA polymerase IV gene_strand=> genes_inactivated=dinB html_gene_name=<i>dinB</i>&nbsp;&rarr; locus_tag=ECB_00226 locus_tags_inactivated=ECB_00226 mutation_category=mobile_element_insertion repeat_size=768
MOB 17 72,73 REL606-5 25000 IS1 1 5 del_start=3 gene_name=dinB gene_position=coding (1030-1034/1056 nt) gene_product=DNA polymerase IV gene_strand=> genes_overlapping=dinB html_gene_name=<i>dinB</i>&nbsp;&rarr; locus_tag=ECB_00226 locus_tags_overlapping=ECB_00226 mutation_category=mobile_element_insertion repeat_size=768
MOB 18 64,74 REL606-5 26000 IS1 -1 2 gene_name=yafP gene_position=coding (219-220/453 nt) gene_product=predicted acyltransferase with acyl-CoA N-acyltransferase domain gene_strand=> genes_inactivated=yafP html_gene_name=<i>yafP</i>&nbsp;&rarr; ins_end=AC locus_tag=ECB_00229 locus_tags_inactivated=ECB_00229 mutation_category=mobile_element_insertion repeat_size=768
MOB 19 33,54,75 REL606-5 27000 IS1 1 -3 del_end=6 gene_name=prfH gene_position=coding (298/501 nt) gene_product=peptide chain release factor 2 gene_strand=> genes_inactivated=prfH html_gene_name=<i>prfH</i>&nbsp;&rarr; locus_tag=ECB_00231 locus_tags_inactivated=ECB_00231 mutation_category=mobile_element_insertion repeat_size=768
MOB 19 33,54,75 REL606-5 27000 IS1 1 -3 del_end=6 gene_name=prfH gene_position=coding (298-300/501 nt) gene_product=peptide chain release factor 2 gene_strand=> genes_inactivated=prfH html_gene_name=<i>prfH</i>&nbsp;&rarr; locus_tag=ECB_00231 locus_tags_inactivated=ECB_00231 mutation_category=mobile_element_insertion repeat_size=768
MOB 20 34,65,76 REL606-5 28000 IS1 -1 -1 gene_name=pepD gene_position=coding (718/1458 nt) gene_product=aminoacyl-histidine dipeptidase (peptidase D) gene_strand=< genes_inactivated=pepD html_gene_name=<i>pepD</i>&nbsp;&larr; ins_start=AGGC locus_tag=ECB_00232 locus_tags_inactivated=ECB_00232 mutation_category=mobile_element_insertion repeat_size=768
MOB 21 79,83 REL606-5 35000 IS1 -1 0 del_end=3 del_start=1 gene_name=proA gene_position=coding (496/1254 nt) gene_product=gamma-glutamyl phosphate reductase gene_strand=> genes_inactivated=proA html_gene_name=<i>proA</i>&nbsp;&rarr; ins_end=TA ins_start=T locus_tag=ECB_00240 locus_tags_inactivated=ECB_00240 mutation_category=mobile_element_insertion repeat_size=768
MOB 22 62,78 REL606-5 36000 IS1 1 7 del_end=2 del_start=2 gene_name=thrW/yagP gene_position=intergenic (+52/+69) gene_product=tRNA-Thr/predicted transcriptional regulator genes_promoter=yagP html_gene_name=<i>thrW</i>&nbsp;&rarr;&nbsp;/&nbsp;&larr;&nbsp;<i>yagP</i> ins_end=GC ins_start=ATGGC locus_tag=ECB_t00005/ECB_00241 locus_tags_promoter=ECB_00241 mutation_category=mobile_element_insertion repeat_size=768
Expand Down

0 comments on commit 90766db

Please sign in to comment.