Skip to content

Commit 8ac38b4

Browse files
committed
Update to print any-to-any migration rates in mig skyline.
1 parent df1644c commit 8ac38b4

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

coaltree.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,12 @@ CoalescentTree::CoalescentTree(string paren) {
297297
(*it).setX(xloc);
298298
}
299299

300+
// iSNV
301+
if (stringOne == "iSNV") {
302+
double xloc = atof(stringTwo.c_str());
303+
(*it).setX(xloc);
304+
}
305+
300306
// LATITUDE
301307
if (stringOne == "latitude") {
302308
double xloc = atof(stringTwo.c_str());

io.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,20 @@ void IO::printSkylines() {
844844
// MIGRATION ///////////////////////
845845
if (param.skyline_mig_rates) {
846846
cout << "Printing migration skyline to " << outputFile << endl;
847+
848+
for (double t = start; t + step <= stop; t += step) {
849+
Series s;
850+
for (int i = 0; i < treelist.size(); i++) {
851+
CoalescentTree ct = treelist[i];
852+
ct.trimEnds(t,t+step);
853+
double n = ct.getMigRate();
854+
s.insert(n);
855+
}
856+
outStream << "mig_all\t";
857+
outStream << t + step / (double) 2 << "\t";
858+
outStream << s.quantile(0.025) << "\t" << s.mean() << "\t" << s.quantile(0.975) << endl;
859+
}
860+
847861
for (is = lset.begin(); is != lset.end(); ++is) {
848862
for (js = lset.begin(); js != lset.end(); ++js) {
849863
string from = *is;

param.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void Parameters::importLine(string line) {
146146
break;
147147
else if (*is >= 'a' && *is <= 'z' && vstring.size() == 0)
148148
pstring += *is;
149-
else if ( (*is >= '0' && *is <= '9') || (*is >= 'a' && *is <= 'z') || (*is >= 'A' && *is <= 'Z') || *is == '.' || *is == '-' || *is == '/' || *is == '_')
149+
else if ( (*is >= '0' && *is <= '9') || (*is >= 'a' && *is <= 'z') || (*is >= 'A' && *is <= 'Z') || *is == '.' || *is == '-' || *is == '/' || *is == '_' || *is == '|')
150150
vstring += *is;
151151
else if (vstring.size() > 0) {
152152
values.push_back( atof(vstring.c_str()) );

0 commit comments

Comments
 (0)