Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ on:
- release-*

jobs:
build:
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop

test:
uses: ./.github/workflows/test-analysis.yml
needs: build
secrets: inherit

deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
needs: test
with:
maven_opts: -U -DskipTests
cache_key: ${{ needs.test.outputs.cache_key }}
secrets: inherit
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ on:
jobs:
build:
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
with:
maven_opts: --update-snapshots -DskipTests
upload_artifacts: false
needs_hadoop_preparation: false
dependency_repos: "java-common-libs"
secrets: inherit

deploy-maven:
uses: opencb/java-common-libs/.github/workflows/deploy-maven-repository-workflow.yml@develop
needs: build
secrets: inherit
with:
cache_key: ${{ needs.build.outputs.cache_key }}

release:
uses: opencb/java-common-libs/.github/workflows/release-github-workflow.yml@develop
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/scripts/get_same_branch.sh

This file was deleted.

4 changes: 0 additions & 4 deletions .github/workflows/task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
- TASK-*

jobs:
build:
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop

test:
uses: ./.github/workflows/test-analysis.yml
needs: build
secrets: inherit
29 changes: 21 additions & 8 deletions .github/workflows/test-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
name: Build and test the project
on:
workflow_call:
outputs:
cache_key:
description: "Cache key used for Maven repository"
value: ${{ jobs.build.outputs.cache_key }}
secrets:
SONAR_TOKEN:
required: true

jobs:

build:
uses: opencb/java-common-libs/.github/workflows/build-java-app-workflow.yml@develop
with:
needs_hadoop_preparation: false
upload_artifact: false
dependency_repos: "java-common-libs"
secrets: inherit

test:
name: Test and push Sonar analysis
needs: build
runs-on: ${{ vars.UBUNTU_VERSION }}
steps:
- uses: actions/checkout@v4
Expand All @@ -19,16 +33,15 @@ jobs:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Cache local Maven repository
uses: actions/cache/restore@v4
with:
path: ~/.m2/repository
key: ${{ needs.build.outputs.cache_key }}
## Force cache hit to avoid analyzing with incomplete dependencies
fail-on-cache-miss: true
- name: Install Samtools
run: sudo apt-get install samtools
- name: Install dependencies branches
run: |
if [ -f "./.github/workflows/scripts/get_same_branch.sh" ]; then
chmod +x ./.github/workflows/scripts/get_same_branch.sh
./.github/workflows/scripts/get_same_branch.sh ${{ github.ref_name }}
else
echo "./.github/workflows/scripts/get_same_branch.sh does not exist."
fi
- name: Test and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public boolean write(Variant variant) {
PopulationFrequency populationFrequency = converter.convert(studyId,
variantStats, variant.getReference(), variant.getAlternate());
// Write only frequencies non zero
if (populationFrequency.getAltAlleleFreq() > 0 && !populationFrequency.getAltAlleleFreq().isNaN()) {
if (populationFrequency.getAltAlleleFreq() > 0 && !Float.isNaN(populationFrequency.getAltAlleleFreq())) {
frequencies.add(populationFrequency);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,18 @@ private void checkStats(List<SampleVariantStats> sampleStats) {
for (SampleVariantStats sampleStat : sampleStats) {
Assert.assertFalse(Float.isNaN(sampleStat.getQualityAvg()));
Assert.assertFalse(Float.isInfinite(sampleStat.getQualityAvg()));
Assert.assertEquals(0, sampleStat.getDepthCount().getNa().intValue());
Assert.assertEquals(0, sampleStat.getDepthCount().getNa());
int dp = Integer.parseInt(sampleStat.getId().substring(1)) * 10;
if (dp < 5) {
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt5().intValue());
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt5());
} else if (dp < 10) {
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt10().intValue());
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt10());
} else if (dp < 15) {
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt15().intValue());
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt15());
} else if (dp < 20) {
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt20().intValue());
Assert.assertNotEquals(0, sampleStat.getDepthCount().getLt20());
} else {
Assert.assertNotEquals(0, sampleStat.getDepthCount().getGte20().intValue());
Assert.assertNotEquals(0, sampleStat.getDepthCount().getGte20());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ public void testStudyStats() throws Exception {

System.out.println("stats = " + stats);

assertEquals(variants, stats.getVariantCount().intValue());
assertEquals(variants, stats.getVariantCount());
assertEquals(((int) (files * variants * passVariants)), stats.getFilterCount().get("PASS").intValue());
assertEquals(files, stats.getFilesCount().intValue());
assertEquals(files * samplesPerFile, stats.getSampleCount().intValue());
assertEquals(files, stats.getFilesCount());
assertEquals(files * samplesPerFile, stats.getSampleCount());
assertEquals(files * samplesPerFile * variants, stats.getGenotypeCount().values().stream().reduce(Long::sum).orElse(0L).intValue());
}

Expand All @@ -154,10 +154,10 @@ public void testFileStats() throws Exception {
}
stDev = Math.sqrt(stDev / quals.length);

assertEquals(variants, stats.getVariantCount().intValue());
assertEquals(variants, stats.getVariantCount());
assertEquals(((int) (variants * passVariants)), stats.getFilterCount().get("PASS").intValue());
assertEquals(1, stats.getFilesCount().intValue());
assertEquals(samplesPerFile, stats.getSampleCount().intValue());
assertEquals(1, stats.getFilesCount());
assertEquals(samplesPerFile, stats.getSampleCount());
assertEquals(samplesPerFile * variants, stats.getGenotypeCount().values().stream().reduce(Long::sum).orElse(0L).intValue());

assertEquals(mean, stats.getQualityAvg(), 0.000001);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<jackson.version>2.14.3</jackson.version>
<collections.version>4.4</collections.version>
<avro.version>1.7.7</avro.version>
<avro.version>1.11.4</avro.version>
<protobuf.version>3.11.4</protobuf.version>
<grpc.version>1.28.1</grpc.version>
<htsjdk.version>2.23.0</htsjdk.version>
Expand Down