*/
public SequenceI loadVCFContig(String contig)
{
- String ref = header.getOtherHeaderLine(VCFHeader.REFERENCE_KEY)
- .getValue();
+ VCFHeaderLine headerLine = header.getOtherHeaderLine(VCFHeader.REFERENCE_KEY);
+ String ref = headerLine == null ? null : headerLine.getValue();
if (ref.startsWith("file://"))
{
ref = ref.substring(7);
*/
protected void setSpeciesAndAssembly(String reference)
{
+ reference = reference.toLowerCase();
vcfSpecies = DEFAULT_SPECIES;
/*
}
/**
- * Answers true if the species inferred from the VCF reference identifier
- * matches that for the sequence
- *
- * @param vcfAssembly
- * @param speciesId
- * @return
- */
- boolean vcfSpeciesMatchesSequence(String vcfAssembly, String speciesId)
- {
- // PROBLEM 1
- // there are many aliases for species - how to equate one with another?
- // PROBLEM 2
- // VCF ##reference header is an unstructured URI - how to extract species?
- // perhaps check if ref includes any (Ensembl) alias of speciesId??
- // TODO ask the user to confirm this??
-
- if (vcfAssembly.contains("Homo_sapiens") // gnomAD exome data example
- && "HOMO_SAPIENS".equals(speciesId)) // Ensembl species id
- {
- return true;
- }
-
- if (vcfAssembly.contains("c_elegans") // VEP VCF response example
- && "CAENORHABDITIS_ELEGANS".equals(speciesId)) // Ensembl
- {
- return true;
- }
-
- // this is not a sustainable solution...
-
- return false;
- }
-
- /**
* Queries the VCF reader for any variants that overlap the mapped chromosome
* ranges of the sequence, and adds as variant features. Returns the number of
* overlapping variants found.
Cache.loadProperties("test/jalview/io/testProps.jvprops");
Cache.setProperty("VCF_FIELDS", ".*");
Cache.setProperty("VEP_FIELDS", ".*");
+ Cache.setProperty("VCF_ASSEMBLY", "GRCh38=GRCh38");
Cache.initLogger();
}