Skip to content
Snippets Groups Projects
Commit df7ccbf5 authored by “kpepper”'s avatar “kpepper”
Browse files

Initial BAM View changes to fix selection issues, zooming into secondary...

Initial BAM View changes to fix selection issues, zooming into secondary alignments, erroneous collapsing of reads with same start/end position and display of SNPs - related to RT ticket 597652
parent 98746e43
No related branches found
No related tags found
No related merge requests found
......@@ -350,6 +350,9 @@
<jvmarg value="-Djava.awt.headless=true" />
<batchtest fork="yes" todir="${junit.reports.dir}">
<fileset dir="${evosuite.tests.src.dir}">
<!--include name="**/*BamView_ESTest.java" if="${do.run.evosuite.tests}" /-->
<include name="**/*_ESTest.java" if="${do.run.evosuite.tests}" />
<!-- Exclude classes that currently produce broken tests -->
......@@ -382,7 +385,7 @@
</target>
<!-- Create Jacoco reports -->
<target name="jacoco-coverage-report">
<target name="jacoco-coverage-report" depends="run-manual-tests">
<delete dir="${coverage.report.jacoco.dir}" />
<mkdir dir="${coverage.report.jacoco.dir}" />
......
......@@ -362,5 +362,28 @@ class BamUtils
}
return featureReadCount;
}
/**
* Check whether two SAM records are the same.
* @param bamRec1 SamViewRecord
* @param bamRec2 SamViewRecord
* @return boolean - true if equality holds.
*/
public static boolean samRecordEqualityCheck(SAMRecord rec1, SAMRecord rec2)
{
boolean result = false;
if (rec1 == null && rec2 == null)
return true;
result = (
(rec1.getReadName().equals(rec2.getReadName())) &&
(rec1.getAlignmentStart() == rec2.getAlignmentStart()) &&
(rec1.getAlignmentEnd() == rec2.getAlignmentEnd()) &&
(rec1.getFlags() == rec2.getFlags())
);
return result;
}
}
This diff is collapsed.
package uk.ac.sanger.artemis.components.alignment;
/**
* Utility class that handles operations on an alignment block
* string taking into account the possibility that it could be
* a secondary alignment.
*
* @author kp11
*
*/
public class SAMRecordSequenceString
{
public final static char SECONDARY_ALIGNMENT_BASE_CHAR = '=';
public final static char SECONDARY_ALIGNMENT_MARKER = '*';
private String sequence;
private boolean isSecondaryAlignment;
public SAMRecordSequenceString(String sequence)
{
this.sequence = sequence;
this.isSecondaryAlignment = (String.valueOf(SECONDARY_ALIGNMENT_MARKER).equals(sequence));
}
public String substring(int beginIdx, int endIdx)
{
String result = null;
if (!isSecondaryAlignment())
{
result = sequence.substring(beginIdx, endIdx);
}
else
{
result = new String(new char[endIdx-beginIdx]).replace('\0', SECONDARY_ALIGNMENT_BASE_CHAR);
}
return result;
}
public char charAt(int idx)
{
char result;
if (!isSecondaryAlignment())
{
result = sequence.charAt(idx);
}
else
{
result = SECONDARY_ALIGNMENT_BASE_CHAR;
}
return result;
}
public String getSequence()
{
return sequence;
}
public int length()
{
return sequence.length();
}
public boolean isSecondaryAlignment() {
return isSecondaryAlignment;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment