From: gmungoc Date: Mon, 4 Dec 2017 15:53:44 +0000 (+0000) Subject: Merge branch 'spikes/mungo' into features/JAL-1793VCF X-Git-Tag: Release_2_11_0~92 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=14550ad1e5da4b81082a3a06222cbe26eb9435ce;p=jalview.git Merge branch 'spikes/mungo' into features/JAL-1793VCF Conflicts: src/jalview/ext/htsjdk/HtsContigDb.java src/jalview/io/vcf/VCFLoader.java test/jalview/ext/htsjdk/TestHtsContigDb.java test/jalview/io/vcf/VCFLoaderTest.java --- 14550ad1e5da4b81082a3a06222cbe26eb9435ce diff --cc src/jalview/io/vcf/VCFLoader.java index 20e3ccd,9addfaa..de2f18a --- a/src/jalview/io/vcf/VCFLoader.java +++ b/src/jalview/io/vcf/VCFLoader.java @@@ -939,6 -1013,6 +1013,10 @@@ public class VCFLoade { String type = SequenceOntologyI.SEQUENCE_VARIANT; ++ /* ++ * could we associate Consequence data with this allele and feature (transcript)? ++ * if so, prefer the consequence term from that data ++ */ if (csqAlleleFieldIndex == -1) // && snpEffAlleleFieldIndex == -1 { /* @@@ -947,14 -1021,10 +1025,6 @@@ return type; } -- /* -- * can we associate Consequence data with this allele and feature (transcript)? -- * if so, prefer the consequence term from that data -- */ - String consequence = getConsequenceForAlleleAndFeature(variant, - CSQ_FIELD, - altAlleleIndex, csqAlleleFieldIndex, csqAlleleNumberFieldIndex, - seq.getName().toLowerCase(), csqFeatureFieldIndex); if (consequence != null) { String[] csqFields = consequence.split(PIPE_REGEX); @@@ -1163,36 -1235,21 +1243,20 @@@ /** * Inspects CSQ data blocks (consequences) and adds attributes on the sequence - * feature for the current allele (and transcript if applicable) + * feature. *

- * Allele matching: if field ALLELE_NUM is present, it must match - * altAlleleIndex. If not present, then field Allele value must match the VCF - * Allele. - *

- * Transcript matching: if sequence name can be identified to at least one of - * the consequences' Feature values, then select only consequences that match - * the value (i.e. consequences for the current transcript sequence). If not, - * take all consequences (this is the case when adding features to the gene - * sequence). + * If myConsequence is not null, then this is the specific + * consequence data (pipe-delimited fields) that is for the current allele and + * transcript (sequence) being processed) * * @param variant - * @param seq * @param sf - * @param altAlleleIndex - * (0, 1..) + * @param myConsequence */ - protected void addConsequences(VariantContext variant, SequenceI seq, - SequenceFeature sf, int altAlleleIndex) + protected void addConsequences(VariantContext variant, SequenceFeature sf, + String myConsequence) { - /* - * first try to identify the matching consequence - */ - String myConsequence = getConsequenceForAlleleAndFeature(variant, - CSQ_FIELD, altAlleleIndex, csqAlleleFieldIndex, - csqAlleleNumberFieldIndex, seq.getName().toLowerCase(), - csqFeatureFieldIndex); - Object value = variant.getAttribute(CSQ_FIELD); - // TODO if CSQ not present, try ANN (for SnpEff consequence data)? if (value == null || !(value instanceof List)) {