Commit b19e194a authored by tcarver's avatar tcarver
Browse files

Merge pull request #128 from tcarver/master

cram
parents 376a237d 0ae2e9c3
......@@ -444,7 +444,12 @@ public class BamView extends JPanel
{
final File cramIndexFile = new File(bam + ".crai");
if(cramIndexFile.exists())
{
logger4j.debug(
"ERROR: CRAM INDEX FILE ("+cramIndexFile.getName()+
") EXPECTING A BAM INDEX FILE (USE THIS OPTION --bam-style-index) ");
return cramIndexFile;
}
}
}
......@@ -494,6 +499,9 @@ public class BamView extends JPanel
if(feature_display != null && bam.endsWith("cram"))
{
// set log level
net.sf.picard.util.Log.setGlobalLogLevel(
net.sf.picard.util.Log.LogLevel.ERROR);
final CRAMReferenceSequenceFile ref = new CRAMReferenceSequenceFile(
feature_display.getEntryGroup().getSequenceEntry(), this);
......@@ -1142,7 +1150,7 @@ public class BamView extends JPanel
* @param pixPerBase
* @param ypos
*/
private void drawSequence(Graphics2D g2, BamViewRecord bamViewRecord,
private void drawSequence(final Graphics2D g2, final BamViewRecord bamViewRecord,
int ypos, String refSeq, int refSeqStart)
{
SAMRecord samRecord = bamViewRecord.sam;
......@@ -1156,8 +1164,8 @@ public class BamView extends JPanel
int xpos;
int len = 0;
int refPos = 0;
String readSeq = samRecord.getReadString();
int offset = getSequenceOffset(samRecord.getReferenceName());
final String readSeq = samRecord.getReadString();
final int offset = getSequenceOffset(samRecord.getReferenceName());
byte[] phredQuality = null;
if(baseQualityColour.isSelected())
......@@ -1181,7 +1189,7 @@ public class BamView extends JPanel
if(isSNPs && refSeq != null && refPos > 0 && refPos < refSeq.length())
{
if(readSeq.charAt(readPos) != refSeq.charAt(refPos))
if(Character.toUpperCase(readSeq.charAt(readPos)) != refSeq.charAt(refPos))
g2.setColor(Color.red);
else
g2.setColor(col);
......@@ -2221,7 +2229,7 @@ public class BamView extends JPanel
{
int readPos = readStart-1+j;
int refPos = refStart+j;
if (Character.toUpperCase(refSeq[refPos-rbeg]) != readSeq[readPos])
if (Character.toUpperCase(refSeq[refPos-rbeg]) != Character.toUpperCase( (char)readSeq[readPos]) )
{
if(snps == null)
snps = new ArrayList<Integer>();
......
......@@ -169,7 +169,7 @@ import net.sf.samtools.SAMRecord;
* @param pixPerBase
* @param ypos
*/
protected void addRecord(SAMRecord thisRead, int offset)
protected void addRecord(final SAMRecord thisRead, int offset)
{
if(snpCount == null)
{
......@@ -178,13 +178,13 @@ import net.sf.samtools.SAMRecord;
snpCount[i] = 0;
}
int thisStart = thisRead.getAlignmentStart();
int thisEnd = thisRead.getAlignmentEnd();
final int thisStart = thisRead.getAlignmentStart();
final int thisEnd = thisRead.getAlignmentEnd();
// use alignment blocks of the contiguous alignment of
// subsets of read bases to a reference sequence
List<AlignmentBlock> blocks = thisRead.getAlignmentBlocks();
byte[] phredQuality = thisRead.getBaseQualities();
final List<AlignmentBlock> blocks = thisRead.getAlignmentBlocks();
final byte[] phredQuality = thisRead.getBaseQualities();
try
{
char[] refSeq = bases.getSubSequenceC(
......@@ -200,7 +200,7 @@ import net.sf.samtools.SAMRecord;
int readPos = block.getReadStart()-1+j;
int refPos = block.getReferenceStart()+j;
if (Character.toUpperCase(refSeq[refPos-thisStart]) != readSeq[readPos])
if (Character.toUpperCase(refSeq[refPos-thisStart]) != Character.toUpperCase( (char)readSeq[readPos] ))
{
if(phredQuality[readPos] < minBaseQualityFilter)
continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment