Skip to content

Commit

Permalink
Merge pull request #250 from diekhans/markd-species-errmsg
Browse files Browse the repository at this point in the history
Fixed checking for all species being remove
  • Loading branch information
MarioStanke authored Jan 17, 2021
2 parents dda71d9 + 036cbe7 commit b4830c6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
29 changes: 17 additions & 12 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ CXX?=g++
# Notes: - "-Wno-sign-compare" eliminates a high number of warnings (see footnote below). Please adopt
# a strict signed-only usage strategy to avoid mistakes since we are not warned about this.
# - The order of object files in $(OBJS) IS IMPORTANT (see lldouble.hh)
CXXFLAGS := -Wall -Wno-sign-compare -pedantic -O3 -std=c++11 ${CXXFLAGS}#-DDEBUG -g -ggdb -pg -DDEBUG_STATES
# for debugging set
# OPT = -g
# CXXFLAGS = -DDEBUG -g -ggdb -pg -DDEBUG_STATES
# in common.mk or the environment
OPT ?= -O3
CXXFLAGS += -Wall -Wno-sign-compare -pedantic ${OPT} -std=c++11

ifeq (,$(findstring $(ZIPINPUT),0 false False FALSE)) # if ZIPINPUT is not defined or is something else than 0, false, False or FALSE
CPPFLAGS += -DZIPINPUT
LIBS = -lboost_iostreams
LIBS += -lboost_iostreams
endif

INCLS = -I../include
INCLS += -I../include

OBJS = genbank.o properties.o pp_profile.o pp_hitseq.o pp_scoring.o statemodel.o namgene.o \
types.o gene.o evaluation.o motif.o geneticcode.o hints.o extrinsicinfo.o projectio.o \
Expand Down Expand Up @@ -77,43 +82,43 @@ all: $(OBJS) $(TOBJS) $(DUMOBJS) $(PROGR) info

augustus: augustus.cc $(OBJS) $(DUMOBJS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(INCLS) $(LIBS)
cp augustus ../bin/
cp -f augustus ../bin/

etraining: etraining.cc $(TOBJS) $(OBJS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(INCLS) $(LIBS)
cp etraining ../bin/
cp -f etraining ../bin/

evaluate: evaluate.cc $(OBJS) $(DUMOBJS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(INCLS) $(LIBS)

fastBlockSearch: fastBlockSearch.cc pp_fastBlockSearcher.o \
types.o properties.o geneticcode.o pp_profile.o lldouble.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(INCLS) $(LIBS)
cp fastBlockSearch ../bin/
cp -f fastBlockSearch ../bin/

pp_simScore: pp_simscore.cc fasta.o types.o properties.o geneticcode.o pp_profile.o lldouble.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(INCLS) $(LIBS)
cp pp_simScore ../bin/
cp -f pp_simScore ../bin/

prepareAlign: pp_prepare_align.cc
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
cp prepareAlign ../bin/
cp -f prepareAlign ../bin/

load2db: load2db.cc fasta.o hints.o types.o properties.o lldouble.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(INCLS) $(LIBS)
cp load2db ../bin/
cp -f load2db ../bin/

load2sqlitedb: load2sqlitedb.cc fasta.o hints.o types.o properties.o lldouble.o sqliteDB.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(INCLS) $(LIBS)
cp load2sqlitedb ../bin/
cp -f load2sqlitedb ../bin/

getSeq: getSeq.cc $(OBJS) $(DUMOBJS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(INCLS) $(LIBS)
cp getSeq ../bin/
cp -f getSeq ../bin/

espoca: espoca.cc $(OBJS) $(DUMOBJS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ $(INCLS) $(LIBS)
cp espoca ../bin/
cp -f espoca ../bin/

info:
echo "$(CXXFLAGS) $(CPPFLAGS)" > $(INFO)
Expand Down
4 changes: 3 additions & 1 deletion src/compgenepred.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ CompGenePred::CompGenePred() : tree(Constant::treefile) {
for(int j=0; j<speciesNames.size(); j++){
cout<<"species "<<j<<"\t"<<speciesNames[j]<<endl;
}

if (speciesNames.size() < 2) {
throw ProjectError("must have at least two species for CompGenePred");
}

if (Properties::hasProperty("trainFeatureFile")) {
trainFeature_from_file();
Expand Down
15 changes: 9 additions & 6 deletions src/phylotree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ PhyloTree::PhyloTree(string filename){
ifstream ifstrm(only_species.c_str());
if (ifstrm.is_open()){
vector<string> keep; // the subset of species to be kept
char buf[256];
while(ifstrm.getline(buf,255)){
char buf[8192];
while(ifstrm.getline(buf, sizeof(buf)-1)){
stringstream stm(buf);
string s;
if(stm >> s)
Expand All @@ -123,13 +123,16 @@ PhyloTree::PhyloTree(string filename){
break;
}
}
if(!found){ //if species name ist not in list, remove leaf
if(!found){ //if species name is not in list, remove leaf
drop(species[i]);
}
}
if(species.size() < 2 || species.size() < keep.size())
throw ProjectError(only_species + " has the wrong format. correct format:\n\n" +
"hg19\n" + "mm9\n" + "galGal3\n" + "...\n" +
if(numSp < 2 || numSp < keep.size())
throw ProjectError(only_species + " has the wrong format or doesn't match tree. Correct format:\n\n" +
"hg19 /dir/to/genome/human.fa\n" +
"mm9 /dir/to/genome/mouse.fa\n" +
"galGal3 /dir/to/genome/chicken.fa\n" +
"...\n" +
"The species identifiers must be the same as in the phylogenetic tree. At least two species identifiers must be given.");
}
else
Expand Down
3 changes: 2 additions & 1 deletion src/randseqaccess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ void SpeciesCollection::readExtrinsicCFGFile(vector<string> &speciesNames){
}
else{
if(find(speciesNames.begin(), speciesNames.end(), skey) == speciesNames.end()) {
throw ProjectError(skey + " is not a valid species identifier.");
throw ProjectError("species identifier '" + skey + "' referenced in extrinsicCfgFile '"
+ filename + "' not found in defined set of species");
}
addSpeciesToGroup(skey,groupCount);
cout <<" "<<skey;
Expand Down

0 comments on commit b4830c6

Please sign in to comment.