Newer
Older
/* VCFview
*
* created: July 2010
*
* This file is part of Artemis
*
* Copyright(C) 2010 Genome Research Limited
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or(at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
package uk.ac.sanger.artemis.components.variant;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.net.URL;
import java.util.regex.Pattern;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import net.sf.samtools.util.BlockCompressedInputStream;
import org.apache.log4j.Level;
import uk.ac.sanger.artemis.Entry;
import uk.ac.sanger.artemis.EntryGroup;
import uk.ac.sanger.artemis.Feature;
import uk.ac.sanger.artemis.FeatureKeyPredicate;
import uk.ac.sanger.artemis.FeatureVector;
import uk.ac.sanger.artemis.SelectionChangeEvent;
import uk.ac.sanger.artemis.SelectionChangeListener;
import uk.ac.sanger.artemis.components.DisplayAdjustmentEvent;
import uk.ac.sanger.artemis.components.DisplayAdjustmentListener;
import uk.ac.sanger.artemis.components.FeatureDisplay;
import uk.ac.sanger.artemis.components.FileViewer;
import uk.ac.sanger.artemis.components.MessageDialog;
import uk.ac.sanger.artemis.components.alignment.FileSelectionDialog;
import uk.ac.sanger.artemis.components.variant.BCFReader.BCFReaderIterator;
import uk.ac.sanger.artemis.editor.MultiLineToolTipUI;
import uk.ac.sanger.artemis.io.EmblStreamFeature;
import uk.ac.sanger.artemis.io.EntryInformation;
import uk.ac.sanger.artemis.io.InvalidRelationException;
import uk.ac.sanger.artemis.io.Key;
import uk.ac.sanger.artemis.io.Location;
import uk.ac.sanger.artemis.io.Qualifier;
import uk.ac.sanger.artemis.io.QualifierVector;
import uk.ac.sanger.artemis.io.RangeVector;
import uk.ac.sanger.artemis.sequence.MarkerRange;
import uk.ac.sanger.artemis.sequence.NoSequenceException;
import uk.ac.sanger.artemis.util.Document;
import uk.ac.sanger.artemis.util.DocumentFactory;
import uk.ac.sanger.artemis.util.OutOfRangeException;
public class VCFview extends JPanel
implements DisplayAdjustmentListener, SelectionChangeListener
{
private static final long serialVersionUID = 1L;
private JScrollBar scrollBar;
private FeatureDisplay feature_display;
private EntryGroup entryGroup;
private VCFRecord mouseVCF;
//record of where a mouse drag starts
private int dragStart = -1;
protected boolean showSynonymous = true;
protected boolean showNonSynonymous = true;
protected boolean showDeletions = true;
protected boolean showInsertions = true;
protected boolean showMultiAlleles = true;
// show variants that do not overlap CDS
protected boolean showNonOverlappings = true;
protected boolean showNonVariants = false;
new JCheckBoxMenuItem("Mark new stops within CDS features", true);
private static int VARIANT_COLOUR_SCHEME = 0;
private static int SYN_COLOUR_SCHEME = 1;
private static int QUAL_COLOUR_SCHEME = 2;
private int colourScheme = 0;
private Color colMap[] = makeColours(Color.RED, 255);
Hashtable<String, Integer> offsetLengths = null;
private boolean concatSequences = false;
protected static Pattern tabPattern = Pattern.compile("\t");
public static String VCFFILE_SUFFIX = ".*\\.[bv]{1}cf(\\.gz)*$";
public static org.apache.log4j.Logger logger4j =
org.apache.log4j.Logger.getLogger(VCFview.class);
public VCFview(final JFrame frame,
final JPanel vcfPanel,
final List<String> vcfFiles,
final int nbasesInView,
final int seqLength,
final String chr,
final String reference,
final FeatureDisplay feature_display)
{
super();
this.nbasesInView = nbasesInView;
this.seqLength = seqLength;
this.chr = chr;
this.feature_display = feature_display;
this.vcfPanel = vcfPanel;
setBackground(Color.white);
MultiLineToolTipUI.initialize();
setToolTipText("");
vcfPanel.setPreferredSize(new Dimension(900,
(vcfFiles.size()+1)*(LINE_HEIGHT+5)));
this.entryGroup = feature_display.getEntryGroup();
this.entryGroup = getReference(reference);
if(entryGroup != null)
this.seqLength = entryGroup.getSequenceEntry().getBases().getLength();
header = new String[vcfFiles.size()];
for(int i=0; i<vcfFiles.size(); i++)
{
catch(java.lang.UnsupportedClassVersionError err)
{
JOptionPane.showMessageDialog(null,
"This requires Java 1.6 or higher.",
"Check Java Version", JOptionPane.WARNING_MESSAGE);
}
final JScrollPane jspView = new JScrollPane(this,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
vcfPanel.setLayout(new BorderLayout());
vcfPanel.add(jspView, BorderLayout.CENTER);
if(this.nbasesInView > this.seqLength)
this.nbasesInView = this.seqLength/2;
scrollBar = new JScrollBar(JScrollBar.HORIZONTAL, 1, this.nbasesInView, 1, this.seqLength);
scrollBar.setUnitIncrement(nbasesInView/20);
scrollBar.addAdjustmentListener(new AdjustmentListener()
{
public void adjustmentValueChanged(AdjustmentEvent e)
{
repaint();
}
});
//
//
addMouseListener(new PopupListener());
//
setDisplay();
if(feature_display == null)
{
vcfPanel.add(scrollBar, BorderLayout.SOUTH);
frame.pack();
frame.setVisible(true);
}
else
{
Border empty = new EmptyBorder(0,0,0,0);
jspView.setBorder(empty);
private void createMenus(JFrame frame, final JScrollPane jspView)
if(feature_display != null)
topPanel = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
else
{
markNewStops.setSelected(false);
markNewStops.setEnabled(false);
topPanel = new JMenuBar();
frame.setJMenuBar((JMenuBar)topPanel);
JMenu fileMenu = new JMenu("File");
topPanel.add(fileMenu);
JMenuItem printImage = new JMenuItem("Save As Image Files (png/jpeg)...");
printImage.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
{
PrintVCFview part = new PrintVCFview(VCFview.this);
part.print();
}
});
fileMenu.add(printImage);
JMenuItem printPS = new JMenuItem("Print...");
printPS.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
{
PrintVCFview part = new PrintVCFview(VCFview.this);
part.validate();
part.doPrintActions();
}
});
fileMenu.add(printPS);
JMenuItem close = new JMenuItem("Close");
fileMenu.add(close);
close.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
{
VCFview.this.setVisible(false);
Component comp = VCFview.this;
while( !(comp instanceof JFrame) )
comp = comp.getParent();
((JFrame)comp).dispose();
}
});
JButton zoomIn = new JButton("-");
Insets ins = new Insets(1,1,1,1);
zoomIn.setMargin(ins);
zoomIn.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
{
setZoomLevel((int) (VCFview.this.nbasesInView * 1.1));
}
});
topPanel.add(zoomIn);
JButton zoomOut = new JButton("+");
zoomOut.setMargin(ins);
zoomOut.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent e)
{
setZoomLevel((int) (VCFview.this.nbasesInView * .9));
}
});
topPanel.add(zoomOut);
}
final JComboBox combo = new JComboBox(vcfReaders[0].getSeqNames());
combo.setSelectedItem(this.chr);
combo.setEditable(false);
combo.setMaximumRowCount(20);
combo.addItemListener(new ItemListener()
{
public void itemStateChanged(ItemEvent e)
{
if(combo.getSelectedItem().equals("Combine References"))
concatSequences = true;
else
{
VCFview.this.chr = (String) combo.getSelectedItem();
concatSequences = false;
}
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
if(topPanel instanceof JPanel)
vcfPanel.add(topPanel, BorderLayout.NORTH);
// auto hide top panel
final JCheckBox buttonAutoHide = new JCheckBox("Hide", true);
buttonAutoHide.setToolTipText("Auto-Hide");
topPanel.add(buttonAutoHide);
final MouseMotionListener mouseMotionListener = new MouseMotionListener()
{
public void mouseDragged(MouseEvent event)
{
handleCanvasMouseDrag(event);
}
public void mouseMoved(MouseEvent e)
{
findVariantAtPoint(e.getPoint());
int thisHgt = HEIGHT;
if (thisHgt < 5)
thisHgt = 15;
int y = (int) (e.getY() - jspView.getViewport().getViewRect().getY());
if (y < thisHgt)
topPanel.setVisible(true);
else
{
if (buttonAutoHide.isSelected())
topPanel.setVisible(false);
}
}
};
addMouseMotionListener(mouseMotionListener);
// popup menu
popup = new JPopupMenu();
JMenuItem addVCFMenu = new JMenuItem("Add VCF ...");
addVCFMenu.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
FileSelectionDialog fileSelection = new FileSelectionDialog(
null, true, "VCFview", "VCF");
List<String> vcfFileList = fileSelection.getFiles(VCFFILE_SUFFIX);
AbstractVCFReader[] trTmp = new AbstractVCFReader[count + vcfReaders.length];
System.arraycopy(vcfReaders, 0, trTmp, 0, vcfReaders.length);
vcfReaders = trTmp;
System.arraycopy(header, 0, hdTmp, 0, header.length);
header = hdTmp;
for (int i = 0; i < vcfFileList.size(); i++)
header[i+oldSize] = readHeader(vcfFileList.get(i), i+oldSize);
setDisplay();
repaint();
jspView.revalidate();
}
});
popup.add(addVCFMenu);
popup.addSeparator();
markNewStops.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
if(!markNewStops.isSelected())
markAsNewStop = false;
repaint();
}
});
popup.add(markNewStops);
final JMenuItem byQuality = new JMenuItem("Filter ...");
byQuality.addActionListener(new ActionListener(){
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
final JMenu colourBy = new JMenu("Colour By");
popup.add(colourBy);
ButtonGroup group = new ButtonGroup();
final JRadioButtonMenuItem colByAlt = new JRadioButtonMenuItem("Variant");
colByAlt.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
if(colByAlt.isSelected())
colourScheme = 0;
repaint();
}
});
colourBy.add(colByAlt);
final JRadioButtonMenuItem colBySyn = new JRadioButtonMenuItem("Synonymous/Non-synonymous");
colBySyn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
if(colBySyn.isSelected())
colourScheme = 1;
repaint();
}
});
colourBy.add(colBySyn);
final JRadioButtonMenuItem colByScore = new JRadioButtonMenuItem("Score");
colByScore.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
if(colByScore.isSelected())
colourScheme = 2;
repaint();
}
});
colourBy.add(colByScore);
group.add(colByAlt);
group.add(colBySyn);
group.add(colByScore);
colByAlt.setSelected(true);
final JMenu export = new JMenu("Write");
popup.add(export);
final JMenuItem exportVCF = new JMenuItem("Filtered VCF");
exportVCF.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
VCFview.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
export.add(exportVCF);
final JMenuItem exportFastaSelected = new JMenuItem("FASTA of selected feature(s)");
exportFastaSelected.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
VCFview.this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
IOUtils.exportFasta(vcfReaders, chr, VCFview.this, vcf_v4,
VCFview.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
});
export.add(exportFastaSelected);
final JMenuItem exportFasta = new JMenuItem("FASTA of selected base range");
exportFasta.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
VCFview.this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
IOUtils.exportFastaByRange(entryGroup, vcfReaders, chr, VCFview.this, vcf_v4, selection, false);
VCFview.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
});
final JMenu view = new JMenu("View");
popup.add(view);
final JMenuItem viewFastaSelected = new JMenuItem("FASTA of selected feature(s)");
viewFastaSelected.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
VCFview.this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
IOUtils.exportFasta(vcfReaders, chr, VCFview.this, vcf_v4,
VCFview.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
});
final JMenuItem viewFasta = new JMenuItem("FASTA of selected base range");
viewFasta.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e)
{
VCFview.this.setCursor(new Cursor(Cursor.WAIT_CURSOR));
IOUtils.exportFastaByRange(entryGroup, vcfReaders, chr, VCFview.this, vcf_v4, selection, true);
VCFview.this.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
});
view.add(viewFasta);
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
private static EntryGroup getReference(String reference)
{
EntryGroup entryGroup = new SimpleEntryGroup();
final Document entry_document = DocumentFactory.makeDocument(reference);
final EntryInformation artemis_entry_information =
Options.getArtemisEntryInformation();
final uk.ac.sanger.artemis.io.Entry new_embl_entry =
EntryFileDialog.getEntryFromFile(null, entry_document,
artemis_entry_information,
false);
if(new_embl_entry != null) // the read failed
{
Entry entry = null;
Bases bases = null;
try
{
if (entryGroup.getSequenceEntry() != null)
bases = entryGroup.getSequenceEntry().getBases();
if (bases == null)
{
entry = new Entry(new_embl_entry);
bases = entry.getBases();
}
else
entry = new Entry(bases, new_embl_entry);
entryGroup.add(entry);
}
catch (OutOfRangeException e)
{
new MessageDialog(null, "read failed: one of the features in "
+ reference + " has an out of range " + "location: "
+ e.getMessage());
}
catch (NoSequenceException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return entryGroup;
}
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
/**
* Test and download if on a http server
* @param fileName
* @return
*/
private String testForURL(String fileName)
{
if(!fileName.startsWith("http:"))
return fileName;
String newFileName = download(fileName, null, ".bcf");
download(fileName+".bci", newFileName, ".bci");
return newFileName;
}
protected String download(String f, String newName, String suffix)
{
try
{
final URL urlFile = new URL(f);
InputStream is = urlFile.openStream();
// Create temp file.
File bcfFile;
if(newName != null)
bcfFile = new File(newName+suffix);
else
bcfFile = File.createTempFile(urlFile.getFile().replaceAll(
"[\\/\\s]", "_"), suffix);
bcfFile.deleteOnExit();
FileOutputStream out = new FileOutputStream(bcfFile);
int c;
while ((c = is.read()) != -1)
out.write(c);
out.flush();
out.close();
is.close();
return bcfFile.getAbsolutePath();
}
catch(IOException ioe)
{
JOptionPane.showMessageDialog(null,
"Problem downloading\n"+f,
"Problem", JOptionPane.WARNING_MESSAGE);
}
return null;
}
/**
* Read the vcf header
* @param fileName
* @return
*/
private String readHeader(String fileName, int index)
{
StringBuffer buff = new StringBuffer();
buff.append(fileName+"\n");
try
{
fileName = testForURL(fileName);
vcfReaders[index] = new BCFReader(new File(fileName));
String hdr = ((BCFReader)vcfReaders[index]).headerToString();
if(hdr.indexOf("VCFv4") > -1)
vcf_v4 = true;
return hdr;
BlockCompressedInputStream is =
new BlockCompressedInputStream(new FileInputStream(fileName));
return buff.toString();
}
/**
* Set the number of bases being displayed
* @param nbasesInView
*/
private void setZoomLevel(final int nbasesInView)
{
int startValue = scrollBar.getValue();
this.nbasesInView = nbasesInView;
float pixPerBase = getPixPerBaseByWidth();
this.nbasesInView = (int)(getWidth()/pixPerBase);
if(scrollBar != null)
{
scrollBar.setValues(startValue, nbasesInView, 1, seqLength);
scrollBar.setUnitIncrement(nbasesInView/20);
scrollBar.setBlockIncrement(nbasesInView);
}
}
public String getToolTipText()
{
"Seq: "+mouseVCF.getChrom()+"\n";
msg += "Pos: "+mouseVCF.getPos()+"\n";
msg += "ID: "+mouseVCF.getID()+"\n";
msg += "Variant: "+mouseVCF.getRef()+" -> "+mouseVCF.getAlt().toString()+"\n";
msg += "Qual: "+mouseVCF.getQuality()+"\n";
String pl;
if((pl = mouseVCF.getFormatValue("PL")) != null && pl.split(",").length > 1)
msg += "Genotype likelihood (PL): "+pl+"\n";
/**
* For VCF files with multiple references sequences, calculate
* the offset from the start of the concatenated sequence for
* a given reference.
* @param refName
* @return
*/
protected int getSequenceOffset(String refName)
{
if(!concatSequences)
return 0;
if(offsetLengths == null)
{
FeatureVector features = entryGroup.getAllFeatures();
offsetLengths = new Hashtable<String, Integer>(contigs.length);
for(int i=0; i<contigs.length; i++)
{
FeatureContigPredicate predicate = new FeatureContigPredicate(contigs[i]);
for(int j=0; j<features.size(); j++)
{
if(predicate.testPredicate(features.elementAt(j)))
{
offsetLengths.put(contigs[i], features.elementAt(j).getFirstBase()-1);
break;
}
}
}
tjc
committed
if(offsetLengths.size() != contigs.length)
tjc
committed
JOptionPane.showMessageDialog(this,
"There is a problem matching the reference sequences\n"+
"to the names in the VCF file. This may mean the labels\n"+
"on the reference features do not match those in the in\n"+
"the VCF file.",
"Problem Found", JOptionPane.WARNING_MESSAGE);
}
return offsetLengths.get(refName);
}
protected void paintComponent(Graphics g)
{
super.paintComponent(g);
drawSelectionRange((Graphics2D)g, pixPerBase, start, end);
FeatureVector features = getCDSFeaturesInRange(start, end);
for(int j=0; j<contigs.length; j++)
{
int offset = getSequenceOffset(contigs[j]);
int nextOffset;
if(j<contigs.length-1)
nextOffset = getSequenceOffset(contigs[j+1]);
else
nextOffset = seqLength;
if( (offset >= start && offset < end) ||
(offset < start && start < nextOffset) )
{
int thisStart = start - offset;
if(thisStart < 1)
thisStart = 1;
int thisEnd = end - offset;
drawRegion(g, contigs[j], thisStart, thisEnd, i, start, pixPerBase, features);
{
int thisStart = start;
if(thisStart < 1)
thisStart = 1;
drawRegion(g, chr, thisStart, end, i, start, pixPerBase, features);
if(feature_display == null)
drawScale((Graphics2D)g, start, end, pixPerBase, getHeight());
}
int i,
int start,
float pixPerBase,
FeatureVector features)
{
String s;
BCFReader bcfReader = (BCFReader)vcfReaders[i];
BCFReaderIterator it = bcfReader.query(chr, sbeg, send);
while((bcfRecord = it.next()) != null)
drawVariantCall(g, bcfRecord, start, i, pixPerBase, features);
TabixReader.Iterator iter =
((TabixReader)vcfReaders[i]).query(chr+":"+sbeg+"-"+send); // get the iterator
if (iter == null)
return;
try
{
while ((s = iter.next()) != null)
{
VCFRecord vcfRecord = VCFRecord.parse(s);
drawVariantCall(g, vcfRecord, start, i, pixPerBase, features);
}
}
catch (IOException e)
{
private FeatureVector getCDSFeaturesInRange(int start, int end)
{
try
{
Range range = new Range(start, end);
FeatureVector features = entryGroup.getFeaturesInRange(range);
FeatureKeyPredicate predicate = new FeatureKeyPredicate(Key.CDS);
final FeatureVector cdsFeatures = new FeatureVector();
for(int i=0; i<features.size(); i++)
{
final Feature this_feature = features.elementAt(i);
if(predicate.testPredicate(this_feature))
cdsFeatures.add(this_feature);
}
return cdsFeatures;
}
catch (OutOfRangeException e1)
{
e1.printStackTrace();
}
return null;
}
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
/**
* Highlight a selected range
* @param g2
* @param pixPerBase
* @param start
* @param end
*/
private void drawSelectionRange(Graphics2D g2, float pixPerBase, int start, int end)
{
if(getSelection() != null)
{
Range selectedRange = getSelection().getSelectionRange();
if(selectedRange != null)
{
int rangeStart = selectedRange.getStart();
int rangeEnd = selectedRange.getEnd();
if(end < rangeStart || start > rangeEnd)
return;
int x = (int) (pixPerBase*(rangeStart-getBaseAtStartOfView()));
int width = (int) (pixPerBase*(rangeEnd-rangeStart+1));
g2.setColor(Color.pink);
g2.fillRect(x, 0, width, getHeight());
}
}
}
private Selection getSelection()
{
return selection;
protected int getBaseAtStartOfView()
{
if(feature_display != null)
return feature_display.getForwardBaseAtLeftEdge();
else
return scrollBar.getValue();
}
protected boolean showVariant(VCFRecord record, FeatureVector features, int basePosition)
if(!showDeletions && record.getAlt().isDeletion(vcf_v4))
return false;
if(!showInsertions && record.getAlt().isInsertion(vcf_v4))
return false;
if(!VCFFilter.passFilter(record))
return false;
if(!showNonOverlappings && !isOverlappingFeature(features, basePosition))
return false;
if(!showNonVariants && record.getAlt().isNonVariant())
return false;
!record.getAlt().isDeletion(vcf_v4) &&
!record.getAlt().isInsertion(vcf_v4) &&
record.getAlt().length() == 1 &&
record.getRef().length() == 1)
if(isSyn == 2)
markAsNewStop = true;
}
if( (!showSynonymous || !showNonSynonymous) &&
!record.getAlt().isDeletion(vcf_v4) &&
!record.getAlt().isInsertion(vcf_v4) &&
record.getAlt().length() == 1 &&
record.getRef().length() == 1)