How to resolve a "Metadata error: chr must be valid" error on Linux? - perl

I am relatively new to the world of coding, so I am having trouble resolving an issue when running TranslocWrapper.pl tutorial_metadata.txt preprocess/ results/ --threads 2. I am trying to run the HTGTS Pipeline according to this GitHub project. This is the full error:
. Library Genome Chr Start End Strand
1 RAG1A_SRep2 hg19 chr11 36594878 36595030 -
Metadata error: chr must be valid at /home/micah/transloc_pipeline/bin/TranslocWrapper.pl line 285.
main::check_validity_of_metadata('HASH(0x2903ac8)') called at /home/micah/transloc_pipeline/bin/TranslocWrapper.pl line 248
main::read_in_meta_file() called at /home/micah/transloc_pipeline/bin/TranslocWrapper.pl line 90
I have already double-checked the successful installation of the Software Dependencies, so everything should be all good, but I am having trouble interpreting the "Metadata error: chr must be valid at ..." line. If it helps, these are the specific lines that are being called in the error:
TranslocWrapper.pl line 285:
croak "Metadata error: chr must be valid" unless grep { $_ eq $expt->{chr} } #chrlist;
TranslocWrapper.pl line 248:
check_validity_of_metadata($expt);
TranslocWrapper.pl line 90:
read_in_meta_file;
Thanks in advance for the help!

So the error is saying that one of the sequence characters in the metadata file is not present in the sequence's assembly file.
Given that this is the provided example you should assume that the data is correct and your invocation is faulty.
Have you done the TranslocPreprocess.pl preprocessing steps?
If you have try looking at the first line of the metadata file, identify the assembly entry. Ensure that the assembly file exists and that it contains the required sequence.
One common problem with this kind of code is the case of the filenames. The examples are designed to be run in Linux where filename case matters. Windows likes to pretend that case doesn't matter, this can cause problems. If you are running this code from Microsoft Windows or extracted any of the archives from within Windows this is a likely cause of the error.

Related

Configure ac code fails to detect libXI presence

I am currently executing the configure script of gtk. It tests for the presence of XInput, and it stops the execution with the error message:"configure: error: *** XInput2 extension not found. Check 'config.log' for more details.
Looking at config.log, it says "configure:23050: error: *** XInput2 extension not found. Check 'config.log' for more details."
So, the same except for the line number.
Then I decided to look at configure.ac. There I found the full Xi detection test that it is:
if $PKG_CONFIG --exists "xi" ; then
X_PACKAGES="$X_PACKAGES xi"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xi"
AC_CHECK_HEADER(X11/extensions/XInput2.h,
have_xinput2=yes
AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
gtk_save_LIBS="$LIBS"
LIBS="$LIBS -lXi"
# Note that we also check that the XIScrollClassInfo struct is defined,
# because at least Ubuntu Oneiric seems to have XIAllowTouchEvents(), but not the XIScrollClassInfo struct.
AC_CHECK_FUNC([XIAllowTouchEvents],
[AC_CHECK_MEMBER([XIScrollClassInfo.number],
have_xinput2_2=yes
AC_DEFINE(XINPUT_2_2, 1, [Define to 1 if XInput 2.2 is available]),
have_xinput2_2=no,
[[#include <X11/extensions/XInput2.h>]])])
LIBS="$gtk_save_LIBS"
if test "x$have_xinput2_2" = "xyes"; then
X_EXTENSIONS="$X_EXTENSIONS XI2.2"
else
X_EXTENSIONS="$X_EXTENSIONS XI2"
fi
fi
AS_IF([test "x$have_xinput2" != "xyes"],
[AC_MSG_ERROR([*** XInput2 extension not found. Check 'config.log' for more details.])])
I am no expert about setting configure.ac, but I thought that this line: "if $PKG_CONFIG --exists "xi" ; then" would be satisfied by this parameter that I pass to configure:
PKG_CONFIG_PATH=:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/lib/pkgconfig/
Also this line:
AC_CHECK_HEADER(X11/extensions/XInput2.h,
have_xinput2=yes
AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
could not have been satisfied by this parameter that I pass to configure?
CPPFLAGS=-I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/include/
I am a bit lost as to why it doesn't detect nothing.
A curious point that I read in the documentation is that there is a parameter called: --disable-xinput.
Well I am passing it to configure and it obviously didn't disable the test. So I would appreciate any suggestions about how to change the test to try to figure out what is wrong with it (or with my system)
Solution found
If I replace:
if $PKG_CONFIG --exists "xi" ; then
on configure.ac, by:
if $PKG_CONFIG --print-errors --exists "xi" ; then
and then execute autoconf, it will generate a new configure based on this "new" configure.ac that will print all the required libraries that should be passed to configure.
First it was the .pc file of libXi, then the pc. file of Inputproto (that I had to download and install) an so on. I also really had to add libXi's include dir to CPPFLAGS, so it could find XInput2.h.
My final configure command was:
LD_LIBRARY_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.41.2/lib/ CPPFLAGS="-I/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/include/ -I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xorgproto-2018.1/include/ -I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/include/" LDFLAGS="-L/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/lib/" ./configure --prefix=/media/34GB/Arquivos-de-Programas-Linux/Gtk+-3.4.0 PKG_CONFIG_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.41.2/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Atk-2.15.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pango-1.30.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Cairo-1.10.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.30.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pixman-0.18.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Fontconfig-2.8.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Freetype-2.2.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Png-1.2.14/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Inputproto-1.5.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xorgproto-2018.1/share/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xcb-1.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Pthread-stubs-0.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xau-1.0.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xext-1.1.1/lib/pkgconfig/

How can I get "HelloWorld - BitBake Style" working on a newer version of Yocto?

In the book "Embedded Linux Systems with the Yocto Project", Chapter 4 contains a sample called "HelloWorld - BitBake style". I encountered a bunch of problems trying to get the old example working against the "Sumo" release 2.5.
If you're like me, the first error you encountered following the book's instructions was that you copied across bitbake.conf and got:
ERROR: ParseError at /tmp/bbhello/conf/bitbake.conf:749: Could not include required file conf/abi_version.conf
And after copying over abi_version.conf as well, you kept finding more and more cross-connected files that needed to be moved, and then some relative-path errors after that... Is there a better way?
Here's a series of steps which can allow you to bitbake nano based on the book's instructions.
Unless otherwise specified, these samples and instructions are all based on the online copy of the book's code-samples. While convenient for copy-pasting, the online resource is not totally consistent with the printed copy, and contains at least one extra bug.
Initial workspace setup
This guide assumes that you're working with Yocto release 2.5 ("sumo"), installed into /tmp/poky, and that the build environment will go into /tmp/bbhello. If you don't the Poky tools+libraries already, the easiest way is to clone it with:
$ git clone -b sumo git://git.yoctoproject.org/poky.git /tmp/poky
Then you can initialize the workspace with:
$ source /tmp/poky/oe-init-build-env /tmp/bbhello/
If you start a new terminal window, you'll need to repeat the previous command which will get get your shell environment set up again, but it should not replace any of the files created inside the workspace from the first time.
Wiring up the defaults
The oe-init-build-env script should have just created these files for you:
bbhello/conf/local.conf
bbhello/conf/templateconf.cfg
bbhello/conf/bblayers.conf
Keep these, they supersede some of the book-instructions, meaning that you should not create or have the files:
bbhello/classes/base.bbclass
bbhello/conf/bitbake.conf
Similarly, do not overwrite bbhello/conf/bblayers.conf with the book's sample. Instead, edit it to add a single line pointing to your own meta-hello folder, ex:
BBLAYERS ?= " \
${TOPDIR}/meta-hello \
/tmp/poky/meta \
/tmp/poky/meta-poky \
/tmp/poky/meta-yocto-bsp \
"
Creating the layer and recipe
Go ahead and create the following files from the book-samples:
meta-hello/conf/layer.conf
meta-hello/recipes-editor/nano/nano.bb
We'll edit these files gradually as we hit errors.
Can't find recipe error
The error:
ERROR: BBFILE_PATTERN_hello not defined
It is caused by the book-website's bbhello/meta-hello/conf/layer.conf being internally inconsistent. It uses the collection-name "hello" but on the next two lines uses _test suffixes. Just change them to _hello to match:
# Set layer search pattern and priority
BBFILE_COLLECTIONS += "hello"
BBFILE_PATTERN_hello := "^${LAYERDIR}/"
BBFILE_PRIORITY_hello = "5"
Interestingly, this error is not present in the printed copy of the book.
No license error
The error:
ERROR: /tmp/bbhello/meta-hello/recipes-editor/nano/nano.bb: This recipe does not have the LICENSE field set (nano)
ERROR: Failed to parse recipe: /tmp/bbhello/meta-hello/recipes-editor/nano/nano.bb
Can be fixed by adding a license setting with one of the values that bitbake recognizes. In this case, add a line onto nano.bb of:
LICENSE="GPLv3"
Recipe parse error
ERROR: ExpansionError during parsing /tmp/bbhello/meta-hello/recipes-editor/nano/nano.bb
[...]
bb.data_smart.ExpansionError: Failure expanding variable PV_MAJOR, expression was ${#bb.data.getVar('PV',d,1).split('.')[0]} which triggered exception AttributeError: module 'bb.data' has no attribute 'getVar'
This is fixed by updating the special python commands being used in the recipe, because #bb.data was deprecated and is now removed. Instead, replace it with #d, ex:
PV_MAJOR = "${#d.getVar('PV',d,1).split('.')[0]}"
PV_MINOR = "${#d.getVar('PV',d,1).split('.')[1]}"
License checksum failure
ERROR: nano-2.2.6-r0 do_populate_lic: QA Issue: nano: Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM) [license-checksum]
This can be fixed by adding a directive to the recipe telling it what license-info-containing file to grab, and what checksum we expect it to have.
We can follow the way the recipe generates the SRC_URI, and modify it slightly to point at the COPYING file in the same web-directory. Add this line to nano.bb:
LIC_FILES_CHKSUM = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
The MD5 checksum in this case came from manually downloading and inspecting the matching file.
Done!
Now bitbake nano ought to work, and when it is complete you should see it built nano:
/tmp/bbhello $ find ./tmp/deploy/ -name "*nano*.rpm*"
./tmp/deploy/rpm/i586/nano-dbg-2.2.6-r0.i586.rpm
./tmp/deploy/rpm/i586/nano-dev-2.2.6-r0.i586.rpm
I have recently worked on that hands-on hello world project. As far as I am concerned, I think that the source code in the book contains some bugs. Below there is a list of suggested fixes:
Inheriting native class
In fact, when you build with bitbake that you got from poky, it builds only for the target, unless you mention in your recipe that you are building for the host machine (native). You can do the latter by adding this line at the end of your recipe:
inherit native
Adding license information
It is worth mentioning that the variable LICENSE is important to be set in any recipe, otherwise bitbake rises an error. In our case, we try to build the version 2.2.6 of the nano editor, its current license is GPLv3, hence it should be mentioned as follow:
LICENSE = "GPLv3"
Using os.system calls
As the book states, you cannot dereference metadata directly from a python function. Which means it is mandatory to access metadata through the d dictionary. Bellow, there is a suggestion for the do_unpack python function, you can use its concept to code the next tasks (do_configure, do_compile):
python do_unpack() {
workdir = d.getVar("WORKDIR", True)
dl_dir = d.getVar("DL_DIR", True)
p = d.getVar("P", True)
tarball_name = os.path.join(dl_dir, p+".tar.gz")
bb.plain("Unpacking tarball")
os.system("tar -x -C " + workdir + " -f " + tarball_name)
bb.plain("tarball unpacked successfully")
}
Launching the nano editor
After successfully building your nano editor package, you can find your nano executable in the following directory in case you are using Ubuntu (arch x86_64):
./tmp/work/x86_64-linux/nano/2.2.6-r0/src/nano
Should you have any comments or questions, Don't hesitate !

Configuring OpenDDS

I am trying to configure the environment for OpenDDS, but I could not run the configure script. Would really appreciate much, if there are any insight from you guys. =D
So basically, after I download the OpenDDS-3.12.zip from here. I have extracted to a folder and tried to run the configure file with this command in VS command prompt (VS2017)
configure --compiler=gcc
Next, the "ACE+TAO-2.2a_with_latest_patches_NO_makefiles" is downloaded and I extract the zip file to the root folder.
Then it shows this message.
ACE_ROOT/ace/config.h exists, skipping configuration of ACE+TAO
Use of uninitialized value $mpctype in string eq at configure line 1103.
Use of uninitialized value $mpctype in concatenation (.) or string at configure line 1257.
Use of uninitialized value $mpctype in string eq at configure line 1266.
Running MPC to generate project files.
MPC_ROOT was set to C:\src\OpenDDS-DDS-3.12.2\ACE_wrappers\MPC.
Using .../OpenDDS-DDS-
3.12.2/ACE_wrappers/bin/MakeProjectCreator/config/MPC.cfg
ERROR: Invalid type: C:\src\OpenDDS-DDS-3.12.2\DDS_TAOv2_all.mwc
mwc.pl v4.1.28
...
/*lots of explanation of each file here*
*then followed by*/
...
ERROR: Error from MPC, stopped at configure line 1270.
I have both Visual Studio 2017 and Perl 5.22 installed as well, I am not sure whether if this is a compiler issue or any other issue. The following is the configure script that printed the error above.
## line 1268 -- 1270 ##
if (!$opts{'dry-run'}) {
if (system("perl \"$ENV{'ACE_ROOT'}/bin/mwc.pl\" $mwcargs") != 0) {
die "ERROR: Error from MPC, stopped";
}
}
$mpctype is defined here:
my $mpctype = ($slash eq '/' ||
($cross_compile && $buildEnv->{'build'} eq 'target'))
? 'gnuace' : $opts{'compiler_version'};
It seems to be looking at $opts{'compiler_version'}, which is apparently empty. %opts is defined here:
my %opts = %{parseArgs()};
so it looks like you should define the compiler_version in the command line or define the target platform. It's probably better if you check out the INSTALL options thoroughly
VS2017 doesn't install c++ compiler by default.
Modify VS 2017 and select c++ compiler and install if VS 2017 already install.
configure (without --compiler=gcc flag)
I had a similar question. Being a newbie, I started with the getting started with java and windows on https://opendds.org/quickstart/GettingStartedWindows.html .
Step 5, "configure (To enable Java support, use configure --java)" didn't work in a visual studio command window despite
having set JAVA_HOME. I had sent ACE_ROOT, DDS_ROOT, TAO_ROOT and MPC_ROOT though the tutorial didn't specify based on trying to debug this problem.
When using the "--compiler" option I get errors similar to the ones in this thread. Was there any resolution just to get the"
"off-the-shelf" tutorial working. Using Windows 10.
D:\data\OpenDDS-3.13.3>configure --java --compiler="C:\Program Files\Java\jdk1.8.0_221\bin"
ACE_ROOT/ace/config.h exists, skipping configuration of ACE+TAO
Use of uninitialized value $mpctype in string eq at configure line 1482.
Use of uninitialized value $mpctype in concatenation (.) or string at configure line
1646.
Use of uninitialized value $mpctype in string eq at configure line 1655.
Running MPC to generate project files.
MPC_ROOT was set to D:\data\OpenDDS-3.13.3\ACE_WRAPPERS\MPC.
Using .../OpenDDS-3.13.3/ACE_WRAPPERS/bin/MakeProjectCreator/config/MPC.cfg
ERROR: Invalid type: D:\data\OpenDDS-3.13.3\DDS_TAOv2_all.mwc
mwc.pl v4.1.44
...
ERROR: Error from MPC, stopped at configure line 1659.

Cudafy chapter 3 example has path issue how to fix?

Using Cudafy version 1.29, which can be downloaded from here
I am executing the examples that are found in the install folder CudafyV1.29\CudafyByExample\
Specifically, "chapter 3" example that begins line 42 of program.cs calls the following:
simple_kernel.Execute();
which is this:
public static void Execute()
{
CudafyModule km = CudafyTranslator.Cudafy(); // <--exception thrown!
GPGPU gpu = CudafyHost.GetDevice(CudafyModes.Target, CudafyModes.DeviceId);
gpu.LoadModule(km);
gpu.Launch().thekernel(); // or gpu.Launch(1, 1, "kernel");
Console.WriteLine("Hello, World!");
}
The indicated line throws this exception:
Compilation error: CUDAFYSOURCETEMP.cu
'C:\Program' is not recognized as an internal or external command,
operable program or batch file. .
Which is immediately obvious that the path has spaces and the programmer did not double quote or use ~ to make it operational.
So, I did not write this code. And I cannot step through the sealed code contained within CudafyModule km = CudafyTranslator.Cudafy();In fact I don't even know the full path that is causing the exception, it is cut-off in the exception message.
Does anyone have a suggestion for how to fix this issue?
Update #1: I discovered where CUDAFYSOURCETEMP.cu lives on my computer, here it is:
C:\Users\humphrt\Desktop\Active Projects\Visual Studio
Projects\CudafyV1.29\CudafyByExample\bin\Debug
...I'm still trying to determine what the program is looking for along the path to 'C:\Program~'.
I was able to apply a workaround to bypass this issue. The workaround is to reinstall all components of cudafy in to folders with paths with no ' ' (spaces). My setup looks like the below screenshot. Notice that I also installed the CUDA TOOLKIT from NVIDIA in the same folder - also with no spaces in folder names.
I created a folder named "C:\CUDA" and installed all components within it, here is the folder structure:

finding error in command line

I am trying to run some kind of programm using command line, but I got an error.
The command line is:
quantisnp2.exe --outdir D:\output\ --config "C:\Program files\QuantiSNP\params.dat" --levels "C:\Program files\QuantiSNP\levels.dat" --sampleid CNV1 --gender female --emiters 10 --Lsettings 2000000 --doXcorrect --genotypes --gcdir D:\gc\ --input-files C:\Program files\CNV1.txt
QuantiSNP:Single-file mode input find.
QuantiSNP:Processing file: C:|Program
QuantiSNP:Local CG content directory specified. Local CG content correction will be used.
??? Error using ==>textread at 167
File not found.
Error in ==> quantisnp2 at 293
The first thing I'd be looking at is the unquoted C:\Program files\CNV1.txt at the end of the command (all your other ones are quoted).
There's a good chance that's being treated as two arguments, C:\Program and files\CNV1.txt.
You may also want to check the spelling of emiters, I'm pretty certain the correct English word would be emitters though, of course, this could be a case of the QuantiSNP developers not knowing how to spell :-)