diff --git a/bin/pairToPair b/bin/pairToPair index 5aa200544bd1d177092fd91b38506f97761fa217..4075466498428b8bb7feee171fc462395ecfa369 100755 Binary files a/bin/pairToPair and b/bin/pairToPair differ diff --git a/obj/bedFilePE.o b/obj/bedFilePE.o index a0f927611d7701053a3dad9e05a07a9c6a4df867..c0eaca962011334be14334af42e9fe6ced73d5f3 100644 Binary files a/obj/bedFilePE.o and b/obj/bedFilePE.o differ diff --git a/obj/pairToPair.o b/obj/pairToPair.o index 6efeb40b8b06abe85ec2bb8cf3eb7511e1247648..2db9e05348770f0604c683b6f67d8e0f24330972 100644 Binary files a/obj/pairToPair.o and b/obj/pairToPair.o differ diff --git a/src/pairToPair/b.bedpe b/src/pairToPair/b.bedpe index 1a551009b26e42120bbd5de934073ffccaf2b0b6..972367756cda858caf3bdca5d0423442370c627e 100644 --- a/src/pairToPair/b.bedpe +++ b/src/pairToPair/b.bedpe @@ -1 +1 @@ -chr1 10 20 chr1 19 120 a1 1 - - +chr1 10 20 chr1 19 120 a1 1 + - diff --git a/src/utils/bedFilePE/bedFilePE.cpp b/src/utils/bedFilePE/bedFilePE.cpp index 0de1771641e3c221e53e3f49326f12536ab6f2b4..ca0a8d6fadddccb3c379396ec67b3be4f353ce34 100755 --- a/src/utils/bedFilePE/bedFilePE.cpp +++ b/src/utils/bedFilePE/bedFilePE.cpp @@ -134,6 +134,18 @@ void BedFilePE::reportBedPETab(const BEDPE &a) { a.chrom2.c_str(), a.start2, a.end2, a.name.c_str(), a.score.c_str(), a.strand1.c_str(), a.strand2.c_str()); } + else if (this->bedType > 10) { + printf("%s\t%d\t%d\t%s\t%d\t%d\t%s\t%s\t%s\t%s\t", a.chrom1.c_str(), a.start1, a.end1, + a.chrom2.c_str(), a.start2, a.end2, + a.name.c_str(), a.score.c_str(), a.strand1.c_str(), a.strand2.c_str()); + + vector<string>::const_iterator othIt = a.otherFields.begin(); + vector<string>::const_iterator othEnd = a.otherFields.end(); + for ( ; othIt != othEnd; ++othIt) { + printf("%s\t", othIt->c_str()); + } + printf("\t"); + } } @@ -165,6 +177,18 @@ void BedFilePE::reportBedPENewLine(const BEDPE &a) { a.chrom2.c_str(), a.start2, a.end2, a.name.c_str(), a.score.c_str(), a.strand1.c_str(), a.strand2.c_str()); } + else if (this->bedType > 10) { + printf("%s\t%d\t%d\t%s\t%d\t%d\t%s\t%s\t%s\t%s\t", a.chrom1.c_str(), a.start1, a.end1, + a.chrom2.c_str(), a.start2, a.end2, + a.name.c_str(), a.score.c_str(), a.strand1.c_str(), a.strand2.c_str()); + + vector<string>::const_iterator othIt = a.otherFields.begin(); + vector<string>::const_iterator othEnd = a.otherFields.end(); + for ( ; othIt != othEnd; ++othIt) { + printf("%s\t", othIt->c_str()); + } + printf("\n"); + } } @@ -228,6 +252,26 @@ bool BedFilePE::parseBedPELine (BEDPE &bed, const vector<string> &lineVector, co return true; } + else if (this->bedType > 10) { + bed.chrom1 = lineVector[0]; + bed.start1 = atoi(lineVector[1].c_str()); + bed.end1 = atoi(lineVector[2].c_str()); + + bed.chrom2 = lineVector[3]; + bed.start2 = atoi(lineVector[4].c_str()); + bed.end2 = atoi(lineVector[5].c_str()); + + bed.name = lineVector[6]; + bed.score = lineVector[7].c_str(); + + bed.strand1 = lineVector[8]; + bed.strand2 = lineVector[9]; + + for (unsigned int i = 6; i < lineVector.size(); ++i) { + bed.otherFields.push_back(lineVector[i]); + } + return true; + } else { cerr << "Unexpected number of fields: " << lineNum << ". Verify that your files are TAB-delimited and that your BEDPE file has 6,7,8 or 10 fields. Exiting..." << endl; exit(1); @@ -301,6 +345,26 @@ bool BedFilePE::parseBedPELine (BEDPE &bed, const vector<string> &lineVector, co return true; } + else if (this->bedType > 10) { + bed.chrom1 = lineVector[0]; + bed.start1 = atoi(lineVector[1].c_str()); + bed.end1 = atoi(lineVector[2].c_str()); + + bed.chrom2 = lineVector[3]; + bed.start2 = atoi(lineVector[4].c_str()); + bed.end2 = atoi(lineVector[5].c_str()); + + bed.name = lineVector[6]; + bed.score = lineVector[7].c_str(); + + bed.strand1 = lineVector[8]; + bed.strand2 = lineVector[9]; + + for (unsigned int i = 6; i < lineVector.size(); ++i) { + bed.otherFields.push_back(lineVector[i]); + } + return true; + } else { cerr << "Unexpected number of fields: " << lineNum << ". Verify that your files are TAB-delimited and that your BEDPE file has 6,7,8 or 10 fields. Exiting..." << endl; exit(1); diff --git a/src/utils/bedFilePE/bedFilePE.h b/src/utils/bedFilePE/bedFilePE.h index 557cb264fa0131a66c3fc2db93e7e68b16992576..deaf08ea3134224a8de10e720787c46d7aea8021 100755 --- a/src/utils/bedFilePE/bedFilePE.h +++ b/src/utils/bedFilePE/bedFilePE.h @@ -34,6 +34,8 @@ struct BEDPE { string strand1; string strand2; + + vector<string> otherFields; };