This repository has been archived by the owner on Apr 27, 2018. It is now read-only.
forked from amplab/snap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.0dev.69: add -mpc option, implement previously unimplemented -omax
- Loading branch information
Showing
20 changed files
with
468 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/*++ | ||
Module Name: | ||
AlignmentResult.cpp | ||
Abstract: | ||
Code for SNAP genome alignment results | ||
Authors: | ||
Bill Bolosky, March, 2015 | ||
Environment: | ||
Revision History: | ||
--*/ | ||
|
||
#include "stdafx.h" | ||
#include "AlignmentResult.h" | ||
#include "GenomeIndex.h" | ||
|
||
|
||
|
||
int | ||
SingleAlignmentResult::compareByContigAndScore(const void *first_, const void *second_) | ||
{ | ||
extern GenomeIndex *g_index; // Sorry, but no easy way to get this into here | ||
|
||
const SingleAlignmentResult *first = (SingleAlignmentResult *)first_; | ||
const SingleAlignmentResult *second = (SingleAlignmentResult *)second_; | ||
|
||
int firstContig = g_index->getGenome()->getContigNumAtLocation(first->location); | ||
int secondContig = g_index->getGenome()->getContigNumAtLocation(second->location); | ||
|
||
if (firstContig < secondContig) { | ||
return -1; | ||
} else if (firstContig > secondContig) { | ||
return 1; | ||
} else if (first->score < second->score) { | ||
return -1; | ||
} else if (first->score > second->score) { | ||
return 1; | ||
} else { | ||
return 0; | ||
} | ||
} | ||
|
||
int | ||
SingleAlignmentResult::compareByScore(const void *first_, const void *second_) | ||
{ | ||
const SingleAlignmentResult *first = (SingleAlignmentResult *)first_; | ||
const SingleAlignmentResult *second = (SingleAlignmentResult *)second_; | ||
|
||
if (first->score < second->score) { | ||
return -1; | ||
} else if (first->score > second->score) { | ||
return 1; | ||
} else { | ||
return 0; | ||
} | ||
} | ||
|
||
int | ||
PairedAlignmentResult::compareByContigAndScore(const void *first_, const void *second_) | ||
{ | ||
extern GenomeIndex *g_index; // Sorry, but no easy way to get this into here | ||
|
||
const PairedAlignmentResult *first = (PairedAlignmentResult *)first_; | ||
const PairedAlignmentResult *second = (PairedAlignmentResult *)second_; | ||
|
||
int firstContig = g_index->getGenome()->getContigNumAtLocation(first->location[0]); | ||
int secondContig = g_index->getGenome()->getContigNumAtLocation(second->location[0]); | ||
|
||
if (firstContig < secondContig) { | ||
return -1; | ||
} else if (firstContig > secondContig) { | ||
return 1; | ||
} else if (first->score < second->score) { | ||
return -1; | ||
} else if (first->score > second->score) { | ||
return 1; | ||
} else { | ||
return 0; | ||
} | ||
} | ||
|
||
int | ||
PairedAlignmentResult::compareByScore(const void *first_, const void *second_) | ||
{ | ||
const PairedAlignmentResult *first = (PairedAlignmentResult *)first_; | ||
const PairedAlignmentResult *second = (PairedAlignmentResult *)second_; | ||
|
||
int firstScore = first->score[0] + first->score[1]; | ||
int secondScore = second->score[0] + second->score[1]; | ||
|
||
if (firstScore < secondScore) { | ||
return -1; | ||
} else if (firstScore > secondScore) { | ||
return 1; | ||
} else { | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.