@Test public void testCreateLocusGenes() throws Exception { assertThat(associationAttributeService.createLocusGenes("SFRP1,SFRP2", ",")).isInstanceOf(Collection.class); assertThat(associationAttributeService.createLocusGenes("SFRP1,SFRP2", ",")).hasSize(2); assertThat(associationAttributeService.createLocusGenes("SFRP1,SFRP2", ",")).hasOnlyElementsOfType(Gene.class); assertThat(associationAttributeService.createLocusGenes("SFRP1,SFRP2", ",")).extracting("geneName") .contains("SFRP1", "SFRP2"); assertThat(associationAttributeService.createLocusGenes(null, ",")).isInstanceOf(Collection.class); assertThat(associationAttributeService.createLocusGenes(null, ",")).hasSize(0); }
public Collection<Gene> createLocusGenes(String authorReportedGene, String delimiter) { Collection<Gene> locusGene = new ArrayList<>(); if (authorReportedGene != null && !authorReportedGene.isEmpty()) { String[] genes = authorReportedGene.split(delimiter); Collection<String> genesToCreate = new ArrayList<>(); for (String gene : genes) { if(gene != null && !gene.trim().equals("")) { genesToCreate.add(gene.trim()); } } locusGene = createGene(genesToCreate); } return locusGene; }
AssociationAttributeService { public Collection<Gene> createLocusGenes(String authorReportedGene, String delimiter) { Collection<Gene> locusGene = new ArrayList<>(); if (authorReportedGene != null && !authorReportedGene.isEmpty()) { String[] genes = authorReportedGene.split(delimiter); Collection<String> genesToCreate = new ArrayList<>(); for (String gene : genes) { if(gene != null && !gene.trim().equals("")) { genesToCreate.add(gene.trim()); } } locusGene = createGene(genesToCreate); } return locusGene; } }
AssociationAttributeService { public Collection<Gene> createLocusGenes(String authorReportedGene, String delimiter) { Collection<Gene> locusGene = new ArrayList<>(); if (authorReportedGene != null && !authorReportedGene.isEmpty()) { String[] genes = authorReportedGene.split(delimiter); Collection<String> genesToCreate = new ArrayList<>(); for (String gene : genes) { if(gene != null && !gene.trim().equals("")) { genesToCreate.add(gene.trim()); } } locusGene = createGene(genesToCreate); } return locusGene; } @Autowired  AssociationAttributeService(EfoTraitRepository efoTraitRepository); }
AssociationAttributeService { public Collection<Gene> createLocusGenes(String authorReportedGene, String delimiter) { Collection<Gene> locusGene = new ArrayList<>(); if (authorReportedGene != null && !authorReportedGene.isEmpty()) { String[] genes = authorReportedGene.split(delimiter); Collection<String> genesToCreate = new ArrayList<>(); for (String gene : genes) { if(gene != null && !gene.trim().equals("")) { genesToCreate.add(gene.trim()); } } locusGene = createGene(genesToCreate); } return locusGene; } @Autowired  AssociationAttributeService(EfoTraitRepository efoTraitRepository); Collection<Gene> createLocusGenes(String authorReportedGene, String delimiter); RiskAllele createRiskAllele(String curatorEnteredRiskAllele, SingleNucleotidePolymorphism snp); SingleNucleotidePolymorphism createSnp(String curatorEnteredSNP); Collection<EfoTrait> getEfoTraitsFromRepository(Collection<String> efoUris); }
AssociationAttributeService { public Collection<Gene> createLocusGenes(String authorReportedGene, String delimiter) { Collection<Gene> locusGene = new ArrayList<>(); if (authorReportedGene != null && !authorReportedGene.isEmpty()) { String[] genes = authorReportedGene.split(delimiter); Collection<String> genesToCreate = new ArrayList<>(); for (String gene : genes) { if(gene != null && !gene.trim().equals("")) { genesToCreate.add(gene.trim()); } } locusGene = createGene(genesToCreate); } return locusGene; } @Autowired  AssociationAttributeService(EfoTraitRepository efoTraitRepository); Collection<Gene> createLocusGenes(String authorReportedGene, String delimiter); RiskAllele createRiskAllele(String curatorEnteredRiskAllele, SingleNucleotidePolymorphism snp); SingleNucleotidePolymorphism createSnp(String curatorEnteredSNP); Collection<EfoTrait> getEfoTraitsFromRepository(Collection<String> efoUris);  }