+//**********************************************************************************************************************
+string ChopSeqsCommand::getChoppedUnaligned(Sequence seq) {
+ try {
+ string temp = seq.getUnaligned();
+
+ //if needed trim sequence
+ if (end != 0) {
+ if (temp.length() > end) { temp = temp.substr(0, end); }
+ else { temp = ""; }
+ }else { //you are using fromend
+ if (temp.length() > fromend) { temp = temp.substr(0, (temp.length()-fromend)); }
+ else { temp = ""; } //sequence too short
+ }
+
+ return temp;
+ }
+ catch(exception& e) {
+ m->errorOut(e, "ChopSeqsCommand", "getChoppedUnaligned");
+ exit(1);
+ }
+}
+//**********************************************************************************************************************
+string ChopSeqsCommand::getChoppedAligned(Sequence seq) {
+ try {
+ string temp = seq.getAligned();
+ string tempUnaligned = seq.getUnaligned();
+
+ //if needed trim sequence
+ if (end != 0) {
+ if (tempUnaligned.length() > end) { //you have enough bases to remove some
+
+ int stopSpot = 0;
+ int numBases = 0;
+
+ for (int i = 0; i < temp.length(); i++) {
+ if(isalpha(temp[i])) { numBases++; }