Skip to content

Commit

Permalink
align: build the dynamic library for hpg-aligner and fix build.sh. #8
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarraga committed Jun 2, 2015
1 parent ab1d8ea commit 4f43427
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public void execute() {
logger.error("To align BAM, the input BAM file '{}' must be stored in the HDFS/Haddop. Use the command 'convert bam2avro' to import your file.", bamAlignCommandOptions.input);
System.exit(-1);
}

/*
if (!PathUtils.isHdfs(bamAlignCommandOptions.index)) {
logger.error("To align BAM, the index folder '{}' must be stored in the HDFS/Haddop.", bamAlignCommandOptions.index);
System.exit(-1);
}

*/
if (!PathUtils.isHdfs(bamAlignCommandOptions.output)) {
logger.error("To align BAM, the output folder '{}' must be stored in the HDFS/Haddop.", bamAlignCommandOptions.output);
System.exit(-1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,12 @@ public void execute() {
logger.error("To align fastq, the input FastQ file '{}' must be stored in the HDFS/Haddop. Use the command 'convert fastq2sa' to import your file.", fastqAlignCommandOptions.input);
System.exit(-1);
}

/*
if (!PathUtils.isHdfs(fastqAlignCommandOptions.index)) {
logger.error("To align fastq, the index folder '{}' must be stored in the HDFS/Haddop.", fastqAlignCommandOptions.index);
System.exit(-1);
}

*/
if (!PathUtils.isHdfs(fastqAlignCommandOptions.output)) {
logger.error("To align fastq, the output folder '{}' must be stored in the HDFS/Haddop.", fastqAlignCommandOptions.output);
System.exit(-1);
Expand Down
53 changes: 30 additions & 23 deletions hpg-bigdata-core/native/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ echo "Building the dynamic library $olib"

#gcc -O3 -std=gnu99 src/*.c src/rna/*.c src/dna/*.c src/build-index/*.c src/tools/bam/aux/*.c src/tools/bam/recalibrate/*.c src/tools/bam/aligner/*.c -o final.so -shared -fPIC -I src -I src/rna -I src/dna -I src/build-index/ -I src/tools/bam/ -I src/tools/bam/recalibrate/ -I src/tools/bam/aligner/ -I lib/hpg-libs/third_party/ -I lib/hpg-libs/third_party/htslib/ -I lib/hpg-libs/c/src/ -I jni/ -I third-party/hpg-aligner -I $JAVA_HOME/include -I $JAVA_HOME/include/linux -I $JAVA_HOME/include/darwin

hpg_alinger_home="../../../hpg-aligner"
hpg_libs_home="../../../hpg-aligner/lib/hpg-libs/c/src"
cprops_home="../../../hpg-aligner/lib/hpg-libs/third_party"
gcc -O3 -std=gnu99 jni/org_opencb_hpg_bigdata_core_NativeAligner.c ./third-party/hpg-aligner/index.c \
hpg_aligner_home="../../../hpg-aligner"
hpg_libs_home="$hpg_aligner_home/lib/hpg-libs/c/src"
cprops_home="$hpg_aligner_home/lib/hpg-libs/third_party"

gcc -O3 -std=gnu99 -m64 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
jni/org_opencb_hpg_bigdata_core_NativeAligner.c \
./third-party/hpg-aligner/index.c \
./third-party/hpg-aligner/mapper.c \
$cprops_home/cprops/avl.c \
$cprops_home/cprops/collection.c \
$cprops_home/cprops/hashlist.c \
Expand All @@ -71,31 +75,34 @@ gcc -O3 -std=gnu99 jni/org_opencb_hpg_bigdata_core_NativeAligner.c ./third-party
$hpg_libs_home/bioformats/fastq/*.c \
$hpg_libs_home/bioformats/bam/*.c \
$hpg_libs_home/aligners/bwt/bwt_commons.c \
$hpg_libs_home/aligners/bwt/csalib/*.c \
$hpg_libs_home/aligners/bwt/dbwt/*.c \
$hpg_libs_home/aligners/bwt/search/*.c \
$hpg_libs_home/aligners/bwt/genome.c \
$hpg_libs_home/aligners/bwt/bwt.c \
$hpg_libs_home/aligners/sw/macros.c \
$hpg_libs_home/aligners/sw/sse.c \
$hpg_libs_home/aligners/sw/smith_waterman.c \
$hpg_alinger_home/src/*.c \
$hpg_alinger_home/src/rna/*.c \
$hpg_alinger_home/src/dna/*.c \
$hpg_alinger_home/src/dna/clasp_v1_1/*.c \
$hpg_alinger_home/src/sa/*.c \
$hpg_alinger_home/src/build-index/*.c \
$hpg_alinger_home/src/tools/bam/aux/*.c \
$hpg_alinger_home/src/tools/bam/recalibrate/*.c \
$hpg_alinger_home/src/tools/bam/aligner/*.c \
$hpg_aligner_home/src/*.c \
$hpg_aligner_home/src/rna/*.c \
$hpg_aligner_home/src/dna/*.c \
$hpg_aligner_home/src/dna/clasp_v1_1/*.c \
$hpg_aligner_home/src/sa/*.c \
$hpg_aligner_home/src/build-index/*.c \
$hpg_aligner_home/src/tools/bam/aux/*.c \
$hpg_aligner_home/src/tools/bam/recalibrate/*.c \
$hpg_aligner_home/src/tools/bam/aligner/*.c \
-o $olib -shared -fPIC \
-I $hpg_alinger_home/src \
-I $hpg_alinger_home/src/rna \
-I $hpg_alinger_home/src/dna \
-I $hpg_alinger_home/src/build-index/ \
-I $hpg_alinger_home/src/tools/bam/ \
-I $hpg_alinger_home/src/tools/bam/recalibrate/ \
-I $hpg_alinger_home/src/tools/bam/aligner/ \
-I $hpg_alinger_home/lib/hpg-libs/third_party/ \
-I $hpg_alinger_home/lib/hpg-libs/third_party/htslib/ \
-I $hpg_alinger_home/lib/hpg-libs/c/src/ \
-I $hpg_aligner_home/src \
-I $hpg_aligner_home/src/rna \
-I $hpg_aligner_home/src/dna \
-I $hpg_aligner_home/src/build-index/ \
-I $hpg_aligner_home/src/tools/bam/ \
-I $hpg_aligner_home/src/tools/bam/recalibrate/ \
-I $hpg_aligner_home/src/tools/bam/aligner/ \
-I $hpg_aligner_home/lib/hpg-libs/third_party/ \
-I $hpg_aligner_home/lib/hpg-libs/third_party/htslib/ \
-I $hpg_aligner_home/lib/hpg-libs/c/src/ \
-I jni/ \
-I third-party/hpg-aligner \
-I /usr/include/libxml2 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ JNIEXPORT void JNICALL Java_org_opencb_hpg_bigdata_core_NativeAligner_free_1inde
JNIEXPORT jstring JNICALL Java_org_opencb_hpg_bigdata_core_NativeAligner_map
(JNIEnv *env, jobject this, jstring fastq, jlong index, jlong params) {

const char *reads = (*env)->GetStringUTFChars(env, fastq, NULL);
char *sam = map(reads, (void *)index);

printf("Java_org_opencb_hpg_bigdata_core_NativeAligner_map, params:\n");
aligner_params_display((aligner_params_t *) params);

const char *reads = (*env)->GetStringUTFChars(env, fastq, NULL);
char *sam = map(reads, (void *)index);

jstring res = (*env)->NewStringUTF(env, sam);

// free memory
Expand Down

0 comments on commit 4f43427

Please sign in to comment.