use of bacter.Locus in project bacter by tgvaughan.
the class ConversionGraphStatsLogger method getMeanEdgeLength.
/**
* Obtain mean length of converted edges in ACG.
*
* @param acg
* @return mean length, or NaN if ACG has no converted edges
*/
public static double getMeanEdgeLength(ConversionGraph acg) {
if (acg.getTotalConvCount() < 1)
return Double.NaN;
double mean = 0.0;
for (Locus locus : acg.getLoci()) {
for (Conversion conv : acg.getConversions(locus)) mean += conv.getHeight2() - conv.getHeight1();
}
mean /= acg.getTotalConvCount();
return mean;
}
use of bacter.Locus in project bacter by tgvaughan.
the class ConvertedRegionLogger method init.
@Override
public void init(PrintStream out) {
final ConversionGraph arg = acgInput.get();
String mainID = (getID() == null || getID().matches(("\\s*"))) ? arg.getID() + ".converted" : getID();
for (Locus locus : acgInput.get().getLoci()) out.print(mainID + "." + locus.getID() + "\t");
}
Aggregations