// Path: src/main/java/abra/ReadEvaluator.java
// static class Alignment {
// 	String chromosome;
// 	int pos;
// 	String cigar;
// 	Orientation orientation;
// 	int numMismatches;
// 		
// 	int contigPos;
// 	String contigCigar;
// 	boolean isSecondary;
// 		
// 	static final Alignment AMBIGUOUS = new Alignment();
// 		
// 	Alignment() {
// 	}
// 		
// 	Alignment(String chromosome, int pos, String cigar, Orientation orientation, int numMismatches, int contigPos, String contigCigar, boolean isSecondary) {
// 		this.chromosome = chromosome;
// 		this.pos = pos;
// 		this.cigar = cigar;
// 		this.orientation = orientation;
// 		this.numMismatches = numMismatches;
// 			
// 		this.contigPos = contigPos;
// 		this.contigCigar = contigCigar;
// 		this.isSecondary = isSecondary;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((cigar == null) ? 0 : cigar.hashCode());
// 		result = prime * result
// 				+ ((orientation == null) ? 0 : orientation.hashCode());
// 		result = prime * result + pos;
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		Alignment other = (Alignment) obj;
// 		if (cigar == null) {
// 			if (other.cigar != null)
// 				return false;
// 		} else if (!cigar.equals(other.cigar))
// 			return false;
// 		if (orientation != other.orientation)
// 			return false;
// 		if (pos != other.pos)
// 			return false;
// 		return true;
// 	}
// 
// }


import java.util.ArrayList;
import java.util.List;
import abra.ReadEvaluator.Alignment;
					newBlocks.add(new CigarBlock(blockLen1, block.type));
					newBlocks.add(new CigarBlock(junctionLength, 'N'));
					if (blockLen2 > 0) {
						newBlocks.add(new CigarBlock(blockLen2, block.type));
					}
					
					refPos += block.length;
				} else {
					newBlocks.add(block);
					refPos += block.length;
				}
			} else {
				// Do not advance ref pos for insertions or introns
				newBlocks.add(block);
			}
		}
		
		return cigarStringFromCigarBlocks(newBlocks);
	}
	
	// Assumes input junctions are sorted by coordinate
	public static String injectSplices(String cigar, List<Integer> junctionPos, List<Integer> junctionLength) {
		
		for (int i=0; i<junctionPos.size(); i++) {
			cigar = injectSplice(cigar, junctionPos.get(i), junctionLength.get(i));
		}
		
		return cigar;
	}
	
// Path: src/main/java/abra/ReadEvaluator.java
// static class Alignment {
// 	String chromosome;
// 	int pos;
// 	String cigar;
// 	Orientation orientation;
// 	int numMismatches;
// 		
// 	int contigPos;
// 	String contigCigar;
// 	boolean isSecondary;
// 		
// 	static final Alignment AMBIGUOUS = new Alignment();
// 		
// 	Alignment() {
// 	}
// 		
// 	Alignment(String chromosome, int pos, String cigar, Orientation orientation, int numMismatches, int contigPos, String contigCigar, boolean isSecondary) {
// 		this.chromosome = chromosome;
// 		this.pos = pos;
// 		this.cigar = cigar;
// 		this.orientation = orientation;
// 		this.numMismatches = numMismatches;
// 			
// 		this.contigPos = contigPos;
// 		this.contigCigar = contigCigar;
// 		this.isSecondary = isSecondary;
// 	}
// 
// 	@Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((cigar == null) ? 0 : cigar.hashCode());
// 		result = prime * result
// 				+ ((orientation == null) ? 0 : orientation.hashCode());
// 		result = prime * result + pos;
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		Alignment other = (Alignment) obj;
// 		if (cigar == null) {
// 			if (other.cigar != null)
// 				return false;
// 		} else if (!cigar.equals(other.cigar))
// 			return false;
// 		if (orientation != other.orientation)
// 			return false;
// 		if (pos != other.pos)
// 			return false;
// 		return true;
// 	}
// 
// }


// Path: src/main/java/abra/CigarUtils.java
import java.util.ArrayList;
import java.util.List;
import abra.ReadEvaluator.Alignment;

					newBlocks.add(new CigarBlock(blockLen1, block.type));
					newBlocks.add(new CigarBlock(junctionLength, 'N'));
					if (blockLen2 > 0) {
						newBlocks.add(new CigarBlock(blockLen2, block.type));
					}
					
					refPos += block.length;
				} else {
					newBlocks.add(block);
					refPos += block.length;
				}
			} else {
				// Do not advance ref pos for insertions or introns
				newBlocks.add(block);
			}
		}
		
		return cigarStringFromCigarBlocks(newBlocks);
	}
	
	// Assumes input junctions are sorted by coordinate
	public static String injectSplices(String cigar, List<Integer> junctionPos, List<Integer> junctionLength) {
		
		for (int i=0; i<junctionPos.size(); i++) {
			cigar = injectSplice(cigar, junctionPos.get(i), junctionLength.get(i));
		}
		
		return cigar;
	}
	
	private static int selectPrimaryAlignment(Alignment alignment1, Alignment alignment2, int def) {