pipe zcat stdin into java program that takes multiple inputs - java

I have a gzipped file that is too large to unzip and save. I'm looking to use zcat to unzip it and feed it into a java program that takes in multiple inputs. This program has the format:
java -jar GenomeAnalysisTK.jar \
-T FastaAlternateReferenceMaker \
-R refgen.fa \
-o output.fasta \
-V data.vcf
Where after -V is supposed to be the input from the gzipped file. I've tried something like:
zcat data.vcf.gz | java -jar GenomeAnalysisTK.jar \
-T FastaAlternateReferenceMaker \
-R refgen.fa \
-o output.fasta \
-V
But this does not work. How can I solve this issue?

Related

Can I compile OpenCV source code from a MacBook M1 to create libraries ( like core and java ) for intel based MacBook

I've already built and created the libraries I needed for my project for Windows [.dll] and Mac OS X (Arm based) [.dylib]. The fact is that, given the processor difference, I don't know If I can make the *.so libraries ( at least I think that the extension of the libraries , from what I've found after searching A LOT ).
If someone knows and says otherwise, I'll take as given that it's not possible to do it.
The method I've used is the one via cmake.
Example :
cmake -DCMAKE_SYSTEM_PROCESSOR=arm64 \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DWITH_OPENJPEG=OFF \
-DWITH_IPP=OFF \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=/usr/local/opencv \
-D JAVA_INCLUDE_PATH=$JAVA_HOME/include \
-D JAVA_AWT_LIBRARY=$JAVA_HOME/jre/lib/amd64/libawt.so \
-D JAVA_JVM_LIBRARY=$JAVA_HOME/jre/lib/arm/server/libjvm.so \
-D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib-4.5.5/modules \
-D WITH_FFMPEG=OFF \
-D WITH_OPENCL=OFF \
-D BUILD_opencv_java=ON \
-D OPENCV_ENABLE_NONFREE=ON \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=OFF \
-D BUILD_ZLIB=OFF \
-D BUILD_EXAMPLES=ON ../opencv-4.5.5
I know the question is almost stupid, but I'll still want to be sure. Thank you guys <3

How to save output predictions into a CSV in weka using command-line by loading a saved model?

I am running a weka command to predict by loading an already trained and saved model. I need these predictions of the test file on the loaded model to be saved as a CSV file. What command should I use in commandline to do the same.
I have already tried the following:
java -cp /usr/share/java/weka.jar -Xmx28G weka.classifiers.meta.FilteredClassifier \
-classifications "weka.classifiers.evaluation.output.prediction.CSV -p 1-3,20,29" \
-T test.arff -l ./j48.model > only_predictions.csv
I have tried the above command with all the permutations of placing the -classifications "weka..." at different places in the same command itself as was suggested in some answer to similar question. It gives me illegal option "-classifications" error each time.
-classifications "weka.classifiers.evaluation.output.prediction.CSV -p first" \
-l $model \
-T $dataset \
|tail -n+6 |head -n -1
This also didn't work for me as was suggested in one of the similar question.
Also tried training and predicting in a single command but didn't work
java -cp /usr/share/java/weka.jar -Xmx28G weka.classifiers.meta.FilteredClassifier -classifications \
"weka.classifiers.evaluation.output.prediction.CSV -p 1-3,20,29 -distribution -file predictions.csv" \
-t ${g1_train_arff} -T test.arff -F "weka.filters.unsupervised.attribute.Remove -R 1,26,28" \
-W weka.classifiers.trees.J48 -c last -- -C 0.25 -M 5
Also, using java -cp /usr/share/java/weka.jar weka.core.Version command gives me 3.6.10.
I expected a proper csv file created with the output prediction values along with the attribute range given with the -p option.
Please help me with the problem. Thanks in advance.

I am getting error when running Dockerfile

I am getting error like find: '/opt/ibm/wlp/bin': No such file or directory when building a docker image
FROM centos:latest
RUN yum -y install wget unzip;
ENV JAVA_VERSION 1.8.0_sr5fp7
ENV LIBERTY_VERSION 17.0.0_04
RUN export BASE_URL="https://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/meta/sdk/linux/x86_64/index.yml"; \
wget -q -U UA_IBM_JAVA_Docker -O /tmp/index.yml ${BASE_URL}; \
JAVA_URL=$(cat /tmp/index.yml | sed -n '/'${JAVA_VERSION}'/{n;p}' | sed -n 's/\s*uri:\s//p' | tr -d '\r'); \
wget -q -U UA_IBM_JAVA_Docker -O /tmp/ibm-java.bin ${JAVA_URL}; \
echo "INSTALLER_UI=silent" > /tmp/response.properties; \
echo "USER_INSTALL_DIR=/opt/ibm/java" >> /tmp/response.properties; \
echo "LICENSE_ACCEPTED=TRUE" >> /tmp/response.properties; \
mkdir -p /opt/ibm; \
chmod +x /tmp/ibm-java.bin; \
/tmp/ibm-java.bin -i silent -f /tmp/response.properties; \
rm -f /tmp/response.properties; \
rm -f /tmp/index.yml; \
rm -f /tmp/ibm-java.bin; \
cd /opt/ibm/java/jre/lib; \
rm -rf icc;
ENV JAVA_HOME=/opt/ibm/java/jre \
PATH=/opt/ibm/java/jre/bin:$PATH
RUN echo ${JAVA_HOME}; \
echo ${PATH};
RUN export LIB_BASE_URL="https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/downloads/wlp/index.yml"; \
wget -q -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/index.yml ${LIB_BASE_URL}; \
LIBERTY_URL=$(cat /tmp/index.yml | sed -n '/'${LIBERTY_VERSION}'/{n;p}' | sed -n 's/\s*uri:\s//p' | tr -d '\r'); \
wget $LIBERTY_URL -U UA-IBM-WebSphere-Liberty-Docker -O /tmp/wlp.zip; \
unzip -q /tmp/wlp.zip -d /opt/ibm; \
rm -f /tmp/wlp.zip;
ENV PATH=/opt/ibm/wlp/bin:$PATH
LABEL "ProductID"="fbf6a96d49214c0abc6a3bc5da6e48cd"; \
"ProductName"="WebSphere Application Server Liberty"; \
"ProductVersion"="17.0.0.4";
RUN find /opt/ibm/wlp/bin -type f -exec chmod 777 {} \;
RUN /opt/ibm/wlp/bin/server create;
ADD server.xml /opt/ibm/wlp/usr/servers/defaultServer/server.xml
RUN /opt/ibm/wlp/bin/installUtility install --acceptLicense webProfile-7.0 localConnector-1.0 jndi-1.0 adminCenter-1.0 appSecurity-2.0 concurrent-1.0 \
ldapRegistry-3.0 javaMail-1.5 jdbc-4.1 jaxrs-2.0 jpa-2.1 ssl-1.0 webCache-1.0;
ADD lib /opt/ibm/wlp/usr/servers/defaultServer/lib
ADD apps /opt/ibm/wlp/usr/servers/defaultServer/apps
ADD resources /opt/ibm/wlp/usr/servers/defaultServer/resources
ADD server.xml /opt/ibm/wlp/usr/servers/defaultServer/server.xml
EXPOSE 9080
EXPOSE 9043
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]
getting below message : The command '/bin/sh -c find /opt/ibm/wlp/bin -type f -exec chmod 777 {} \;' returned a non-zero code: 1
not sure what is wrong ,please help

WildFly command inside domain.sh

Inside the domain.sh file that comes with WildFly Final 8.0.0 we can see the line in which java is actually being called:
eval \"$JAVA\" -D\"[Process Controller]\" $PROCESS_CONTROLLER_JAVA_OPTS \
\"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/process-controller.log\" \
\"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \
-jar \"$JBOSS_HOME/jboss-modules.jar\" \
-mp \"${JBOSS_MODULEPATH}\" \
org.jboss.as.process-controller \
-jboss-home \"$JBOSS_HOME\" \
-jvm \"$JAVA_FROM_JVM\" \
-mp \"${JBOSS_MODULEPATH}\" \
-- \
\"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/host-controller.log\" \
\"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \
$HOST_CONTROLLER_JAVA_OPTS \
-- \
-default-jvm \"$JAVA_FROM_JVM\" \
'"$#"' "&"
I understand most of the commands, but I have not being able to find what does the double dashes do "--" in a java argument context. How are the arguments between the two sets of double dashes interpreted by the jvm?
Double dash is used to signify end of the command options.
If you replace 'eval' on 'echo' you will see doubled OPTS like '-server -Xms64m -Xmx512m'
This means first settings are for Process Controller after -- you have settings for Host Controller

Mahout CVB topics file

I can't understand the output, maybe someone can help
cvb command
bin/mahout cvb \
-i /work/matrix \
-o /work/cvb -k 10 -ow -x 20 \
-dict /work/sparseVectors/dictionary.file-* \
-dt /work/topics \
-mt /work/models
After cvb and vector dump
bin/mahout vectordump -i /work/topics \
-d /work/sparseVectors/dictionary.file-* \
-o /work/cvb-topic \
-dt sequencefile --vectorSize 10 \
-sort /work/topics \
-p TRUE
the file cvb-topic has something like
0 {0:0.5380152557598438,09:0.4619846630645179,10:1.541304295897372E-8,08:1.5405183424669223E-8,04:1.4964621316424798E-8,01:1.0302427985842305E-8,00:7.566567734425231E-9,1:7.394593812516846E-9,1.180:6.745071922943742E-9,07:3.3841292288528656E-9}
What do i do with it next ?
I had the same issue today, to get probabilities for words, use instead -i /work/cvb

Categories

Resources