@ Override public List < V > apply ( List < Variant > variants ) { List < V > gaVariants = new ArrayList <> ( variants . size ( ) ) ; for ( Variant variant : variants ) { String id = variant . toString ( ) ; List < String > variantIds = new ArrayList <> ( variant . getIds ( ) ) ; for ( StudyEntry study : variant . getStudies ( ) ) { List < String > alternates = new ArrayList <> ( study . getSecondaryAlternatesAlleles ( ) . size ( ) + 1 ) ; alternates . add ( variant . getAlternate ( ) ) ; alternates . addAll ( study . getSecondaryAlternatesAlleles ( ) ) ; //Optional Long time = 0L ; // //Only required for "graph" mode // List<String> alleleIds = null; //VariableSet should be the study, the file, or be provided? String variantSetId = study . getStudyId ( ) ; Map < String , List < String > > fileInfo = parseInfo ( study . getFiles ( ) ) ; List calls = parseCalls ( null , study ) ; Long start = Long . valueOf ( to0BasedStart ( variant . getStart ( ) ) ) ; // Ga4gh uses 0-based positions. Long end = Long . valueOf ( variant . getEnd ( ) ) ; // 0-based end does not change @ SuppressWarnings ( "unchecked" ) V ga = ( V ) factory . newVariant ( id , variantSetId , variantIds , time , time , variant . getChromosome ( ) , start , end , variant . getReference ( ) , alternates , fileInfo , calls ) ; gaVariants . add ( ga ) ; } } return gaVariants ; }
Given a list of variants creates the equivalent set using the GA4GH API .