Perl script cannot access Tabix folder - perl

I'm running a Perl script from the EMBL (found here https://github.com/EMBL-EBI-GCA/reseqtrack/blob/master/scripts/variation_data/calculate_allele_frq_from_vcf.pl) Under Ubuntu 16.10 I have installed Vcftools and Tabix as is required and both have been tested to work accordingly. I execute the script with the following command:
perl /home/[user]/calculate_allele_frq_from_vcf.pl \
-vcf /home/[user]/share/1000genomesPhase3VCFFiles/ALL.chr1.phase3_shapeit2_mvncall_integrated_v5a.20130502.genotypes.vcf.gz \
-sample_panel /home/[user]/share/1000genomesPhase3VCFFiles/integrated_call_samples_v3.20130502.ALL.panel \
-out_dir /home/[user]/Desktop/AlleleFrequency \
-tabix /home/[user]/tabix-0.2.6 \
-vcftools_dir /home/[user]/vcftools_0.1.13 \
-region 1:1-10000 \
-pop CEU,FIN \
This returns the following error
Smartmatch is experimental at /home/[user]/calculate_allele_frq_from_vcf.pl line 133.
Smartmatch is experimental at /home/[user]/calculate_allele_frq_from_vcf.pl line 144.
sh: 1: /home/[user]/tabix-0.2.6: Permission denied
Broken VCF header, no column names?
at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 172.
Vcf::throw(Vcf4_2=HASH(0x55761601d320), "Broken VCF header, no column names?") called at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 866
VcfReader::_read_column_names(Vcf4_2=HASH(0x55761601d320)) called at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 601
VcfReader::parse_header(Vcf4_2=HASH(0x55761601d320)) called at /home/[user]/vcftools_0.1.13/perl/vcf-subset line 121
main::vcf_subset(HASH(0x557615b24558)) called at /home/[user]/vcftools_0.1.13/perl/vcf-subset line 12
Broken VCF header, no column names?
at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 172.
Vcf::throw(Vcf4_2=HASH(0x55fa53436f60), "Broken VCF header, no column names?") called at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 866
VcfReader::_read_column_names(Vcf4_2=HASH(0x55fa53436f60)) called at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 601
VcfReader::parse_header(Vcf4_2=HASH(0x55fa53436f60)) called at /home/[user]/vcftools_0.1.13/perl/fill-an-ac line 45
main::fill_an_ac(undef) called at /home/[user]/vcftools_0.1.13/perl/fill-an-ac line 9
sh: 1: /home/[user]/tabix-0.2.6: Permission denied
Broken VCF header, no column names?
at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 172.
Vcf::throw(Vcf4_2=HASH(0x5607d059a190), "Broken VCF header, no column names?") called at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 866
VcfReader::_read_column_names(Vcf4_2=HASH(0x5607d059a190)) called at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 601
VcfReader::parse_header(Vcf4_2=HASH(0x5607d059a190)) called at /home/[user]/vcftools_0.1.13/perl/vcf-subset line 121
main::vcf_subset(HASH(0x5607d00a1558)) called at /home/[user]/vcftools_0.1.13/perl/vcf-subset line 12
Broken VCF header, no column names?
at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 172.
Vcf::throw(Vcf4_2=HASH(0x556b8e952110), "Broken VCF header, no column names?") called at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 866
VcfReader::_read_column_names(Vcf4_2=HASH(0x556b8e952110)) called at /home/[user]/vcftools_0.1.13/perl/Vcf.pm line 601
VcfReader::parse_header(Vcf4_2=HASH(0x556b8e952110)) called at /home/[user]/vcftools_0.1.13/perl/fill-an-ac line 45
main::fill_an_ac(undef) called at /home/[user]/vcftools_0.1.13/perl/fill-an-ac line 9
/home/[user]/Desktop/AlleleFrequency/calculated_fra.process3085.1.1-10000.CEU_FIN
It appears that the script doesn't have permission to access Tabix for some reason. I've given the folder full read/write permission for the user executing the script (me). Any ideas?

You set -tabix to /home/[user]/tabix-0.2.6, but the code seems to need the path to the executable, not the top directory. Adding /bin/tabix to the path should probably fix the problem.

Related

gsutil ConfigParser.ParsingError: File contains parsing errors

I'm working on a fastlane lane using pink-room's fastlane firebase test lab plugin which needs a gcloud service account to connect to firebase and upload files to a bucket.
The service account is needed because the script runs in a docker container which must not be worked by humans.
Gcloud command seem to work, because the test are launched as intended, but the gsutil command which is use to upload raw results is failing.
When this service account is loaded, gsutil commands stop working because they throw a ConfigParser.ParsingError "File contains parsing errors".
Here is what I get when trying to execute gsutil version -l in order to gather more informations:
Exit status of command 'gsutil version -l' was 1 instead of 0.
Traceback (most recent call last):
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/gsutil", line 22, in <module>
gsutil.RunMain()
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/gsutil.py", line 116, in RunMain
import gslib.__main__
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/gslib/__main__.py", line 39, in <module>
import boto
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/third_party/boto/boto/__init__.py", line 53, in <module>
config = Config()
File "/usr/local/gcloud/google-cloud-sdk/platform/gsutil/third_party/boto/boto/pyami/config.py", line 63, in __init__
self.read(BotoConfigLocations)
File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read
raise e
ConfigParser.ParsingError: File contains parsing errors: /builds/project-0/gcloud
/legacy_credentials/<service account mail>/.boto
[line 3]: '/legacy_credentials/<service account mail>/adc.json'
Here is my .boto file :
[Credentials]
gs_service_key_file = /builds/project-0/gcloud/legacy_credentials/<service account mail>/adc.json
Do someone knows where this error comes from, and how I can fix it ?
You say your boto file only has 2 lines, but I don't think that's the case, based on your error message :) I'm guessing either there's whitespace in there that you're not seeing (some unicode character that might not render correctly in your editor, perhaps?), or you didn't copy/paste the contents exactly as they appear in your file.
After finding a similar issue in this blog post, I noticed that the error you're seeing will print out the entire content of each problematic line that it found. It says it's printing line 3 (that shouldn't be possible if the boto file has only 2 lines), but doesn't show the gs_service_key_file = text. I'm guessing there's some sort of line break between gs_service_key_file = and /build/project-0/... in your boto file.

Error while loading .ods sheet into Octave

I am trying to read a column of integers in a spreadsheet into Octave using the code
A = odsread('Data.ods', 'Sheet1', 'A1:A946');
But it fails and I get a message with warnings and errors as :
> unzip: cannot find or open Data.ods, Data.ods.zip or Data.ods.ZIP.
file Data.ods couldn't be unpacked. Is it the proper file format?
warning: UnZip failed with error 9
Output:
error: warning: STATE structure must have fields 'identifier' and 'state'
error: called from
__OCT_spsh_open__ at line 72 column 7
odsopen at line 267 column 30
odsread at line 179 column 7
So the error says that "STATE structure must have fields 'identifier' and 'state'" , what does this mean?
Apparently the full path to the file should be included to make it work. It cannot load the file itself even when the file is in the same directory.

Dual regression error (multiple files in a text file)

So I'm running into some trouble using dual_regression. The problem here is that I'm using the following command and getting the following error:
> macminngh:session_one_and_three sondosayyash$ dual_regression /Users/sondosayyash/Downloads/FIX_sNorm/40_subjects.gica/groupmelodic.ica/melodic_IC.nii.gz 1 -1 5000 dualreg_40subj_output.dr 'cat /Users/sondosayyash/Desktop/Users.txt'
/Users/sondosayyash/abin/fsl/bin/dual_regression: line 126: [: too many arguments
mkdir: dualreg_40subj_output.dr: File exists
mkdir: dualreg_40subj_output.dr/scripts+logs: File exists
creating common mask
/bin/sh: line 1: syntax error near unexpected token `dualreg_40subj_output.dr/scripts+logs/drA'
/bin/sh: line 1: `file (dualreg_40subj_output.dr/scripts+logs/drA) does not exist -T 5 -N drB -l dualreg_40subj_output.dr/scripts+logs dualreg_40subj_output.dr/scripts+logs/drB'
doing the dual regressions
sorting maps and running randomise
/bin/sh: line 1: you: command not found
I don't know where I'm going wrong.
As for the text file listed as 'Users.txt' has many different file directories to filtered_func data.
I have a feeling there is a problem with the text file but I'm not entirely sure.

How do a fix the cpan command when the SQLite index fails?

When attempting to use the CPAN command line, I am unable to either reload index or install any modules. There is an error with SQLite. If I disable the use of SQLite, I get a different error. Both are listed below. Has anyone found this problem before? How did you fix it?
"""WITH SQLITE"""
Fetching with LWP:
http://cpan.strawberryperl.com/modules/02packages.details.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/03modlist.data.gz
Creating database file ...
Gathering information from index files ...
fetch_info() failed! at C:\strawberry\perl\vendor\lib/CPAN/SQLite/Index.pm line
57, <DATA> line 58.
Indexing failed! at C:/strawberry/perl/vendor/lib/CPAN/SQLite.pm line 62, <DATA> line 58. CPAN::SQLite setup failed at C:/strawberry/perl/vendor/lib/CPAN/SQLite/META.pm l ine 329, <DATA> line 58. Catching error: "system C:\\strawberry\\perl\\bin\\perl.exe -MCPAN::SQLite::META =setup,update -e setup failed: 5632 at C:\\strawberry\\perl\\vendor\\lib/CPAN/SQ Lite/META.pm line 323.\cJ" at C:/strawberry/perl/lib/CPAN.pm line 391 CPAN::shell() called at C:/strawberry/perl/lib/App/Cpan.pm line 295 App::Cpan::_process_options('App::Cpan') called at C:/strawberry/perl/li b/App/Cpan.pm line 364 App::Cpan::run('App::Cpan') called at C:\strawberry\perl\bin/cpan line 8 """USERANDPASS"""
Fetching with LWP:
http://cpan.strawberryperl.com/modules/02packages.details.txt.gz
Fetching with LWP:
http://cpan.strawberryperl.com/modules/03modlist.data.gz
Creating database file ...
Gathering information from index files ...
fetch_info() failed! at C:\strawberry\perl\vendor\lib/CPAN/SQLite/Index.pm line
57, <DATA> line 58.
Indexing failed! at C:/strawberry/perl/vendor/lib/CPAN/SQLite.pm line 62, <DATA>
line 58.
CPAN::SQLite setup failed at C:/strawberry/perl/vendor/lib/CPAN/SQLite/META.pm l
ine 329, <DATA> line 58.
Catching error: "system C:\\strawberry\\perl\\bin\\perl.exe -MCPAN::SQLite::META
=setup,update -e setup failed: 5632 at C:\\strawberry\\perl\\vendor\\lib/CPAN/SQ
Lite/META.pm line 323.\cJ" at C:/strawberry/perl/lib/CPAN.pm line 391
CPAN::shell() called at C:/strawberry/perl/lib/App/Cpan.pm line 295
App::Cpan::_process_options('App::Cpan') called at C:/strawberry/perl/li
b/App/Cpan.pm line 364
App::Cpan::run('App::Cpan') called at C:\strawberry\perl\bin/cpan line 8
"""WITHOUT SQLITE"""
Going to read 'C:\strawberry\cpan\sources\modules\02packages.details.txt.gz'
Warning: Your C:\strawberry\cpan\sources\modules\02packages.details.txt.gz does
not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Warning: Your C:\strawberry\cpan\sources\modules\02packages.details.txt.gz does
not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Could not split line["\cI<head>"]
...Could not split line["\cI</head>"]
Could not split line["\cI<body bgcolor=\"#ffffff\">"]
Could not split line["\cI<script language=\"javascript\">"]
Giving up parsing your C:\strawberry\cpan\sources\modules\02packages.details.txt
.gz, too many errorsGoing to read 'C:\strawberry\cpan\sources\authors\01mailrc.t
xt.gz'
............................................................................DONE
Going to read 'C:\strawberry\cpan\sources\modules\02packages.details.txt.gz'
Warning: Your C:\strawberry\cpan\sources\modules\02packages.details.txt.gz does
not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Warning: Your C:\strawberry\cpan\sources\modules\02packages.details.txt.gz does
not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Could not split line["\cI<head>"]
...Could not split line["\cI</head>"]
Could not split line["\cI<body bgcolor=\"#ffffff\">"]
Could not split line["\cI<script language=\"javascript\">"]
Giving up parsing your C:\strawberry\cpan\sources\modules\02packages.details.txt
.gz, too many errorsLockfile removed.
You don't need to reinstall Strawberry anytime you have a problem. I know this is Windows, but life is better than that. Try deleting C:\strawberry\cpan\sources\modules\02packages.details.txt.gz, which appears to be corrupted. CPAN.pm should re-download it if it is missing.
I had the same problem and found the answer on this site. The problem can be solved by temporarily suspending the use of SQLite by CPAN and then updating the module that it uses it with. From the command line:
cpan
cpan> o conf use_sqlite 0
cpan> o conf commit
cpan> reload index
cpan> install CPAN::SQLite
cpan> o conf use_sqlite 1
cpan> o conf commit
cpan> ...

Doxyclean Error

I'm trying to run doxyclean but can't get it to work, any help would be appreciated...
I'm running from terminal :
./doxyclean.py --input=./xml/ --output=./clean/ --name="MyProject" --phone -v
I have my doxygen xml in the folder xml, in the same directory as doxyclean.py
The result is :
Checking arguments
Cleaning XML files:
Traceback (most recent call last):
File "./doxyclean.py", line 1220, in <module>
sys.exit(main())
File "./doxyclean.py", line 1171, in main
cleanXML(filePath, xmlOutputDirectory)
File "./doxyclean.py", line 93, in cleanXML
if not fileIsDocumented(filePath):
File "./doxyclean.py", line 62, in fileIsDocumented
originaldoc = minidom.parse(filePath)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/expatbuilder.py", line 924, in parse
result = builder.parseFile(fp)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xml/dom/expatbuilder.py", line 207, in parseFile
parser.Parse(buffer, 0)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 17, column 155
thanks
did you try other ways, my suggestions
use different version of doxyclean
change the arguments to different style, maybe give full paths to the folders.
./doxyclean.py -i Users/xxx/doxyclean/xml/ -o ./clean/ -p
regenerate xml from doxygen
doxyclean works fine. I got this error too and I tried my suggestion 2 and it worked.