Skip to content

Commit

Permalink
Bugfix: Make sure lzf filter is properly built
Browse files Browse the repository at this point in the history
Change port of hdf5server in docker-compose file
to avoid clashing with local java development port.
Use -1 for retrieving all SNPs instead of using the number of accessions
which was calculated anyways wrongly
  • Loading branch information
timeu committed Jun 17, 2020
1 parent 14344e1 commit 67d41a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ USER root
WORKDIR /root
RUN apt update && apt install -y gcc libhdf5-dev git
RUN git clone https://github.com/h5py/h5py.git
RUN cd h5py/lzf && gcc -O2 -fPIC -I/usr/include/hdf5/serial -L/usr/lib/x86_64-linux-gnu/hdf5/serial/ -lhdf5 -shared lzf/*.c lzf_filter.c -o liblzf_filter.so
RUN cd h5py/lzf && gcc -O2 -fPIC -I/usr/include/hdf5/serial -L/usr/lib/x86_64-linux-gnu/hdf5/serial/ -shared lzf/*.c lzf_filter.c -o liblzf_filter.so -lhdf5

FROM jetty:9.4.26-jre8
USER root
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ services:
volumes:
- /net/gmi.oeaw.ac.at/gwasapp/DATA_NEW_BROWSER/:/mnt
ports:
- 8000:8000
- 8001:8000
environment:
GWAS_VIEWER_FOLDER: /mnt/gwas_results
GENOTYPE_FOLDER: /mnt/PYGWAS_GENOTYPES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ private int[] getPositions(IHDF5Reader reader, Integer chr, int start, int end)


private byte[][] getAlleles(IHDF5Reader reader, Integer chr, Integer start, Integer end, LinkedHashSet<String> passportIds) {
HDF5DataSetInformation info = reader.object().getDataSetInformation("snps");
final long accessionCount = info.getNumberOfElements();
List<String> accessionIds = Lists.newArrayList(reader.string().readArray("accessions"));
List<Integer> passportIndices = Lists.newArrayList();
// get the indices of the passportIds
Expand All @@ -123,7 +121,7 @@ private byte[][] getAlleles(IHDF5Reader reader, Integer chr, Integer start, Inte
final int end_pos_ix = chr_region[0] + getPositionIndex(positions, end);
int numberOfSnps = (end_pos_ix - start_pos_ix) + 1;
// get entire snps
final byte[][] snps = reader.int8().readMatrixBlockWithOffset("snps", numberOfSnps, (int) accessionCount, start_pos_ix, 0);
final byte[][] snps = reader.int8().readMatrixBlockWithOffset("snps", numberOfSnps, -1, start_pos_ix, 0);
if (passportIds != null) {
final byte[][] filteredSNPs = new byte[numberOfSnps][passportIds.size()];
for (int i = 0; i < filteredSNPs.length; i++) {
Expand Down

0 comments on commit 67d41a2

Please sign in to comment.